You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
5.49 h the alarm rose for connection loss with dana i pump on Samsung S24 ultra ,
No action from me, as still sleeping. Password seems to got lost at 5.09 o'clock.
Last time I saw this pump connection was not affected- only "password deleted " message popped up.
Using latest dev build from 12.11.
AAPS 4.0.1-dev-a
Build: 50c7961-2026.11.12 Flavor: fullrelease Platform: Android Nightscout Version: 15.0.10
I had a look at this, also because of #5538 (same message on 4.0.0).
The message comes from BLEComm.processConnectResponse(). After connecting, AAPS sends ENCRYPTION__PUMP_CHECK and expects OK, PUMP or BUSY back. Everything else ends up in the "wrong serial number" branch, which calls clearPairing() straight away and posts "Password cleared!". So one bad answer is enough to lose the pairing.
In the log from 17.11. you can see how it happens:
07:03:56.420 >>>>> ENCRYPTION__PUMP_CHECK (0x00)
07:03:56.731 BT watchdog - toggling the phone bluetooth
07:03:56.741 Device was disconnected
07:03:59.807 >>>>> ENCRYPTION__PUMP_CHECK (0x00)
07:03:59.935 <<<<< ENCRYPTION__PUMP_CHECK (ERROR) 02 00
07:03:59.956 Pairing keys cleared
The watchdog cuts the connection about 300 ms after the pump check was sent. On the next connection 3 s later the pump answers with an empty message (02 00), probably still busy with the broken handshake, and AAPS treats this as a wrong serial number. In the same log the pump answered BLE5 OK about 50 times, so the serial is fine. It's a single bad answer, not a real mismatch. Here the Dana-i sent its key again a few minutes later and it reconnected by itself, but on 13.11. it took 40 minutes.
A wrong serial number would fail every time, a disturbed handshake only once. So my suggestion is to only clear the pairing after 3 unexpected answers in a row (kept across connections), and reset the counter on any known answer. Before that, just disconnect and let the queue reconnect like for any other connection error. A real wrong serial is still caught, just on the third attempt.
Activity
CaroGo commentedon Nov 17, 2026
https://drive.google.com/file/d/1TvF1yqwyxORlHGJAftGe6B9zJHRuWeLx/view?usp=drivesdk
Some more logs, event at 7.08 o'clock on 17.11.
blaqone commentedon Nov 17, 2026
I had a look at this, also because of #5538 (same message on 4.0.0).
The message comes from
BLEComm.processConnectResponse(). After connecting, AAPS sendsENCRYPTION__PUMP_CHECKand expects OK, PUMP or BUSY back. Everything else ends up in the "wrong serial number" branch, which callsclearPairing()straight away and posts "Password cleared!". So one bad answer is enough to lose the pairing.In the log from 17.11. you can see how it happens:
The watchdog cuts the connection about 300 ms after the pump check was sent. On the next connection 3 s later the pump answers with an empty message (
02 00), probably still busy with the broken handshake, and AAPS treats this as a wrong serial number. In the same log the pump answered BLE5 OK about 50 times, so the serial is fine. It's a single bad answer, not a real mismatch. Here the Dana-i sent its key again a few minutes later and it reconnected by itself, but on 13.11. it took 40 minutes.A wrong serial number would fail every time, a disturbed handshake only once. So my suggestion is to only clear the pairing after 3 unexpected answers in a row (kept across connections), and reset the counter on any known answer. Before that, just disconnect and let the queue reconnect like for any other connection error. A real wrong serial is still caught, just on the third attempt.
I put this on top of current dev, one commit with unit tests:
blaqone/AAPS-autoISF@9e04c43
Happy to open a PR if this approach is ok.