Get message from Gadgetbridge #4988
Replies: 1 comment
-
Posted at 2020-04-06 by @gfwilliams You just need to define a function called
More info on what form the data takes is at http://www.espruino.com/Gadgetbridge Posted at 2020-04-06 by NebbishHacker This would override the GB function if it's already defined, correct? What if multiple apps want to receive events? Posted at 2020-04-06 by Purple-Tentacle Okay, I saw that code in the BG widget and I am using it in my app. The problem is, that I have to read what is playing, when I start the app.
Posted at 2020-04-07 by @gfwilliams
Yes - however since only one app runs at a time you're kindof ok. The only potential conflict is Widgets - if you're making a 2nd widget that exists alongside Gadgetbridge, or if your app is loading widgets then there's a problem. What I'd suggested in another post was just to change everything to do:
Since we're never going to have loads of them active it might be the most sensible solution for now.
Just make sure Gadgetbridge is connected to Bangle.js and you're sorted!
I think the best way to do this is just to send a Posted at 2022-07-04 by CarlR I'm having the exact same problem as Purple-Tentacle was having. I can get gadgetbridge to control music on my Android phone, but I can't figure out how to get it to return info such as the artist name, etc. How do you use the GB function to do that? The following (taken from the espruino gadgetbridge docs) just gives "My Artist" and not the name of the artist of the music being played.
Posted at 2022-07-04 by @gfwilliams The code you posted above is just for testing (if you paste that in the left of the web IDE). In reality Gadgetbridge should send a string a bit like that, but with artist/etc all filled in correctly. At least it does for me when music is playing. You could check with the Posted at 2022-07-05 by CarlR I found the problem - it was the music-player I was using. I switched to the current most popular Android one and the data then started turning up. Oddly, the 'Gadgetbridge Music Controls' app had worked when I tried it before, but was a bit flaky. Anyway, thanks for the help. Posted at 2022-07-07 by @gfwilliams Great! Just so we know...
Which one was that? Posted at 2022-07-07 by CarlR Muzio Player. (On a second look, probably not the most popular player.) The one not working was Pulsar. Posted at 2022-07-10 by CarlR Those were from the Play Store. So I've spent a bit too much time since trying the different Music Players on F-Droid, of which there's twenty or so! Most are Gadgetbridge friendly, although not all of them behave as they should with music events. ie. You'd ask for the previous track and the player would switch to it but no musicinfo event would be received acknowledging the change. But a lot did behave, such as VCL and a more lightweight one called Auxio. I've written a little app for testing music players, which I'll get around to adding to github soon. I've set myself the task of getting the Bangle 2 to handle music like my aging Pebble does. With the Pebble, I can not only control the phone's music players and FM Radio, but switch between them, thanks to the Android app Music Boss. I'm guessing switching between apps like that isn't possible with gadgetbridge yet? Posted at 2022-07-11 by @gfwilliams
I think it might be - at least for some players. Gadgetbridge can now send 'intents': http://www.espruino.com/Gadgetbridge#intents And many Android apps provide ways for you to send an intent to get them to start up and do what you want. Worst case you could just send an intent to Tasker, and get Tasker to do what you want Posted at 2022-07-12 by CarlR Thanks! I'll look into that. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2020-04-04 by Purple-Tentacle
I know how to push something from Bangle to Gadgetbridge.
How can I get something from Gadgetbride to Bangle (pulled from Bangle, not pushed by Gadgetbridge)?
I would like to read music information in an app on the Bangle.
Thanks
Beta Was this translation helpful? Give feedback.
All reactions