New command-line tools

Posted on
  • Hi,

    Just thought I'd let you know that the espruinotool command-line tool is now available:­ls

    You'll need node.js and npm installed before you can use it, but hopefully after that it should be pretty multi-platform. Installation instructions are at the link, and once installed it should be pretty easy to integrate it with your favourite editor.

    There are already two node.js-based tools out there ( espruino-cli and node-espruino), but this one uses exactly the same code as the Web IDE - so will handle everything that the Web IDE does.

  • This will come in handy :) thanks!

  • Yes, this will be useful. Especially since Chromium/Chrome causes my X-windows to crash.

  • Sweet! Will test come monday.

  • Added support for multi-board upload. Might be handy for more people than me­ls/pull/1

    Excellent tool btw!

  • Thanks! Will try and take a look tomorrow.

    By the way, on Linux you can do some great stuff with udev so you can run a script (like this) whenever a certain type of USB device is plugged in. It'd be great for deployment.

    Extra thing I guess I should add is firmware updates.

  • I tried to add firmware updates using Espruino.Core.Flasher.flashDevice(url, callback) but could not manage to get it working during my 5minutes break. It sure would be a nice feature, but for now I'm happy with make serialflash

    EDIT: I need to investigate that udev thingy, will be handy when deploying to ~40 espruinos in a month or two

  • I could be wrong (may need some fiddling) but the udev rule should look something like this:

    # Standard Espruino udev rule
    ATTRS{idProduct}=="5740", ATTRS{idVendor}=="0483", ENV{ID_MM_DEVICE_IGNORE}="1", MODE="0666", GROUP="plugdev"
    # Run stuff when it's plugged in
    ACTION=="add",SUBSYSTEM=="tty",SUBSYSTEM­S=="usb",ATTRS{idVendor}=="0483",ATTRS{i­dProduct}=="5740",RUN+="/home/your/scrip­ /dev/%k"
  • Just had a play with the flasher (have updated the code). I can get it to erase the device, but something is broken when it tries to write data to it.

    There were some issues with conversion between datatypes that I had to fix in EspruinoTools (String/ArrayBuffer/Buffer), and I wonder if there are still some problems there.

  • Can this module be used from inside node? Like in a js file with require like with node-espruino?

  • I'm not sure it can be at the moment - but if anyone wanted to make that happen I'd love to include it. It'd definitely make integration with other node.js software a whole lot easier.

  • Excellent. Atom plugin in 3...2...1

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

New command-line tools

Posted by Avatar for Gordon @Gordon