Code Uploader

Posted on
  • I've never been able to run the Chrome Web IDE on my Mac (10.6.8) ..
    Screen is a pain..
    But I've been learning Go...

    So.....

    A live code uploader for Espruino - use the editor you want, when you save your code file it is automatically pushed to your board.

    Only tested on my Mac with a Pico TBH but works lovely.

    https://github.com/olliephillips/espruinĀ­go

    Given where Go is at 1.5 cross platform binaries that just work should be easy to add - if there is any interest. Not sure how yet, but will crack it :)

  • That's really cool! Thanks - it's such a good idea.

    Would you be willing to help out on the espruino-tools project, and maybe add that to it (and possibly help to make it less shonky)? It's a command-line, node.js-based version of the Web IDE (using the same code) - so it handles all the fancy stuff like module loading and compilation.

    I know it's not in Go though :(

    It's kind of a problem - your tool looks really neat, but there'll be a massive amount of work needed to fix the corner-cases that are already handled by the Web IDE. I've been trying to come up with espruino-tools as an 'official' command-line tool that I'd put on NPM, but if I'm honest I haven't had much time for it lately and I haven't had many contributions to date :(

    Also, have you seen this? it's an online Web IDE. I just did a post on it here. At the moment you can only enable 'connect via audio' on it, but it should be possible to add another connection mechanism that'd communicate with a simple 'relay' running locally (WebSockets?).

  • Hadn't seen the online Web IDE, will have look.

    I started determined to get the chrome app Web IDE working on 10.6.8, the crux of it seems to be no command line ever returned, but I was hacking at it and never got anywhere.

    This tool was the next best thing. I take on board your point about edge cases - looking at the IDE code, it's clear there's a lot going on in that code upload process. Still maybe if I can get the module upload piece going and perhaps the minification, it'll be useful for others.

    Re Espruino-tools happy to assist where i can though much of the discussion on here leaves me for dead so don't expect too much ;)

  • In case anyone is interested in this pet project of mine. The "dev" branch now includes module loading (from espurino.com/modules). It isn't recursive so require statements within modules themselves are not handled - but i guess they could be.

    There's a very contrived example in the esp.js file which sets and reads servo values whilst stating the time at which the reading was taken - it autoloads the clock and servo modules.

  • Regarding favorite editor... I agree with that part as soon as same comfort is provided as in IDE: for example, the board config file is interpreted plus all what the Espruino JS specifics has to offer. When beginning to work w/ Web IDE I missed the multi-document aspect... adding that to the web app would give already a great boost.

    Even though I learned to thrive on ed and vi, I got used to little better UIs for edit commands, for example of search, search-replace, etc. - ...after some painful transitions decades ago ...and that pushed all the elaborate single line (Unix) commands in the memory background. Today, the majority is not used (anymore) to a silent, black-screen character, command-line oriented UI... especially not the creative hackers coming from other contexts then an OS shell... (unfortunately every new technology begins on that level and rekindles live again, such as initial Java - until IDEs became available - git... (and git is still heavily in that zone, IDEs are though catching up as well as standalone git UIs).

    What I like about Espruino, it provides a complete, balanced package: HW, embedded/standlone OS/Firmware/Programming language, dedicated IDE, module library remote and local,... and let's someone get started very smoothly. There is always room for improvement... the IDE is a Google Chrome (plugin) app written in JS... - and @Gordon is willingly accepting contributions... and even requierments... there we go. After all, the IDE a strongly Espruino promoting aspect...

    PS: may be referenced Mac / OS has to catch up with current Espruino 'time'-context... (...I know, why throw... when with a bit effort it still does a greate (edit and upload) job... ;-)...)

  • @allObjects don't disagree with any of that - you're on the nose with all of it.
    I'm not capable of making this thing any sort of Web IDE alternative so it can't ever be that and there's no need - as you say.

    This just solves a long term problem I've had with working with Espruino as I'm stuck on a Mac running 10.6.8. It's a small show of support and interest in Espruino project too :)

  • Admire your pesistence: Wo ein Wille ist, ist auch ein Weg! - Resort to fallback is a 'pressforward'.

  • @Ollie, just thought about VM... VirtualBox is free.... and if you can find a Windows, you may be successful... I recall having had good experience with Snow Leopard and VM...

  • @allObjects it shouldn't be too hard to get something running in node-webkit. All the code needed (even for serial port access) is already there, it just needs a bit of fiddling.

    Once that's done you'd have a full Web IDE that could be packaged up as a native app for Mac, Windows or Linux - it'd be great. I just don't really have the time to look into it :(

  • @allObjects, not tried VirtualBox, I tried the Chrome Web IDE a while back on Win 8 via Parallels, it just says "searching" though an Espurino device was connected. Probably port sharing restrictions but couldn't get to the bottom of it. No big deal - maybe I'll give VirtualBox a shot, I think I have it. Thanks for the pointer.

  • Hi,

    Not sure if this is useful for you, but I just got the Web IDE working with node-webkit/nw.js.

    edit: instructions here

  • Just another heads up - last thing I'm doing with this and last time I'll post on the subject but this app now includes recursive module loading and basic minification. Currently in the "dev" branch , will move it to master once properly tested with some real Espruino code examples :)

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

Code Uploader

Posted by Avatar for Ollie @Ollie

Actions