Espruino command-line tool #5954
Replies: 1 comment
-
Posted at 2015-11-18 by Ollie Last one, 'espruino', for me. Longest of them but semantic and your namespace so won't conflict. Posted at 2015-11-18 by UliMerkel espruino_cmd, to avoid the conflict with the binary Posted at 2015-11-18 by @gfwilliams Just uploaded it here - as ... it's early days, so I can always change it later. Posted at 2015-12-25 by tve It looks like it doesn't support communication over sockets? Posted at 2015-12-25 by tve FYI, I added support for node sockets and for a --terminal option that pops into the terminal after uploading a file. The socket support doesn't work for multiple sockets and the terminal support is a gross copy&paste of the existing terminal code, so ti should be included more nicely. Posted at 2016-01-04 by @gfwilliams Thanks! The socket thing looks great - and having the ability to force the terminal looks like a good idea too. I know my code is a bit of a hack, but there's got to be a better way of getting the terminal without that duplication :) Posted at 2016-01-06 by Snerkle The
I have a work-around for the first issue, see attached
Note the use of For the second issue, could you maybe set up a callback of Attachments: Posted at 2016-01-06 by @gfwilliams
Yes, it's a pain - It's under the 'To Do' list on https://github.com/espruino/EspruinoTools - sadly I have my work cut out doing everything else though!
At the moment the CLI just sends that command straight to Espruino, so it doesn't really have a way of parsing the result out. I guess it could change to using Posted at 2016-01-06 by Snerkle OK. I can do what I need using the module form with my To complete the integration it would be nice to figure out how to give WebStorm what it needs to be aware of the built-in espruino functions/libraries, especially where they differ from standard javaScript/node, e.g. the Posted at 2016-01-06 by @gfwilliams If WebStorm uses Tern, you might be able to somehow use this tern info file. ... But otherwise you could probably hack something up so that you could generate a huge JS 'stub' file with all the functions and comments in? Posted at 2016-01-06 by Snerkle Had a look and it appears WebStorm doesn't read tern files. It likes Before I launch into parsing the tern file into something else: is tern your source format you maintain my hand, or is there something behind that like a structured database I might find easier to work with? Posted at 2016-01-06 by @gfwilliams The tern file is generated using https://github.com/espruino/Espruino/blob/master/scripts/build_tern_json.js However those scripts may (will) change in the future, but the format of the Tern file will stay the same :) Posted at 2016-01-06 by Snerkle Referring back to post #9 above: How about a new command line option, say Posted at 2016-01-07 by @gfwilliams Yes, I think that could work well. I guess ideally there'd be 'statements' - what happens currently, and expressions which use Posted at 2016-01-08 by Snerkle I've been working away on what I mentioned in post #10 above, and have the two attached files to offer as a result. Its not the These are updates for both:
I apologise in advance that I haven't got around to doing these a pull-requests on gitHub. I'll get over my laziness soon and start proposing updates that way in future. For now I hope you'll do a diff and choose to integrate the changes if you like them. These amount to:
If I say so myself, I'm living and loving them both. Attachments: Posted at 2016-01-08 by @gfwilliams Thanks - I've just pulled in the localModules stuff (it's For the serial stuff, it will work on all Espruino boards via USB - that kind of detection is really handy, but in reality it stops you using Espruino via a USB-TTL converter (eg for ESP8266, or even normal Espruino boards where you're not using USB), or even via bluetooth. What'd be better is if all the serial modules could report back the path, but also a boolean saying whether they're sure that it's an Espruino. Then, if you didn't specify a port it could scan all ports, and if it was sure that one of those was Espruino, it'd just choose it. Posted at 2016-01-08 by Snerkle OK.
Posted at 2016-01-08 by Snerkle Hmmm, 2 steps forward, 1 step back.
When Any ideas about what to try next? I currently think its somewhere in the 2 different code paths for serial comms. when you compare the WebIDE with espruino-cli. Posted at 2016-01-08 by @gfwilliams Well, WebIDE and espruino-cli use basically the same code apart from Just checking - do you have an up to date Pico firmware? Posted at 2016-01-08 by Snerkle I'm using
A build you pointed me at to improve the RTC accuracy without a crystal (under my gitHub personna: dmcnaugh) - as expected its better but not fantastic - averaging +5 seconds every 10 minutes. From what I can tell I'm not losing characters transmitting to the Pico but who knows. The same file will load then not load, then load. It will almost always load after a power cycle of the Pico, but then again I can make files that won't event do that. If I change the Posted at 2016-01-08 by @gfwilliams Hmm, that should be fine then. When the Pico freezes it's probably stuck in the middle of entering a function, with echo off. Try As you've got the EspruinoTools source handy, you could try this: espruino/espruino-tools#6 (comment) It's a bit of a hack, but it seemed to work in that case. Posted at 2016-01-09 by Snerkle Thanks, the code suggested at:
solved the problem of sending code to the espruino. Is there a permanent fix in the issues queue? Or is this seen as a problem with I tracked down the 'dropped characters' problem when the espruino is sending to the terminal a little further and it looks like nothing is dropped in the transmission but different terminals produce different results. The issue occurs only with very long lines, typical when you
So I'll try filing a bug with WebStorm but meanwhile I can't find a simple solution to make terminals wrap at the width of the terminal window. Posted at 2016-01-10 by UliMerkel An Option to SetTime ? -s, --settime : Similar to the Web IDE Settings -> Communications -> Set Current Time Posted at 2016-01-11 by @gfwilliams Glad that fixed it. I guess it might be worth changing the Are you running under MacOS then? I guess it could be a node-serialport issue for OSX and I don't think I see it under Linux.
Actually this exists already, it just needs turning on by setting the correct config options... Posted at 2016-01-11 by Snerkle Yes I'm on OSX. Posted at 2016-01-11 by UliMerkel
Thanks Gordon, seems I have not found it in the documentation I scanned so far. Posted at 2016-01-13 by @gfwilliams @Snerkle - yes, I'll get that fix in. What was Espruino printing that was causing characters to get lost?
The tool would need changing. For example a config option is set up here for Baud rate. All you need it Posted at 2016-01-13 by Snerkle
Actually it was the string for the espruino favicon you provided in the http server example titled Favourite Icon on WebServer If you load that code onto the espruino and then do a Posted at 2018-06-20 by user73560 Hi @gfwilliams, With 1v96 version of the PUCKJS firmware I was able to do following:
Once the hex file from 2) was uploaded I had a firmware with uploaded code from 1) This is not possible with PUCKJS firmware 1v99.50 version, is there any reason for that ? Posted at 2018-06-21 by @gfwilliams Yes - around version 1v99 Espruino changed the way code is stored so it uses a mini filesystem, allowing you access to store your own data as well using However if you update the command-line tools to the latest version then they'll produce hex files in the new format. Posted at 2018-06-21 by user73560 Hi @gfwilliams, Where can we find 'Storage' module ? Any examples using it ? Posted at 2018-06-21 by @gfwilliams http://www.espruino.com/Reference#Storage - or use the Espruino site's search box :) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2015-11-18 by @gfwilliams
I'm thinking I'll finally submit the command-line tool for Espruino to NPM, as
espruino
has become clear now.... but any thoughts as to what would be a good name for the command? Currently it's
espruinotool
, but that's pretty longwinded.What about:
esp
- too short - might get confused with something else?esptool
- probably not given the ESP8266 programmer is already called that :)espr
?espruino
- might get confused with the actual Espruino binary?Beta Was this translation helpful? Give feedback.
All reactions