Gadgetbridge

Posted on
  • This. is. AWESOME!

    Please, keep us informed about your progress with Gadgetbridge - implementing it for Bangle.js is an absolute killer feature and definitely raises Bangle.js to the level of far more expensive smart watches!

    Is there already an API one could start investigating?

    Thanks in advance for your effort!

    Kind regards,

    Andreas Rozek

  • There is, but it's not online yet. I'll let you know when I have something up :)

  • I've managed to compile the new version (0.40) of Gadgetbridge using the instructions here https://codeberg.org/Freeyourgadget/Gadg­etbridge/wiki/Developer-Documentation#bu­ilding-and-installing-the-gadgetbridge-a­pk then loaded the .apk to my phone. My query is what do I need turned on in the watch settings to make it work? Notifications only seem to come through on the watch if I have both BLE and Programmable set to On and leave the watch in 'Connectable' state. If I turn off Programmable then the notifications don't appear but after sending 5 or 6 of them to the watch I get an error message at the bottom of the screen about a buffer full error. It's like the messages are being sent to the watch but not read by anything. So do I need the watch to be 'Programmable'? That seems rather risky as there doesn't seem to be any security around the pairing process - no PINs displayed or requested. The docs here https://www.espruino.com/Gadgetbridge suggest that Bangle.js should interpret the incoming messages in a special way and it's only on other Espruino REPLs that the commands execute a 'GB(...)' function.

  • The docs here https://www.espruino.com/Gadgetbridge suggest that Bangle.js should interpret the incoming messages in a special way and it's only on other Espruino REPLs that the commands execute a 'GB(...)' function.

    The documentaion does not mention it is in any way special so I am guessing you need it 'programmable' state as it is just a call of GB() method over ordinary javascript console.

    Feels a bit insecure but there can be some whitelist implemented in future, there were some examples here previously - basically you hook few lines of your code into 'on connect' event and disconnect when device is not on allowed list. So you could perhaps have some 'learning mode' when you would allow connections ad learn mac addresses of allowed devices and then switch in menu to restricted mode to allow only previously learned predefined list.

    Of course it could be also done over special service quite easily but that would need changes in gadgetbridge and other software too - the nordic uart service is already supported in some software out of box (like e.g. DroidScript or some Arduino android apps).

  • Gadgetbridge have released the new version 0.40 with initial bangle.js support: https://f-droid.org/packages/nodomain.fr­eeyourgadget.gadgetbridge/

    Andrew

  • I installed the Gadgetbridge application from F-Droid (0.40.0) and the Gadgetbridge app for Bangle.js.

    I cannot manage to connect my phone with the Bangle.js, even though I went to the application on my watch and clicked "On" in the "Find Phone" menu multiple times. Am I missing something here? Could someone please help me out? I'd be glad to help out by writing a more comprehensive guide once I manage to figure it out myself.

    Thanks!

  • Go to settings app on the watch, make connectable "no" then go back into make connectable and select "yes". Then try adding the watch again in the gadgetbridge app on the phone.

  • @Andrewmk Hi, that didn't work. Please check your DMs, I can give more specific info there, if you'd like to help me figure this one out...

  • Hi. I'm afraid that's the only suggestion I have - make it not connectable then connectable again. Also it seems that it has to have programmable 'on' as well. The connection is definitely flaky on my devices - whether it's the phone, the watch or both I don't know.

  • @Andrewmk what about inside the Bangle.js app? What did you do? Just go to "Find Phone" and click on "on" and proceed to the settings app? There was an update to the Gadgetbridge Android app today, but I still have the same issue. My phone cannot manage to find the Bangle.js, unfortunately. What's even more irritating that it found an MiBand, and I found an old MiBand in the drawer.

    But not the Bangle.js lol. I just cannot manage to make it show up and I have no clue what's wrong.

  • Find phone is nothing to do with it. That's supposed to make your phone ring when you've lost it (it doesn't). On the watch you need to go into settings and make sure programmable is on and go into make connectable and set to yes. In gadgetbridge on the phone you then click the big plus button to add a new device and hope the bangle watch shows up. If it doesn't my only fix has been to go into settings on the watch again and toggle make connectable to no, exit back to the watch face, then go into settings and make connectable 'yes'. I think we'll need to wait for @Gordon to get back to work to debug these connection issues. Mine is still very flaky.

  • I had the same issue trying to connect with Gadgetbridge. Ultimately, the fix was simple: I restarted my phone. Not sure why, but that's all I needed to do. Give that a try if you haven't yet.

  • Did you have any luck connecting?

    To try and sum up though:

    • Bangle.js needs to be 'connectable' and 'programmable'.
    • If you're not seeing Bangle.js in Gadgetbridge, maybe make sure you've given it access to 'Location' in Android - since it needs that to be able to access Bluetooth.
    • You may find that using 'pairing' is what's making the connection flaky. Can you try removing the device in Gadgetbridge and then re-adding and choosing 'no' when asked if you want to pair?
    • "Find phone" won't help you connect
    • For security I could add a 'whitelist' to the settings app as was suggested above - just added an issue here: https://github.com/espruino/BangleApps/i­ssues/78 While this obviously needs doing, right now the phone will be connected to Bangle.js whenever it is in range which will stop anyone else from connecting to (or even seeing) Bangle.js
  • I don't know what's changed but my connection between Gadgetbridge on the phone and the watch has now been up solidly for three days (at least it's up each time I look at it). I think I restarted my phone sometime in the last few days so maybe that did it as suggested by @user71255.

  • I had zero success with Gadgetbridge until today when I realised the version on the Play Store is 0.3x whilst I needed 0.4x :-) Working brilliantly now. Love it!

  • Yeah, you have to use F-Droid rather than the Play Store. There's some explanation on Gadgetbridge's site but basically it's like an automatic build & publish tool for Android apps, so I can see the attraction from an Open Source project's standpoint :)

  • Mine has gone back to the flaky behaviour - disconnecting until I toggle connectable on the watch. Restarting the phone and reconnecting in Gadgetbridge without pairing hasn't made any difference.

  • Do you have any idea what might have changed?

  • Nothing that I'm aware of, that's what's so frustrating. It feels to me like something on the watch end as the Gadgetbridge app on the phone can be trying to connect, I toggle 'connectable' on the watch off and on and the app connects immediately. But I suppose it could be the phone end keeping a dead connection open or something - not knowing how it all works I'm speculating from ignorance.

  • On the watch, do you still have BLE and Programmable set to On? If you don't that'd definitely cause you big issues.

  • Yes, definitely (BLE and Programmable both on). Maybe my phone has wider bluetooth pro0blems - sometimes my fitbit stops syncing and if turning bluetooth off and on again doesn't fix it I have to restart the whole phone.

    Just had to restart my phone for that very reason. But even after doing that, Gadgetbridge would only reconnect to the watch once I toggled connectable off and on again on the watch.

  • I believe I'm a lost cause at this point. I've tried everything and am using the latest versions (newest firmware and Gadgetbridge 0.41.0) yet my Pixel won't connect to the watch. I keep scanning, it finds all sorts of other devices but not the Bangle.js. On the other hand, my Bangle.js's Bluetooth works just fine for loading apps and stuff...

  • Is it possible you'd left your computer connected to Bangle.js? Bangle.js can only connect to one device at a time, so if you had it connected to a PC for uploading apps and hadn't disconnected then it would never show in your phone

  • Unfortunately, no. It's probably a bigger problem 😅

    Also, I lack the know-how required to debug it.

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

Gadgetbridge

Posted by Avatar for Andreas_Rozek @Andreas_Rozek

Actions