Bangle & Arduino communication through Bluetooth? #5322
Replies: 1 comment
-
Posted at 2022-10-18 by @gfwilliams I haven't specifically done anything, but if you can configure the Arduino code to expose a Bluetooth characteristic then it should be trivial to handle on Espruino. Also worth adding that Espruino implements the Web Bluetooth API, so if you can find an example of using the Arduino code with Web Bluetooth then you can pretty much copy/paste the Web Bluetooth code onto Bangle.js and it should work Posted at 2022-10-18 by ThomasVikström Thx @gfwilliams! Looking at this this tutorial I understand Web Bluetooth is supported. Until the device is delivered, I'll try communicating between a Wio Terminal (using Arduino) and Bangle.js2 to understand a bit more. Posted at 2022-10-18 by ThomasVikström Ok, so now I've been able to transmit a value from Wio Terminal through Arduino with this code. I've tried to get my head around Bluetooth communication through this, this, and other BT-tutorials found at Espruino.com, but I'm still at loss how to connect from Bangle.js2 and read this simple value, so would appreciate any help. I purchased 3 Pucks around 6 years ago, and if I remember correctly it was very easy to connect them together through Bluetooth, but can't find that code now. Of course the current use case is not identical, so don't know how much it would help anyway. Edit: Can't delete an attachment (the huge picture), sorry for that Attachments: Posted at 2022-10-19 by @gfwilliams Which characteristic are you trying to read from? Battery level? I think what you need is It looks like there might be a UART characteristic there, and to use that the code above can be used pretty much as-is. But for battery I think something like this might do it:
Posted at 2022-10-19 by ThomasVikström Thx @gfwilliams! Posted at 2022-10-20 by @gfwilliams Great! You can use Posted at 2022-10-20 by ThomasVikström Not a problem, I learned something while searching for info about MAC-addresses. Especially for other Bluetooth- and JS-newbies like me, below skeleton JS-code can either show the value received, or a simple graph. Just remove/add comments at the On the JS-side there's for sure room for improvement, one thing that puzzles me is this line
Posted at 2022-10-20 by ThomasVikström
No problems when using the vector font though Posted at 2022-10-21 by @gfwilliams Ahh - Posted at 2022-10-21 by ThomasVikström Well “numeric” in the font name should’ve told me something, glad to get it straightened out. Posted at 2022-10-26 by user150493 hi all, i am looking for a simple code to transmit the heart rate from the bangle to a shell via bluetooth (hs 05). can you help me? Posted at 2022-10-26 by ThomasVikström Did you perhaps mean HC-05? That seems to be a classic Bluetooth device and not a BLE device. Bangle supports BLE, and I'm not sure if it's possible to communicate directly between classic and BLE devices. Posted at 2022-10-27 by user150493 ok thanks, need to find BLE device |
Beta Was this translation helpful? Give feedback.
-
Posted at 2022-10-12 by ThomasVikström
I'm expecting to receive a Nicla Sense ME within a couple of weeks, and thought that I'd try to send data from it to Bangle.js2 through Bluetooth, probably showing some dashboard or graphs on the watch. Here's the datasheet btw.
Has anyone done something similar with any Espruino and Arduino device and be willing to share the code, especially the Arduino code?
I'm aware of the tutorials, e.g. this one, and it seems quite easy to communicate between Espruino devices, might be easy on the Arduino side as well.
Beta Was this translation helpful? Give feedback.
All reactions