nightscout / AndroidAPS

Opensource automated insulin delivery system (closed loop)
https://wiki.aaps.app
GNU Affero General Public License v3.0
696 stars 1.7k forks source link

DanaRS pump: Re-pair needed after change from 26.02.2023 #2444

Closed Alamo04 closed 1 year ago

Alamo04 commented 1 year ago

Before that change I only needed to pair my DanaRS once, after I get the pump over one year ago.

Now I had to re-pair my pump two times in 5 days again, last time this morning while sleeping.

Please remove this change, its annoying: https://github.com/nightscout/AndroidAPS/commit/1fa2cb937095647843ef9febdc344b26fb6133a9

AndroidAPS._2023-03-0306-57-38.1.zip

CaptainBalou commented 1 year ago

I can confirm that I had that too a couple of times. But not as often as on your setup. But it happened to me. During that time I had no pump replacement or so, it just happened during normal operation.

Alamo04 commented 1 year ago

@MilosKozak Re-pairing was as followed:

06:56:23.859 [CommandQueueImplementationHandler] D/PUMPQUEUE: [CommandQueueImplementation.notifyAboutNewCommand$lambda$6():213]: Starting new thread 06:56:23.861 [Thread-2629] D/PUMPQUEUE: [QueueThread.run():112]: connect 06:56:23.862 [Thread-2629] D/PUMP: [DanaRSPlugin.connect():163]: RS connect from: Connection needed 06:56:23.862 [Thread-2629] D/PUMPBTCOMM: [BLEComm.connect():112]: Initializing BLEComm. 06:56:23.864 [Thread-2629] D/PUMPBTCOMM: [BLEComm.connect():141]: Trying to create a new connection from: Connection needed 06:56:23.868 [Thread-2629] D/PUMPBTCOMM: [BLEComm.setCharacteristicNotification():280]: setCharacteristicNotification 06:56:24.605 [binder:17857_5] D/PUMPBTCOMM: [BLEComm.onConnectionStateChangeSynchronized():361]: onConnectionStateChange 06:56:24.871 [Thread-2629] D/PUMPQUEUE: [QueueThread.run():106]: connecting 1 06:56:25.494 [binder:17857_5] D/PUMPBTCOMM: [BLEComm$mGattCallback$1.onServicesDiscovered():235]: onServicesDiscovered 06:56:25.496 [binder:17857_5] D/PUMPBTCOMM: [BLEComm.getSupportedGattServices():328]: getSupportedGattServices 06:56:25.497 [binder:17857_5] D/PUMPBTCOMM: [BLEComm.setCharacteristicNotification():280]: setCharacteristicNotification 06:56:25.528 [binder:17857_5] D/PUMPBTCOMM: [BLEComm.sendConnect():520]: >>>>> ENCRYPTIONPUMP_CHECK (0x00) A5 A5 0C E1 FA DB A7 BC B8 D0 CA B9 D9 BC CA 31 C6 5A 5A 06:56:25.725 [binder:17857_5] D/PUMPBTCOMM: [BLEComm.processConnectResponse():551]: <<<<< ENCRYPTIONPUMP_CHECK V3 (OK) 02 00 4F 4B 4D 05 50 11 0D 06:56:25.728 [binder:17857_5] D/PUMPBTCOMM: [BLEComm.sendV3PairingInformation():652]: >>>>> ENCRYPTIONTIME_INFORMATION A5 A5 03 E1 FB 88 E0 BB 5A 5A 06:56:25.857 [binder:17857_5] D/PUMPBTCOMM: [BLEComm.processEncryptionResponse():658]: <<<<< ENCRYPTIONTIME_INFORMATION 02 01 00 06:56:25.859 [binder:17857_5] D/PUMPBTCOMM: [BLEComm.processEncryptionResponse():672]: Connect !!

Take also a look at line 9102/3 in Log.

06:56:38.479 [binder:17857_5] D/PUMPBTCOMM: [BLEComm.onConnectionStateChangeSynchronized():372]: Device was disconnected SGFxxxxxxx (Serial Removed by me)

Last connection to pump was a few seconds before that, in line 9073 (06:56:31.231)

06:56:31.231 [Thread-2629] D/PUMPCOMM: [DanaRSService.readPumpStatus():255]: Pump status loaded

MilosKozak commented 1 year ago

try dev now

MilosKozak commented 1 year ago

https://github.com/nightscout/AndroidAPS/commit/f651f721e00b71fd2c5a1bec7f92f4a21a5a12d7

Alamo04 commented 1 year ago

Done, will report if it comes up again.

Will test it for a week, because I had that issue twice in 5 days.

Alamo04 commented 1 year ago

@MilosKozak Just now happend again on workplace.

MilosKozak commented 1 year ago

provide logs

Alamo04 commented 1 year ago

AndroidAPS.log AndroidAPS._2023-03-0804-34-38.1.zip AndroidAPS._2023-03-0804-34-38.0.zip

Think it happend here: 09:50:34.442 [Thread-1945] D/PUMPQUEUE: [QueueThread.run():112]: connect 09:50:34.442 [Thread-1945] D/PUMP: [DanaRSPlugin.connect():163]: RS connect from: Connection needed 09:50:34.442 [Thread-1945] D/PUMPBTCOMM: [BLEComm.connect():112]: Initializing BLEComm. 09:50:34.445 [Thread-1945] D/PUMPBTCOMM: [BLEComm.connect():141]: Trying to create a new connection from: Connection needed 09:50:34.450 [Thread-1945] D/PUMPBTCOMM: [BLEComm.setCharacteristicNotification():280]: setCharacteristicNotification 09:50:35.457 [Thread-1945] D/PUMPQUEUE: [QueueThread.run():106]: connecting 1 09:50:36.459 [Thread-1945] D/PUMPQUEUE: [QueueThread.run():106]: connecting 2 09:50:37.460 [Thread-1945] D/PUMPQUEUE: [QueueThread.run():106]: connecting 3 09:50:38.461 [Thread-1945] D/PUMPQUEUE: [QueueThread.run():106]: connecting 4 09:50:39.462 [Thread-1945] D/PUMPQUEUE: [QueueThread.run():106]: connecting 5 09:50:40.464 [Thread-1945] D/PUMPQUEUE: [QueueThread.run():106]: connecting 6

Think, a better way will be to deactivate Bluetooth wait 5 seconds and activate BT again. Normaly the pump connects again then and no new pairing is needed. My display on the pump has some scratches, so its hard to read all characters if new pairing is needed. Especially in darker environment.

MilosKozak commented 1 year ago

turning off BT adapter is not possible with Android 13 already. The code will be removed

MilosKozak commented 1 year ago

sorry, but the problem is between phone and pump. On your place I'd try different phone first Sadly Dana pumps don't have a way to check if encryptions keys are ok. Pump simply doesn't respond. Thus reaction of AAPS to not responding pump (after some attempts) is clearing the encryption keys

Alamo04 commented 1 year ago

The system works fine before that change, only sometimes (after 5 days today) the connection was lost and then I got an alarm, restart BT and everything was fine again.

Can't we stay with that ? Don't need a new pairing in that case, ist's a lot faster to de-/activate BT.

Pixel5, DanaRS, AAPS latest, Boyda

MilosKozak commented 1 year ago

previous solution had another issues

Alamo04 commented 1 year ago

Changed to Dana-i (don't like that pump) and no re-pair comes up for the lat 7 days. Also, if a re-pair was needed, the pairing code is mutch shorter.

So I have to use that pump now, instead of my lovely DanaRS. :(

wootmasterslick commented 1 year ago

Seems like I just had this problem with dana-i. Does this screen look familiar?

image

Alamo04 commented 1 year ago

No, it isn't a pairing window.

Your screen shows only that your pump wasn't connected in AAPS. Perhaps empty battery?