Bangle.js

Posted on
  • Hello, our team is currently working on a project wherein we connect our bangle.js to an application. We are using Flutter + Firebase. How do we send data from the watch to the application, specifically its heart rate.

  • Hi - you'll need to have a Bluetooth Low Energy connection to the Bangle. It seems there are a few libraries out there - this may help: https://leancode.co/blog/bluetooth-low-e­nergy-in-flutter

    Once you have that you have two options:

    • You can use the standard 'Nordic UART' protocol that bangle.js provides, like in https://www.espruino.com/Interfacing#blu­etooth-le - and then you have access to the REPL (basically the left-hand side of the IDE) so can just call print on the Bangle and receive the data back as text. Looks like there is already an example of this at https://github.com/wolfc01/flutter_react­ive_ble_uart_example
    • Or you can use NRF.setServices/NRF.updateServices on the Bangle to make a service specifically for the data you want. There is even a standard one for heart rate, so you could implement that, and then you just need to request that service/characteristic from Flutter and you'll have the data 'right there'. There seems to a project here that uses the HRM characteristic might work if you stripped it down: https://github.com/lmarceau/flutter-blue­tooth

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

Bangle.js

Posted by Avatar for user151653 @user151653

Actions