circuitpython like USB access

Posted on
  • hi,

    is it possible to use Espruino like circuitpython?
    With a USB Drive option when connected to a pc to upload
    the code, docs and logs in plain text?

  • Not as usb drive but otherwise it is very similar, you can upload download and view files in internal storage via WebIDE or espruino command. advantage is that it works also over serial or bluetooth not only via USB. Also internal storage can then use internal flash friendly efficient format of storing data instead of using generic filesystem like FAT that would be also readable from PC over USB.
    In theory it could work like that at least with sd cards so then Espruino device with card would work like card reader but I think this is not implemented either, however maybe that would make sense.

  • Hi,

    Right now that's not implemented. In the future potentially it could be, but obviously it only works on USB devices, and the most popular Espruino devices by far at the moment are Bluetooth ones - so it's not high priority.

    I guess it depends what you want to do - but personally I find uploading code when there's no feedback hugely frustrating. Changed something and made a typo? It will then just not work, and you'll have no idea why - so generally I'd advise having some kind of serial console anyway.

  • circuitpython has a repl too, i dont know how different it is to espruino

    i have two usecases where i would like to have a usb device.

    1. when i have a project eg a garage door opener with a code pad
      and its all done, i would like to have the code and some doku with
      the values to change and maybe parts to use, so if i come back 20 yeas later i
      immedeatl know what to do without reverse engeneer what i did ages ago.

    2. When i e.g. built da datalogger and install it at a remote location,
      i can just call someone and copy the cvs file, and maybe the new code,
      without that they have to know anything

    i think this would be possible with circuitpython - but i cant stand pythons syntax.

  • Hi,

    1: This is fine - if you upload code to Flash on Espruino (as long as you don't turn on minification) it'll all be inside the board, including comments, and can be read straight out using the IDE.

    2: You can't do this directly on Espruino without the flash drive (although you can do it just by going to and clicking the Storage button). In that case I'd suggest making a webpage that'll handle the data collection though. Full code of doing exactly that is at­automatically-recovering-data

  • i totally get that this is not a high priority

    it really is nice that it allready kindof works like want,
    but its a different story to just plug in a usb stick and find some text with explanations,
    without any further knowlege of that product.

    i just wanted to know if its possible at all or if its somehow against
    the basic philosophy or capabilities of the espruino project.

  • Yes, it's definitely possible, and it's not against the philosophy of Espruino. I think if it'd been easy to do when I started out I'd have added the ability - but Espruino parts generally have a bit less memory than micro python (Espruino doesn't need so much RAM), and that can make devoting a bunch of flash memory to a flash disk a bit tricky.

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

circuitpython like USB access

Posted by Avatar for ingoiotESPruino @ingoiotESPruino