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

Riley Link Orange can't connect with dev branch #1359

Closed macarolobe closed 2 years ago

macarolobe commented 2 years ago

Impossible to connect the RileyLink Orange with dev branch [d39e9e9] . The state of RileyLink is stuck to initialization of RileyLink. Connection is ok with master branch.

happygirlnyc70 commented 2 years ago

I can confirm. The aaps wiki process no longer works with the new dev branch regardless of firmware when using my Pixel 4a 5g. However when using my Pixel 1 Android 10, orange link firmware 2.5 connects without any issues ( no wiki l process needed).

macarolobe commented 2 years ago

It's the RL check for permission before connect code the problem https://github.com/nightscout/AndroidAPS/commit/b1d45833c5570910142e78ba39a8322b4039a9d5

With master branch code no problem to connect RL Orange.

MilosKozak commented 2 years ago

you should see notification to request permissions add logs if you can reproduce

macarolobe commented 2 years ago

No notification to request permission. The state of RileyLink is stuck on initialization. RileyLink Orange FW 3.2 / Samsung S10e with android 12 AndroidAPS_LOG_1645777569074.log.zip Screenshot_20220225-092053_AndroidAPS .

Alamo04 commented 2 years ago

@macarolobe Had the same in the past, befor switch to Combo.

After Update to 3.x and first start AAPS, I see no permission request. After restart Phone, or closing and restart AAPS, the permission request comes up.

macarolobe commented 2 years ago

It was with android 12 ? I tried to restart aaps and android but nothing change, the RileyLink Orange is stuck to initialization with NO notification to request permissions. I've changed code to connect without request permissions and it's ok.

seattlebrighton commented 2 years ago

I'm having the same problem with dev branch and Android 12 on pixel 5. Rileylink stuck in initialization with no request popup, even after restarting Bluetooth, phone, Rileylink. Went back to master branch and it connected immediately.

jroth-haj commented 2 years ago

@MilosKozak I have the same problem with Pixel5 (Android 12), MDT and EmaLink / RileyLink. Also no authorization request after reboot. AAPS 3.0.0.1 connects in a few seconds.

piecycle commented 2 years ago

I can confirm this. I was running dev from February 4th without any issues, but when trying to update to the latest dev yesterday, I just couldn't establish a firm connection to my OL. In fact, if I scan for it in the Omnipod Eros settings, it is found immediately and I can also set it as my RileyLink, but the OL doesn't vibrate to indicate a real connection, and indeed the RileyLink Status on the Omnipod Eros screen is stuck at "RileyLink initialization...". I have tried reinstalling several times (not deinstalling the app), clearing the AAPS cache, clearing my bluetooth cache. Absolutely nothing worked. When I downgrade my AAPS to the older dev version from February, it will connect immediately. I have also tried connecting without a currently active Pod (i.e. between pod changes). Didn't help. As the OP above also used Pods, and seemingly also Eros pods, I can imagine that it is related to the Omnipod Eros driver, perhaps.

Running AAPS on a Pixel 3 XL with Android 12. No authorization request after reboot.

Attached my logs (set to: CORE, APS, OHUPLOADER, PUMP, PUMPBTCOMM, PUMPCOMM, PUMPQUEUE, PROFILE - hope that's enough?). Within the last hour I have tried getting the connection to work several times. The last attempt was at 9:13, here's what I did:

The logs contain traces of the plugins I am developing flagged as 'Tsunami', but the version I installed at 9:13 (and a few times before that) was a clean vanilla dev build without any mods as pulled from the dev branch so my plugins are not connected to this issue (and I also never touched any pump drivers). Let me know if you need more data @MilosKozak ! AndroidAPS.log

piecycle commented 2 years ago

I can also confirm that the code change described by OP works as a workaround. In "RileyLinkBLE.kt" inside the function "connectGattInternal", changing

if (config.PUMPDRIVERS && Build.VERSION.SDK_INT >= Build.VERSION_CODES.S && ... to if (config.PUMPDRIVERS && Build.VERSION.SDK_INT > Build.VERSION_CODES.S && ...

allows me to connect to my OL without any issues.

happygirlnyc70 commented 2 years ago

I have been able to connect quickly and reliably to OL using dev-i, build be604bc3b.

jroth-haj commented 2 years ago

Yes, seams to be solved.