Programming Wirelessly #4354
Replies: 1 comment
-
Posted at 2014-04-14 by @gfwilliams Hi... Yes, sending the code string to eval is probably the best method. Obviously if you're using some kind of non-secured system you might want to think a bit about security though! Executing something using
The other option if you want something more physical is to save the following code:
And then to put any code you have on the SD card. Posted at 2014-04-14 by Alex Hi Gordon, thank you for the answer :). I'll go with your first suggestion! Posted at 2015-01-22 by Alex Hi Gordon, Could I use the method the espruino WebIDE uses? That way I can completely reprogram the espruino, as opposed to the method you mentioned where I have to be careful that the handler functions are not deleted. Over UART code comes in, in pieces. How is this handled with the webIDE? I've been looking through the EspruinoTools git, are there any prefixes/tokens that are passed in between functions so the espruino can eval functions once they are complete? Regards, Alex Posted at 2015-01-23 by @gfwilliams Well, Espruino itself is quite smart about getting functions in via the console. It counts brackets and only executes if all open brackets have been closed. The WebIDE actually does some relatively simple stuff:
There's maybe some other stuff, but those are the basics. I'd started work on a simple command-line tool to use EspruinoTools to this with node.js (see http://www.github.com/espruino/espruino-tools). That might be a good way of automating everything? It still needs a bit of work to get command-line arguments parsed, but the basics of communication should be there. There's also https://www.npmjs.org/package/espruino-cli which exists right now, but that doesn't use the Web IDE's code, so it could be a bit out of date now. Posted at 2015-01-23 by Alex Hi Gordon, Thanks for the explaination. I have attached custom communication modules to the espruino (to Serial2 currently). How can I tell the Espruino to treat the data coming in from there as if it is from the console? Cheers Posted at 2015-01-23 by @gfwilliams If you do Posted at 2015-01-23 by Alex Great, thanks! Posted at 2015-01-23 by @gfwilliams Just to add, the node module that actually works for uploading is: https://www.npmjs.com/package/node-espruino But I have now updated https://github.com/espruino/espruino-tools so that it actually works pretty well for programming now. Even if you don't add it as a node module it'll work as:
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2014-04-14 by Alex
Hi all,
Suppose I have 25 espruinos communicating over ANT+, one is connected to the computer and gets a new function (or an updated function). What it the best way to send this to the other 25? Assuming I can send messages, should I create a function that does an eval of the function string, saves it as a local variable, uses function.replaceWith or function = to overwrite the existing functions and calls save()? Is there a better way to program my espruino's wirelessly, other than connecting to each individually and using the webide?
Regards,
Alex
EDIT: local variable containing temp function will ofcourse be deleted after overwrite is complete.
Beta Was this translation helpful? Give feedback.
All reactions