• Hi everyone,

    I've got problems with the connection between Bangle.js 2 and GadgetBridge.
    Any time the connection is dropped (either by manually deactivating it on the phone or walking out of range), a reconnection cannot be built up. GadgetBridge on my phone is just showing "Warten auf Wiederverbindung" ("waiting for reconnection").

    If I delete the connection both on the phone and on Bangle.js and reconnect them, it will work again until the next loss of connection.

    I'm using:

    On my phone:

    • LineageOS 18 / Android 11, rooted
    • GadgetBridge 0.64.0 from F-droid
    • AppOsX for managing App permissions
    • AFWall+ for managing network permissions

    On Bangle.js:

    • The "Android Integration" app on Bangle.js

    To connect phone and Bangle.js, I do

    1. On Bangle.js go to Settings -> Bluetooth -> Whitelist -> Add device
    2. On my phone/Gadgetbridge click on the "+" sign to add a new device
    3. On my phone click on Bangle.js, then "nicht koppeln" ("don't couple")

    Is anyone else observing this behavior?
    Are there any known incompatibilities?
    Also, I recognized that the displayed Bluetooth address on Bangle.js changes every time I create a new connection and it is not identical to the Bluetooth address that's displayed on my phone ("About phone" -> "Bluetooth address"). Is this normal?

    Thanks,
    Kc

  • Hi,
    I have a similar problem with reconnecting the Bangle to GadgetBridge when it loses connection. Sometimes it works, sometimes I have to redo it by hand, sometimes even manually it doesn't work. But it is probably related to the range of the bluetooth of monBangle which seems very short (50cm).

    However, regarding your problem, it probably comes from whitelisting, which you can do without.

  • I've been using the whitelist and haven't seen an issue like this (neither complete failure to reconnect or changed Bluetooth address), but I do choose to pair when connecting the watch in Gadgetbridge. Maybe you could try that?

  • @johan_m_o: Unfortunately, pairing does not work. GadgetBridge refuse to create a connection if I try to.

  • Ok, just tried without whitelist.
    This seems to work. Also, pairing is working now.

    Is there some way to display which devices are currently connected to Bangle.js?

  • Ok, some additional tests:

    I removed all devices from GadgetBridge and Bangle.js, then added a new device to the whitelist again and also did it with pairing in GadgetBridge (it worked after some tries).
    Now, as long as I'm still in the settings menu on Bangle.js, the reconnection works reliably.

    When I go back to the clock app (Bangle.js reboots for that), the existing connection still works but any following disconnect/reconnect fails.

  • Are you using the Whitelist option on Bangle.js? That'll be your problem.

    Is there some way to display which devices are currently connected to Bangle.js?

    No, but only one device can be connected at a time. And with new Android there's usually address randomisation so the MAC address of the phone changes each time and so whitelisting on the Bangle isn't much use.

  • That's too bad. Anyhow, I don't like the idea of anyone being able to connect to my Bangle without any further hurdles :-/

    UPDATE:
    Yes, I use the whitelist option. But I'm not sure this is the real problem (see my last tests in the comments above).

  • You could try turning passcode on?

    But first, please just try keeping all the Bluetooth settings at their defaults and see if you can still connect. At least then we can narrow it down

  • @Gordon:

    1. Resetted all settings to default. Connecting was no problem. Reconnecting (deactivate/reactivate Bluetooth on phone) also works.
    2. Activated passcode. This also connects fine when providing the correct code. Reconnecting also works.
    3. Added the device to whitelist. Reconnecting works as long as I don't leave the settings app. Even when switching Bluetooth off and on again on my phone. When I leave settings, reconnecting does not work anymore.

    When doing "add device" in the settings and then reconnecting (by switching Bluetooth on the phone off, then on and then reconnect GadgetBride) multiple times, I get different device addresses. So it really seems as if the phone changes its address every time Bluetooth is switched off and on again. Anyhow, it's strange that it's still possible to reconnect with (presumably) different address as long as I do not leave the settings app.

  • it's strange that it's still possible to reconnect with (presumably) different address as long as I do not leave the settings app.

    I think it's because the settings are only properly applied when you exit the app.

    I think this is closed then - the 'Read more' section of the Settings app does say pretty clearly:

    NOTE: iOS devices and newer Android devices often implement Address Randomisation and change their Bluetooth address every so often. If you device's address changes, you will be unable to connect until you update the whitelist again.

  • @Gordon:
    Too bad :)
    On the other side, it seems this is what "resolvable random private addresses" in BTLE are for. Is there any chance Bangle and GadgetBridge could use this?

    Apart from this: Yes, the topic can be closed.

  • I believe you can set Bangle's MAC address to a private address with NRF.setAddress(addr) - but I don't really understand why that'd help

  • My idea was to set the phones address to a resolvable random private address with a preshared key (IRK) and let the Bangle use this for authentication purposes every time a device tries to connect to it.

    But maybe this is already what happens when passkey is used? I'm not really deep in Bluetooth details, so bear with me :)

  • Yes, I'm pretty sure that's what happens when passkey is enabled (well, I don't know about the address, but I think the pre-shared key must work regardless of the MAC address)

  • Ok, great. Btw: Is there any way to use a passkey that is longer than 6 characters and maybe also uses alphanumerical characters instead only numerical ones or is this a hardware limitation of Bangle? A key space of only 100000 different keys looks like it could be easily bruteforcable.

  • or is this a hardware limitation of Bangle?

    It's a limitation of Bluetooth LE I believe. It is also possible to do 'out of band pairing' using a QR code right now I think.

    It's not something that is implemented in JS at the moment but someone could probably implement it

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

GadgetBridge reconnection does not work if Whitelist enabled

Posted by Avatar for Kc @Kc

Actions