Skip to content

Serve a control panel and an iOS Simulator transport - #21

Merged
ps2 merged 1 commit into
mainfrom
web-ui-and-simulator
Oct 12, 2026
Merged

ps2 merged 1 commit into
mainfrom
web-ui-and-simulator

Conversation

@ps2

@ps2 ps2 commented Oct 12, 2026

Copy link
Copy Markdown

The pod executable now serves its own control panel, like g7sim's, at
the API address (-api, default :8080): the pod's state, and controls for
the reservoir, pod age, alerts, faults and crashing on the next command.
It drives a JSON API (GET /status, POST /command) with the commands the
websocket takes; /ws stays for the separate React frontend. Bad
commands are now errors, not a fatal exit.

-transport impossible serves the pod to an app in the iOS Simulator
through ImpossiBLE's socket instead of a Bluetooth adapter, so Loop can
pair with and run a simulated pod on any Mac. The Bluetooth layer is
split so the message framing is shared: the paypal/gatt radio builds on
Linux only, and the Simulator radio anywhere. It holds a connect for
its start delay, as iOS does: OmnipodKit's heartbeat relies on that.

A reconnect while pairing or establishing a session, or before the
phone acknowledges a response, used to leave the pod waiting on the
old connection forever (over Bluetooth it usually exited instead); it
now starts over on the new one.

Run against Loop in the iOS Simulator together with g7sim through LoopKit/g7sim's impossible-mux; see the README's "Run against the iOS Simulator" section. Needs loopandlearn/OmnipodKit's simulator-bluetooth change so OmnipodKit uses Bluetooth instead of its Simulator mocks.

Verified on an iPhone simulator: Loop paired, primed and inserted the cannula, ran status commands, survived the pod's idle hangup and a Loop relaunch. go test -race ./pkg/... passes; builds for linux/arm.

The pod executable now serves its own control panel, like g7sim's, at
the API address (-api, default :8080): the pod's state, and controls for
the reservoir, pod age, alerts, faults and crashing on the next command.
It drives a JSON API (GET /status, POST /command) with the commands the
websocket takes; /ws stays for the separate React frontend. Bad
commands are now errors, not a fatal exit.

-transport impossible serves the pod to an app in the iOS Simulator
through ImpossiBLE's socket instead of a Bluetooth adapter, so Loop can
pair with and run a simulated pod on any Mac. The Bluetooth layer is
split so the message framing is shared: the paypal/gatt radio builds on
Linux only, and the Simulator radio anywhere. It holds a connect for
its start delay, as iOS does: OmnipodKit's heartbeat relies on that.

A reconnect while pairing or establishing a session, or before the
phone acknowledges a response, used to leave the pod waiting on the
old connection forever (over Bluetooth it usually exited instead); it
now starts over on the new one.
@ps2
ps2 merged commit 3f82784 into main Oct 12, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant