Widget idea: BLE Battery Service #4820
Replies: 1 comment
-
Posted at 2020-08-05 by user91203 What would happen if another app or widget also called Posted at 2020-08-06 by @gfwilliams Hi - that sounds like a good idea... But yes, multiple calls to
Then as long as other apps followed the same form they could all work together Posted at 2020-08-18 by user91203 This was added as boot code: espruino/BangleApps#542 Posted at 2021-11-11 by user91203 What do I need to do to make this available on Bangle JS 2 as well? Just test to see if it works, then update Posted at 2021-11-11 by @gfwilliams Yes, that's all that's needed - thanks! You can test it just by connecting with the app loading, clicking top-left to choose 'all apps' and then clicking 'install' Posted at 2022-06-08 by kab How would I use this example as a way use my bangle2 to advertising it as a beacon?
but get a "Uncaught Storage Updated" when I try to save it to a file in storage on the watch. I want to figure out how to use it in this format
so they all play together Posted at 2022-06-09 by @gfwilliams
That's fine I think. All it means is you changed the boot code (I guess you wrote it to For the **BUT ** the issue is that iBeacon can't be used in the same advertising packet as other data. It has to have a packet all to itself. All I can suggest is:
Which will 'rotate' the advertisements - so you get one Bangle.js advert and one iBeacon one. However the next time another app like I don't see there's an easy way around that, apart from maybe overwriting setAdvertising:
Posted at 2022-06-09 by kab Thanks for info on error. Posted at 2022-06-09 by @gfwilliams Ahh, ok - my fault. I've just updated it to use Posted at 2022-06-09 by kab
First "rotating" the advertising code seems to work. Stick to no more ble advertising and I should be fine? Posted at 2022-06-10 by @gfwilliams Could you post up exactly the code you used? It seems like maybe you could have had the code in there twice, or
var myiBeacon = require("ble_ibeacon").get({ NRF.setAdvertising = function(a,b) { var _setAdvertising = NRF.setAdvertising; function advertiseBeacon() { if (!Bangle.bleAdvert) Bangle.bleAdvert = {}; setInterval(advertiseBeacon, 60 * 1000); advertiseBeacon();
var myiBeacon = require("ble_ibeacon").get({
|
Beta Was this translation helpful? Give feedback.
-
Posted at 2020-08-05 by user91203
Hi. I was thinking it would be nice if the Bangle could advertise it's battery level (so Home Assistant can remind to charge it, for example).
Does anything like this exist? Is a widget the right way to do it? Something like this works for me.
I'll open a PR if this is sensible. Thanks.
Beta Was this translation helpful? Give feedback.
All reactions