API for upload code into device?

Posted on
  • Hello,
    wanted to know if there is a way to upload the code not using IDE ?
    or somehow to intigrate it into my website using API ?

    I'm using the MDBT42 only as a beacon - and I want to be able to change it's name when ever I want to

    is this somthing reasonable to do ?
    is there any way to do it?

    *** I have created a virtual com to the device and using the webIDE I can uplaod to him the wanted code , so no netwrok issue
    Thanks ,

  • Hi! I think if you want to upload from a website you probably want the 'Puck.js' library (it's just just for Puck.js, but for all Espruino devices).

    Check out http://www.espruino.com/Web+Bluetooth for some examples - but it should be very easy to use it to configure an MDBT42 from a website

  • the device is not near the computer
    I want to be able to uplaod\ chhange the code from another palce \ remote location

  • I don't understand. You're asking whether you can remotely change the beacon's code from somewhere where there is no internet connection or access to Bluetooth Low Energy?

  • no
    the device is connected using serial TX\RX pins to a serail device that connect to the internet .
    If I choose the COM of the device from my computer on the IDE - I can upload\see the MDBT42 .
    my question is if I can upload new code not using the IDE \ using some kind of API
    or maybe (just thought about it) send a command to the MDBT42 and tell him to download a new code ?
    is there such a thing?
    ** No is also a good answer :-)

    Thanks ,

  • Of course you can, there is nothing special in the IDE. You have Espruino interpreter console on the serial port so you can do everything. Just send the code directly 'as is' to serial port and it gets executed immediately (so you may start with sending reset() if you want to start from scratch) or you can execute code that will write it to storage and reboot

    there is also espruino command https://github.com/espruino/EspruinoTool­s that may be easier for you

  • Thanks !
    I will give it a try

  • Just to add - with https://github.com/espruino/EspruinoTool­s you can output what would have been written to espruino with -o out.js

    So you could get your code, run it through that command-line tool, and then use whatever you've got connected to the RX/TX pins to send the bytes from that file - and you've got your firmware update sorted.

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

API for upload code into device?

Posted by Avatar for David1234321 @David1234321

Actions