• I guess you probably already spotted it but there is some general info at http://www.espruino.com/BLE+Node-RED

    What I'd suggest is instead of the Bangle detecting EspruinoHub, you work the other way...

    • The Bangle sets its advertising based on whether it has data or not (http://www.espruino.com/BLE+Node-RED#det­ecting-button-presses) - maybe you advertise data only if you have some available, and then if there is data available you advertise some unique number representing that data (the day number?)
    • NodeRed then scans for those advertisements:
      • If the advertisement number is there and is a number that Nodered doesn't have, it downloads it
      • if the advertisment number is there and is a number that Nodered already has then it instead sends a command to delete it.

    Downloading

    For this you want some function on the Bangle that'll send all the data via the UART... So something like http://www.espruino.com/Data+Collection#­simple-example

    Then to download you do something like http://www.espruino.com/BLE+Node-RED#con­trolling-the-puck and then send the command getData()\n

    Then you just listening on /ble/data/c7:f9:36:dd:b0:ca/nus/nus_rx and decoding the packets of data as they come in.

    BUT... honestly decoding the data and keeping track of what you've got could end up being quite hard to do using NodeRed. I'm not really fluent enough with it to know.

    You might actually find it easier going direct with a custom Node.js app and https://www.espruino.com/Interfacing#nod­e-js-javascript

About

Avatar for Gordon @Gordon started