Skip to content

Dana I password deleted and connection loss  #5571

Open

Description

@CaroGo

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

Logs:
https://drive.google.com/file/d/1tqwfjfOGIjQ3ZJpKQictRF3hFzk24us1/view?usp=drivesdk


I guess it's the same problem as mentioned here: #5538

Screenshot_20261113_054631_AAPS.jpg

Activity

  1. CaroGo commented on Nov 17, 2026

    @CaroGo
    ContributorAuthor
  2. blaqone commented on Nov 17, 2026

    @blaqone

    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.

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions