-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
No connection to Insight with AAPS 3.3.1.3 #3846
Comments
Within pump UI If yes remove them, and try pairing a new device.
|
in our case we needed to install the mysugr app and pair via that app first. We keep the BT connection via mysugr app and then pair in AndroidAPS. |
I don't understand, AFAIK you cannot have several app connected to your pump at the same time but only one... Can you remove pairing with mysugr app and then try again pairing with AAPS and verify if it works correctly ? |
I have deleted all connected devices in my pump. I have also just tried with the mysugr app, also without success. So I have deleted the connection in my cell phone and in the pump, I get the pump displayed for pairing but no connection is established. When I update the AAPS to version 3.3.1.3 with a paired pump, I only get a time out under the new version. |
Very strange, update from 3.2 to 3.3 should keep the settings and the pairing... Do you have another phone to test if pairing issue is the same? Another possible test is to temporary downgrade AAPS to 3.2, pair again pump with AAPS and then upgrade to 3.3 (you will loose database, but an NSClient full sync should recover it) 🤔 @MilosKozak @TebbeUbben Do you have any ideas on how to track this issue? |
Just managed quickly on my dev conf a new pairing, in less than 20s Î saw the pump, selected it, approved the key on both sides and connection was ok. |
@Philoul your right also works without mysugrapp. |
my sugr app not installed (in none of my phones, loop or dev) |
I remember that A-C Insight has always supported two BT connections at the same time. For example one between pump and A-C remote controller, one between pump and Android phone. I have not tested with mySugr app. |
Insigh version in this issue seems to be 3.0. In my Insight the version is 2.01. This could cause some differences in BT pairing behaviour. |
I have now used AAPS with Insight over 4 years. I have always had some problems with BT pairing, typically it has never paired with the first try and several times is needed. A couple of times it did not succeed without special operations. The document mentions that when problems with pairing "... turn off bluetooth on pump AND smartphone for about 10 seconds and then turn it back on.". This has always solved the problem. |
No, pairing works with both versions, v2 and v3.
I agree that pairing process is the most tricky part within driver. On my side I never got so bad results but efficiency of pairing process can be linked to BT implementation within phone.
👍Good idea, on pump this can be done from menu, or just by removing battery |
Today I tried again. I decoupled the pump, deleted the connection in the pump and switched off the cell phone and pump for over 10 seconds. After the “downgrade” to version 3.2.0.2, the pairing works again immediately and without any problems. Unfortunately, I don't have another smartphone to test. I have been using AAPS with the Insight for several years, and unfortunately the problems only started with this version. |
When I look within log, I find this:
It's the first time I see this kind of error, but everything seems to be within
@TebbeUbben during driver migration to kotlin, I was not able to convert
Do you think we can adjust something to make the driver more "tolerant"? to allow pairing with ConnectionEstablisher.kt ? or just fix this issue with the java version of ConnectionEstablisher combine with kotlin for the other files of this driver like InsightConnectionService ? |
@Philoul The first step in Insight pairing is always low-level Bluetooth pairing. If the pump is already listed as a paired device in the Android system settings, you must first remove it before establishing a new connection, so that a new pairing is established upon connection. The system cannot reuse an existing pairing. However, this also means that any issues at this stage are likely deeper within the system's Bluetooth stack and beyond the driver's scope. In order to ensure that the system initiates a pairing, the previous bond is deleted using the following code in if (forPairing && bluetoothDevice.getBondState() != BluetoothDevice.BOND_NONE) {
try {
Method removeBond = bluetoothDevice.getClass().getMethod("removeBond", (Class[]) null);
removeBond.invoke(bluetoothDevice, (Object[]) null);
} catch (ReflectiveOperationException e) {
if (!isInterrupted()) callback.onConnectionFail(e, 0);
return;
}
} Unfortunately, removeBond is a hidden system API, so we can't invoke it directly using the Android SDK. However, as can be seen, using some reflection hacks, we can still call it. Please pay very careful attention to Now, let's look at your Kotlin code: if (forPairing && bluetoothDevice.bondState != BluetoothDevice.BOND_NONE) {
try {
val removeBond = bluetoothDevice.javaClass.getMethod("removeBond", null)
removeBond.invoke(bluetoothDevice, null)
} catch (e: ReflectiveOperationException) {
if (!isInterrupted) callback.onConnectionFail(e, 0)
return
}
} This code will do the latter and create an array containing |
@TebbeUbben Thanks for the hints and explainations, this gives me solutions to migrate the latest java file.
I think this Do you know if we can adjust some parameters or values to make connection more "tolerant" (increase timeout? other?) |
@Philoul ConnectionFailedException is a very general exception. It just indicates that the phone was not able to establish a connection on the Bluetooth/link layer. The connection fails before the driver has any means to do something. I can't think of anything that might cause this issue going from 3.2 to 3.3 since the code responsible for the Bluetooth connection remained unchanged. Possible debugging endpoints might be:
It might also be worthwhile to disable and re-enable Bluetooth on the pump, take out the battery and delete the pairing on the pump. Sometimes, it might refuse to pair when you mess too much with it. |
Hello,
I can no longer connect to my Accu Check Insight insulin pump with version 3.3.1.3.
It makes no difference whether I do an update or a complete reinstallation.
I find the pump during the pairing process, but when I select it nothing happens or the message “Connection failed” appears.
With version 3.2.0.2 the connection works without any problems.
My smartphone is a Xiaomi Redmi Note 9 pro with Adroid 12.
All authorizations have been set and the energy-saving measures have been deactivated.
I have attached a log file from the “Pump Control” version.
AndroidAPS.log
The text was updated successfully, but these errors were encountered: