Automatic file upload

Posted on
  • I have some code running on my phone to automatically generate a json file. Is there a way to automatically upload that file to my bangle 2 through the web ide at a set interval?

  • Well, the Web IDE does have a 'file watch' option. Click the down-arrow by the 'file open' button, choose 'watch and upload' then click the open file button and choose the file.

    It works on desktop so I'd imagine it's fine on Android too.

    You'd then have to choose where you wanted to upload it (a storage file?) and probably you want to turn off reset before upload in settings too. It's expecting to upload JS, not JSON - but it should work.

  • That's great thanks. Curiously the ide doesn't show that arrow button on microsoft edge on android though.

  • It's also not visible on chromium. I can't install chrome on my phone to check that as I don't have google apps.

    Is there any other way to watch the file?

  • Just checked and I don't see it on Chrome for Android either. I'm afraid that means the API for file watching isn't available so it's had to fall back to a simple file loading.

    If you want to do everything on Android I'm not sure there's much else you could do with the IDE. Potentially you could make your own Web Bluetooth page that tried to load the file repeatedly (if allowed) and send it over Bluetooth - it's pretty straightforward: http://www.espruino.com/Web+Bluetooth

  • Ah that's a shame. I'll have a look at the web Bluetooth page idea.

    Could I potentially watch the file if I set up the ide through node.js do you think? I have node running through termux on my phone.

  • Could I potentially watch the file if I set up the ide through node.js do you think? I have node running through termux on my phone.

    I don't think so because the IDE is still running in the browser.

    BUT you could use npm install espruino and the Espruino CLI. I'm not sure if that'd support bluetooth on Android (there is now a dmesg-based bluetooth handler in the GitHub version - it's not published yet) but that does have a file watch thing in it too

  • Thanks, yes the CLI is what I meant. I have installed it on android but it appears noble is not supported by android.

    I have yet to try the web Bluetooth page idea as I need to learn a thing or two about HTML I think!

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

Automatic file upload

Posted by Avatar for petefrommars @petefrommars

Actions