TwiistOff documentation¶
TwiistOff is a proof-of-concept driver and bench-testing app for the Sequel Twiist insulin pump. These docs cover three things: using the app on a bench, what a driver needs from the pump (the protocol reference), and where the real looping driver for AndroidAPS stands. Everything here was learned from one pump unit on an off-body saline bench.
⚠️ Bench hardware only. Never connect TwiistOff to a pump that is attached to a person. Saline or water only. TwiistOff is not a medical device. Read the full safety and legal disclaimer in the repository README first.
Where things stand: see the status page — what is verified, what is partial, and every known unknown (TBD).
Using TwiistOff¶
| Page | What it covers |
|---|---|
| Build and install | Requirements, building the APK, installing, running the unit tests, the REST bridge port |
| App tour | The screens, what each one does, and the project layout |
| Pairing and setup | Pairing mode, bonding, arming with your key, cassette fill/prime/basal, re-pairing, registration |
| Bonding and export | Bond mechanics and the one-file session export |
| Bench testing | Hard rules, a test matrix, a delivery safety checklist, how to report results |
| Self-diagnosis | An ordered pass/fail walk of the whole control path |
| REST API | Every route of the debug bridge with examples, error shapes and danger classes |
| Troubleshooting | Symptoms and fixes |
What a driver needs (protocol reference)¶
| Page | What it covers |
|---|---|
| What a driver needs | What any looping driver needs from the pump, layer by layer, and what it must hold first |
| BLE and session | Advertising, GATT surface, bonding, arming, re-key / reboot / re-arm |
| Crypto and transport | Key derivation, AES-CCM sealing, frame layout, numbering, therapy numbers, reply matching, NACKs |
| Status fields | pumpStatus, loopStatus, cgmStatus byte maps and the per-bit pump state |
| Alarms, alerts and NACKs | Alarm / alert bits, display ids, NACK codes and what to do with each |
| Setup and recovery | Settings, the delivery gate, the cassette sequence, fresh pair → running, alarm recovery |
| Delivery | Basal, temp basal, bolus, cannula fill — payloads, limits, measured behaviour |
| History and log records | Reading the pump log and decoding its records |
| Command catalogue | Every opcode with its family and verification state |
| State model | How TwiistOff models the pump: readiness, command path, gating |
Real looping drivers¶
An AndroidAPS driver is in progress; it is not ready to loop and its code is not public yet. It is built to run on a bench with your own pump's key. The missing piece for everyone else is a way to get a pump's key (provisioning), not the driver.
| Page | What it covers |
|---|---|
| Overview | The drivers and what stands in the way |
| AndroidAPS | The AndroidAPS driver: state, what works, what is stubbed |
Conventions¶
- ✅ Verified — exercised live on an off-body saline bench (one pump unit) with the expected result. 🟡 Partial — works, but the full range or effect is not mapped. 🧪 Identified — opcode and shape known, not yet accepted on the bench. ⛔ TBD — not solved; the note says what is missing.
- Multi-byte values are little-endian unless stated. UE2 = hundredths of a unit (0.01 U, or 0.01 U/h for rates). Pump time is seconds since 2008-01-01 UTC.
- Field and enum names are working names; this is not manufacturer documentation.