Gadgetbridge JS and Banglejs2

Posted on
  • I was looking to use gadgetbridge for the first time. I installed it from the google apps store on my phone which has android 12. I answered and set all the permissions it requested when opening it. But I can't add a device if I try either from the menu or from the + the app just backgrounds itself. It appears to do this after attempting to access location as on initial install (tried it many times) it gets as far as asking for fine access and then the display backgrounds. Bringing it to the foreground you are back at the main screen.

    I have manually added a device using the debug facility and when I try to connect to it I get an error "Cannot connect : Need android.permission.BLUETOOTH_CONNECT permis..." and I can't see the rest of the message.

    I have tried unpairing the watch, turning off and on bluetooth on the phone and even rebooting it. But no luck.

    Can anyone suggest a way forward. It seems like the app should be asking for the permission but isn't so can't access the bluetooth hence can't display the scan results.

  • I had something sort of similar happen yesterday when switching versions of gadgetbridge. Even after setting the permissions in each prompt, I still had to go into the app settings and set all the permissions there. Hope that helps fix your problem.


    1 Attachment

    • Screenshot_2023-06-21-23-32-00-52_ab1359306de43320f9557c797b1c4be5.jpg
  • I think you need to do this: http://www.espruino.com/Gadgetbridge#ext­ra-setup

    • Go to Android Settings on your Android Device
    • Go to Apps then Permissions then Permissions(again)
    • Now click Calendar and scroll down to Bangle.js Gadgetbridge and check if it is under Allowed. If not, click it under Denied and then click Allow
    • Now click Location and scroll down to Bangle.js Gadgetbridge and check if it is under Allowed All the Time. If it is, click it and then click Allow

    It's frustrating that Allowed All the Time has to be manually set - it seems to be something that Android added (in Android 11?) which meant that the app can't actually ask you to have location all the time and you have to manually set it up.

    ... but location all the time literally just means scanning for Bluetooth devices in this case.

    I guess it's to protect against abusive apps, but it's really annoying.

  • Unfortunately that didn't work. Although the menu positions are different I've given the app every permission available in the UI including Calendar, call logs, contacts, location (allowed all the time) nearby devices (accessed in the last 24 hours), phone, SMS and storage(media). And any permissions requested during the app startup.

    I also followed the extra setup you pointed me at Gordon

    I still get the same backgrounding and no display of the scan screen. Adding the bangle2 manually through debug again gives the same bluetooth connect permission required.

  • Oh it also is worth mentioning the web IDE on PC works and the app loader on both phone and PC work so the bluetooth connectivity on the phone and watch work.

  • @Gordon

    Maybe this relates to this:
    https://codeberg.org/Freeyourgadget/Gadg­etbridge/pulls/2924#issuecomment-931226
    https://codeberg.org/Freeyourgadget/Gadg­etbridge/pulls/2924#issuecomment-932755

    @ZaragonArt You could try installing via f-droid instead?:
    https://search.f-droid.org/?q=gadgetbrid­ge&lang=en

    I think the standard Gadgetbridge app should not cause you these problems - it seems like it may be something with the recent changes to Bangle.js Gadgetbridge.

  • What about:

    Gadgetbridge -> Settings -> Discovery and Pairing Options -> Ignore bonded devices ?

    Is that still true? If it is, it'll hide the Bangle.js from view if it was ever connected before!

  • Thanks for the help but that doesn't impact the problem. If I try to discover the bangle2 is crashes/backgrounds and doesn't show the scan screen and if I manually add the watch and try to connect then it gives the missing Bluetooth permission error. It looks like it isn't displaying the scan screen because it doesn't have permission to access Bluetooth and is either crashing or waiting for it to return from a screen it can't get to.

    But just in case I have tried turning off the hide option with no change.

  • Ok, sorry it's still a problem. So the error you're seeing is still the BLUETOOTH_CONNECT one?

    And if you go into Android's Settings, then Apps, then Bangle.js Gadgetbridge every single permission it requests is Granted? I think you said above that's the case.

    Just checking, but it's not that you'd also installed plain Gadgetbridge too and given the permissions to that and not Bangle.js Gadgetbridge?

    I guess you could try uninstalling and reinstalling it if that helps somehow...

    What phone do you have? And it's not a company/school phone that's locked down in some way?

    I had seen some error reports from the Play Store from this kind of permission issue, but I was pretty sure it was from users not giving permission to Location when requested, rather than anything else.

  • I've just made some changes to the Play Store app - please can you ensure you're signed up as a tester to make sure you get the latest version: https://play.google.com/apps/testing/com­.espruino.gadgetbridge.banglejs

    Looking at the crash reports on the store, it seems to affect only Android 12+, and while my phone's stuck on 11 I did manage to try it on an Android 12 Tablet and reproduce.

    It's not ideal - you'll have to tap discover a few times before it requests all the permissions it needs - but once you've done that it should be ok (and it shouldn't crash!).

  • Looking at the crash reports on the store, it seems to affect only Android 12+

    Also Android 13? Because mine which is Android 13 doesn't crash.

  • Thanks Gordon. I'm currently waiting for the test version to be pushed to me having signed up. But to confirm, yes I am still seeing the Bluetooth_connect permission error. Yes in Android settings I've given every single permission available and that includes fine location all the time. I haven't installed the plain Gadgetbridge so I haven't been confusing it. I have also tried the uninstall and reinstall a number of times. The phone is my personal phone and is not additionally locked down in any way other than the standard Android installation.
    When I see the update pushed I'll try it and add a reply with the results.

  • Having updated the app it will now connect. It didn't ask me for any additional permissions and it displayed the scan screen and the two bangles were found as was a bluetooth printer :)

    Unfortunately although it will now connect it doesn't seem to be communicating properly. On both bangle2 devices if I try to use the app manager I get "Device connection failed - invalid JSON". Trying to go to My Apps and it is just displaying the throbber and a refresh button. Pushing the refresh gives a message "Getting app list" then followed by "Getting app list failed, invalid JSON".

    In activity and sleep I am seeing heart rate I think, it doesn't seem to have read the history from the watch but may be showing it from the point of connection. It's only 10 mins ago so not much to display if that's the case. Though as an aside I have noticed that since I updated the watch to the latest firmware and apps five days ago it seems to be misreading my pulse rate by almost 50% for the last hour it shows my rate as 86 but my resting rate is closer to 55-60 when sat in a chair here as I have for the last hour. Before the update it showed as expected.

    The other panels in activity and sleep aren't showing any data. I was about to say that if I go to speed zones I get a warning that (I think) that a gadget bridge plug in isn't loaded on the watch. But I don't get that having just tried it again now to get the error message. So I'm not sure if it is working but not getting/showing data or not working.

    I am tentatively assuming that it is only collecting data whilst the watch and phone are connected so I'll keep them together overnight and see what they show in the morning.

  • Overnight the app manager is now working as expected. So the changes that you made Gordon to the app has resolved the crash/missing permission.

    I haven't been able to find a way to stop messages from the phone being displayed on the watch so if anyone can suggest how I can disable that please let me know.

  • Also Android 13?

    According to the Play Store reports, there are crashes on that too - but nothing before 12.

    I haven't been able to find a way to stop messages from the phone being displayed on the watch

    You can go to Gadgetbridge (on Android), Notification Settings, then Use the Applications list to... and choose Allow notifications from selected apps. So now it won't show anything unless you explicitly enable it.

    Or if you want to just ignore certain messages you can use that messages list, or when viewing the message in the watch, tap the icon in the top right and Ignore.

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

Gadgetbridge JS and Banglejs2

Posted by Avatar for ZaragonArt @ZaragonArt

Actions