Sukrara (alpha)

01 — Getting live Libre 3 glucose onto a Mac, without the cloud

2026-10-15 · investigation report · code in spikes/

Goal

Replace the current setup — an xbar plugin polling LibreLinkUp over the internet — with a macOS menubar item showing the glucose number and a precise trend arrow, with data that never leaves the user’s devices.

Questions:

  1. Can macOS read the FreeStyle Libre 3 sensor itself?
  2. Otherwise: can Juggluco on the phone send the data to the Mac without internet?
  3. Added during the investigation: it must also work with no shared network — Mac with no Wi-Fi at all, or Mac on home Wi-Fi while the phone is on mobile data. USB is not acceptable.

Setup

   
Sensor FreeStyle Libre 3 Plus (15-day wear), started 2026-10-03
Phone Pixel 10 Pro, Android 17 (SDK 37), rooted (KernelSU Next); Juggluco 11.4.1; GlucoDataHandler
Mac macOS 27.0.1, Apple Silicon; Swift 6.4 (Command Line Tools only, no Xcode)
Units mg/dL; personal thresholds low 65 / slightly high 145 / high 185

Results at a glance

Path Works? Latency Notes
Mac ↔ sensor directly (BLE) ✅ proven — Phone must release the sensor; per-sensor pairing data from the phone; NFC still needed to start a sensor
Juggluco web server → Mac over USB (adb forward) ✅ instant Not practical (cable)
Juggluco web server → Mac over Wi-Fi ✅ ~0.3 s Needs a shared network and Juggluco “Local only” off
Juggluco → GlucoBridge (phone) → Mac over BLE ✅ ~0.2–1 s Works with Mac offline / phone on mobile data; 17/17 readings with phone unplugged + screen off
Bluetooth PAN tethering ❌ — macOS 27 has no Bluetooth PAN support
Juggluco’s built-in “BLE mirror” ⚠️ not built — Feasible but large, undocumented, moving target

1. Can macOS read the Libre 3 directly?

Yes — but not as the everyday path.

Constraints that rule it out as the main path:

Possible future use: an emergency fallback when the phone is gone (dead battery, left at home).

2. Juggluco → Mac without internet

Juggluco has a built-in, Nightscout-compatible web server (Settings → Web server). Facts confirmed from its source and live:

Rate precision: the sensor reports the rate with 0.01 mg/dL/min resolution; in a 5 h sample 98 % of values were non-integer (short runs of exact 0 occur). Enough to draw a continuous arrow.

Wi-Fi results (spikes/menubar, “auto” mode):

3. With no shared network

Option Mac offline Mac Wi-Fi + phone mobile data Verdict
Phone hotspot ✓ (Mac joins it) ✗ (one Wi-Fi radio) Partial
Bluetooth PAN tethering — — macOS 27 dropped it (no “Bluetooth PAN” port, no driver)
Tailscale / VPN ✗ ✓ Needs internet
Juggluco “BLE mirror” ✓ ✓ Mac would have to speak Juggluco’s mirror sync protocol (handshake + session crypto + acking its internal file-sync stream). ~1–1.4k lines of Swift against an undocumented protocol that changed several times in 2026. Rejected.
Companion app + BLE GATT ✓ ✓ Chosen

GlucoBridge (spikes/glucobridge-android, Kotlin)

A foreground service on the phone that:

Characteristic UUID Properties Value (little-endian)
service 6c1f0001-5b8a-4d8e-9a3c-676c75636f42    
READING 6c1f0002-… read, notify u32 epoch s ‖ u16 mg/dL ‖ i16 rate×100 (0x8000 = unknown)
HISTORY 6c1f0003-… read (long) u32 newest epoch s ‖ u16 mg/dL per minute, newest first (180 slots, 0 = gap)

Tests

Test Result
BLE only (GlucoseBar -lan NO) Found GlucoBridge in 3 s; every reading ~0.3 s after the phone
Phone Wi-Fi off (phone on mobile data, Mac on home Wi-Fi) Wi-Fi transport dropped; BLE delivered every minute (19:03–19:05, ≤ 1.2 s)
Phone unplugged + screen off, 19:08–19:25 BLE 17/17 readings, 0 missed, worst 0.2 s, never disconnected
Both transports at once Same reading arrives twice (BLE ~1 s earlier); the app merges them

Raw log: evidence/01-transport-tests.log. (Wi-Fi readings stop at 19:12 because “Local only” was switched back on — not a failure.)

Not yet validated: deep Doze (phone unplugged and still > 30–60 min), Mac sleep/wake, Mac with Wi-Fi truly off (simulated with -lan NO), range, long-term reconnect behaviour.

Gotchas:

4. Menubar UI (GlucoseBar)

Trend arrows for −4…+4 mg/dL/min

Menubar item Sparkline

Decisions

  1. Mac app: BLE central to the phone app is the primary transport; Wi-Fi to the phone is secondary; both merged.
  2. Phone app (future Juggluco replacement, Kotlin): owns the sensor and serves the Mac over BLE GATT. GlucoBridge is its seed — only the data source changes.
  3. Don’t build on Juggluco’s BLE mirror. Keep “Mac reads the sensor directly” only as a possible fallback.

Open questions / next PoCs

Toolchain notes

References