Skip to content

Report a reset fault the way a reset pod does - #32

Merged
ps2 merged 3 commits into
mainfrom
reset-fault-counters
Nov 25, 2026
Merged

ps2 merged 3 commits into
mainfrom
reset-fault-counters

Conversation

@ps2

@ps2 ps2 commented Nov 7, 2026 •

Copy link
Copy Markdown

A reset fault reported its fault time, total delivered, bolus remaining and minutes since activation like any other fault. OmnipodKit treats a fault that has a fault time as a non-reset fault, so testing a reset fault on the simulator ran the wrong path. For example, a 0x10 during a bolus reported fault time 0012, 2.75 U not delivered and 89 pulses delivered.

What real pods report

45 reset-fault detailed statuses from field reports (0x10, 0x12, 0x22, 0x34, 0xD6 and 0xD7, from DASH, Omnipod 5 and Eros) all show:

  • Fault time: 0000 on DASH, FFFF on Eros, and either on Omnipod 5 (Joe has seen both).
  • Delivered: 0.
  • Bolus not delivered: 0, except some Omnipod 5 0x22 statuses whose word is 07FF (0x3FF in the 10-bit field).
  • Minutes active: 0–6, because the count restarts at the reset.

Change

  • Reset codes: 0x0D, 0x0E, 0x0F, 0x10, 0x12, 0x1E, 0x22, 0x34, 0x36, 0x3B, 0x4F, 0xD6 and 0xD7, from the PDM-Ref-Codes wiki.
  • SetFault with a reset code: records when the reset happened and sets the fault time to 0000 on a DASH and FFFF on an Omnipod 5, so OmnipodKit sees both. A non-reset code, or clearing the fault, forgets the reset.
  • Detailed status (type 2): a reset pod reports 0 delivered and 0 bolus remaining.
  • Detailed status and type 3: minutes active counts from the reset.
  • Internal accounting: unchanged. The bolus still stops at the fault, as it does since Stop a bolus at a fault and keep reporting what it left undelivered #30.

The 0x3FF sigil for 0x22 isn't simulated, since real pods show it inconsistently.

Testing

go test ./... passes, including new state tests: a reset fault's marshaled status, an Omnipod 5 reset fault's FFFF fault time, the reset-code list, and a non-reset fault keeping its time and counters.

A reset fault reported the fault time, total delivered, bolus remaining
and minutes since activation like any other fault, so OmnipodKit took it
for a fault with a known time and never ran its reset handling.

In 45 reset statuses from real pods (DASH, Omnipod 5 and Eros) the fault
time is always zero ($FFFF on Eros), delivered and bolus not delivered are
zero, and minutes active restarts at the reset. The simulator now reports
those after a reset fault, while keeping its own delivery books, with the
bolus stopped at the fault.
@itsmojo

itsmojo commented Nov 25, 2026 •

Copy link
Copy Markdown

The list of values for that are known reset pod faults in IsResetFault() is incorrect. The correct list for reset pod faults can be found in the Reset Faults section of the PDM-Ref-Codes wiki document here. The missing reset fault codes are 0x1E, 0x36, 0x4F. Also 0xAA is listed as a reset fault, but I'm guessing that this was probably a guess based on its name which came from Insulet enum names (Excessive resets) and not from looking at the values returned from an actual 0xAA fault. My best guess is that 0xAA is not actually a hardware MCU reset fault and so I'd rather leave 0xAA off the list of [known] reset faults until we see one that can verify either way. With this, the cases for known reset pod fault codes should be 0x0D, 0x0E, 0x0F, 0x10, 0x12, 0x1E, 0x22, 0x34, 0x36, 0x3B, 0x4F, 0xD6, 0xD7.

Based on the reset faults it looked at, Claude concludes that the fault time will be FFFF only on Eros, but the comments and code I had added for the O5 to OmnipodKit DetailedStatus decode states For pod reset faults, this value can be $ffff (Eros or O5) and $0000 for (DASH). I went back and looked for any O5 reset faults that had logging for and found a couple of O5 0x34 reset faults that did have a $FFFF fault time. But I also found a single O5 0x22 reset fault with a $0000 fault time. I'm not sure if the fault time for an O5 reset pod fault consistently varies per fault code or based on the firmware version or something, but we can safely say that for O5 reset faults, the fault time can be either 0x0000 or 0xFFFF. I'd suggest adjusting this PR so that the pod sim returns $0000 for DASH and $FFFF for O5 for the fault time on reset faults (so that both cases can be exercised in OmnipodKit) and including a comment that says both values have been seen for the O5, but the simulator just uses $FFFF for the O5 to contrast it from DASH.

In my two O5 0x34 reset pod faults, the bolus not delivered word was $0000 , but in my O5 0x22 reset pod fault the bolus not delivered word was $07FF (as Claude had found). We probably should add code to OmnipodKit's DetailedStatus decoder to test for this impossible bolusNotDelivered value and map it to 0. This is assuming the safest case where any interrupted bolus would be counted as fully delivered (unless it ends up being limited by the fault time in the improved interrupted bolus handling during pod faults now in OmnipodKit).

ps2 added 2 commits November 25, 2026 08:16
…e FFFF

The reset faults are the ones in the openomni PDM-Ref-Codes wiki: 0x1E,
0x36 and 0x4F are added, and 0xAA is dropped because no 0xAA status has
been seen to show it resets the pod.

Omnipod 5 reset faults have reported both 0000 and FFFF as the fault time.
The simulator uses FFFF for an Omnipod 5 and 0000 for a DASH, so OmnipodKit
gets exercised with both.
# Conflicts:
#	README.md
#	pkg/pod/state_test.go
@ps2

ps2 commented Nov 25, 2026

Copy link
Copy Markdown
Author

Thanks Joe. Done in 9170c0e:

  • The reset fault list now matches the PDM-Ref-Codes wiki: added 0x1E, 0x36 and 0x4F, and dropped 0xAA until we see one.
  • A reset fault reports a fault time of 0000 on a DASH and FFFF on an O5. A comment notes that O5 has been seen reporting both.

I also corrected the PR description, which said FFFF was Eros-only.

Mapping the 07FF bolus-not-delivered word to 0 belongs in OmnipodKit's DetailedStatus decode, so I'll do that as a separate OmnipodKit change.

@itsmojo

itsmojo commented Nov 25, 2026

Copy link
Copy Markdown

The updates all good to me. I'll handle updating OmnipodKit to deal with a potential 07FF value bolusNotDelivered on a reset fault and to update the comments to state that the O5 can have either fault times of either 0000 and FFFF.

@itsmojo itsmojo left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! It might be nice to add a comment to IsResetFault() stating that this list of known reset faults was taken from https://github.com/openaps/openomni/wiki/PDM-Ref-Codes#Reset-Faults.

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.

2 participants