Receiving Data on the Phone via Bluetooth

Posted on
  • Hello everyone,

    I would appreciate some help. I'm trying to use the bangle.js on a school project, where I want to stream data to a website. The problem is that I need to send that data to a phone first and then have it be sent to the website.
    I did not find many ways for the watch to communicate with the phone. I saw and tested with the Gadgetbridge, but did not find a repository with the code for bangle.js, to be able to customise it.
    I also saw a project off someone doing something similar and using the Bangle Run app, I believe, but I'm not sure if It could be useful.

    I only need a way to store the data received by Bluetooth.

    If anyone has any advice, it would be greatly appreciated.

    Sincerely,
    Jorge Gonçalves

  • The most direct solution would be coding your own app based on examples from the internet, but requires mobile developer skills.
    Eg.
    https://github.com/NordicSemiconductor/A­ndroid-BLE-Library

    Another option, if you have a device like a raspberry pi laying around, could be to install EspruinoHub which acts as a bluetooth -> mqtt bridge. Then you would install a macro/automation based program on your phone such as Tasker/Macrodroid etc and create rules for interacting with the mqtt system. Mqtt is wifi protocol.

  • Hi,

    Do you need it to be able to send data over 'in the background', or would it be acceptable to have the phone turned on and showing a webpage?

    Because if you could have the webpage showing then you can just use Web Bluetooth and it's pretty easy. For example there's some code for real-time streaming at http://www.espruino.com/Bangle.js+Data+S­treaming

    Otherwise you're going to have to write some kind of Android app as @d3nd3-o0 says. If you don't want to get stuck into full-on Android development you might have some luck with DroidScript I guess: https://www.espruino.com/DroidScript+Puc­k.js

    For Gadgetbridge, if you did want to customise it the code is at https://codeberg.org/Freeyourgadget/Gadg­etbridge

    The Bangle.js code you care about is in https://codeberg.org/Freeyourgadget/Gadg­etbridge/src/branch/master/app/src/main/­java/nodomain/freeyourgadget/gadgetbridg­e/service/devices/banglejs/BangleJSDevic­eSupport.java and you could just add some code to handleUartRxJSON to handle communication from the Bangle

    The developer doesn't use GitHub because they blocked him temporarily due to a fraudulent DMCA request and it scared him off.

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

Receiving Data on the Phone via Bluetooth

Posted by Avatar for JorgeGonçalves @JorgeGonçalves

Actions