Get Battery Level and RSSI in JavaScript
I need to query the Battery Level after the MetaMotionR is found. I also want to query the RSSI value each second.
How can I do this using JavaScript?
This discussion has been closed.
I need to query the Battery Level after the MetaMotionR is found. I also want to query the RSSI value each second.
How can I do this using JavaScript?
Comments
https://mbientlab.com/cppdocs/0/settings.html#battery-state
https://github.com/noble/noble#update-rssi
Thanks Eric, but it´s still not clear to me how to realize it in JavaScript.
Regarding the battery, this is my approach:
How can I realize the inner part?
Ok, I was thinking too quick, got the battery query work now:
For the RSSI issue I don't really see any approach... I need to get the new RSSi value each time it changes...
How can I use the Noble functions? Could someone please provide a quick JavaScript example?
You should check the Noble GtiHub repo for code examples / ask Noble specific questions there.
Hi Eric,
Is there is a simple way to get the one time off battery level of sensor, without subscribing to periodic updates? I've noticed the MetaWear.BatteryState but haven't figured out how to use it... I noticed above that you referencing to C++ API but I don't understand how to use examples from C++ in JavaScript...
Look at the code posted in this thread.