• I wonder if you could point me in the direction to get started.
    I would like to be able to automatically (?) download my recorder gpx tracks(s) locally either via an automation (eg every day at xx:ii), or eg whenever I am within ble of my espruino hub.

    Like when I walk in my front door and pass my rasppi, or every night.

    I currently have a py automation file that can go get my garmin gpx tracks and store them on my DB, and I'd like to do something similar with my bangle2 recorder gpx files.

    Not quite sure where to start.
    Thanks

    Thanks

  • +1, I'm interested too!

  • Is your Bangle connected to Gadgetbridge, or it's more something you're interested in doing with EspruinoHub?

  • nope, not connected to gadgetbridge.
    I use espruino hub now for mqtt and bluetooth "translation" to get my puck ble advertising into home assistant for controlling automations with button presses.

    what I was thinking
    I currently have presence detection via bluetooth/home assistant. When presence is detected coming in the front door, check to see if any data avail (via bangle bluetooth ad?) , if so automatically download it to NAS (or somewhere)

    like I said, clueless so not even sure of the questions to ask.

  • Ok, well, this bit is what you need then I think: https://github.com/espruino/EspruinoHub#­connections

    So...

    • When you get presence detect on the bangle, start sending /ble/notify/MAC_ADDRESS/nus/nus_rx once a second
    • Start listening for /ble/data/MAC_ADDRESS/nus/nus_rx topics
    • Now send JS code to /ble/write/MAC_ADDRESS/nus/nus_tx - maybe something like require("Storage").list("recorder.",{sf:­true}) that'll output the list of available Recorder files
    • You might want to tag it so you can easily separate the response from other messages, for example by sending the actual string: '\x10Bluetooth.println("FILES="+require(­"Storage").list("recorder.",{sf:true}))'­
    • Once you want a file, you just need to send the JS code to output it. So for example maybe:

      (fn=>{
      Bluetooth.println("==== START FILE "+fn+"====");
      var l, f = require("Storage").open(fn,"r");
      do Bluetooth.print(l=f.readLine()); while (l);
      Bluetooth.println("==== END FILE  ====");
      })("recorder.log0.csv");
      

    Then hopefully you can receive all those responses via the /ble/data/MAC_ADDRESS/nus/nus_rx topic and you're good :)

  • cool. will get experimenting with this lead. Thanks!

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

how to download recorder gpx automatically/automation?

Posted by Avatar for kab @kab

Actions