vsolina / micropython-web-editor

Web-based code editor (IDE) for MicroPython controllers with WiFi
MIT License
25 stars 3 forks source link

no "save" button? #14

Open gitcnd opened 10 months ago

gitcnd commented 10 months ago

It's not clear what to do to save files - might be nice to explain that (if it's automatic?) or give us a "save" button if not?

gitcnd commented 10 months ago

For anyone else struggling with this - Control-S does the save.

Yes, this is not documented anywhere obvious - not here, not even on the Ace repo...

You can't save big files though - throws errors.

vsolina commented 10 months ago

Yeah, sorry about that. I'll update readme.MD with a note that ctrl/cmd+S performs a save. To be fair it's not an Ace feature - that's why they don't have it documented.

I have not figured out how to enable larger upload buffers in microwebsrv. Downloading large files works well, streams the content directly from flash. Something similar but in reverse should be implemented.

gitcnd commented 10 months ago

I modified microwebsrv so it handles compressed files - cuts down the space used by ace etc by about 66%... made me want to port everything to a newer version with ssl (because brotli doesn't work over http)... if I get around to that, I'll see if I can fix that bigger file save thing. I found this today too: https://sim.lvgl.io/v9.0/micropython/ports/webassembly/index.html - if I get really bored, I might try and change the UI so it looks as pretty as that one :-)

vsolina commented 10 months ago

That's very cool. Compression definitely helps. I also need to consider switching to microwebsrv-v2 - it features a lot of improvements

Keep in mind that ace.js loads from CDN by default (not using any MCU storage space), but this requires an active Internet connection on the browser side. But there's another alternative which I did not use in the end but it's quite simple to do: one could host all interface files (js, html, css) on a local PC (or anywhere else) and just run the backend API on the MCUs. It would require minor changes to interface implementation (mainly the selection of a MCU host IP address) and would require a single (.py) file to be stored on a MCU.

gitcnd commented 10 months ago

Yeah - that's the whole point of my compression mod - I've got everything installed locally on the esp32 (I'm even using the OTA setup, so there's only 2mb storage, and there's still plenty of space left over to do useful stuff as well!) All the working+tested files are here (and more): https://github.com/NoosaHydro/2.4inch_ESP32-2432S024/tree/main/cnd-micropython

I'm trying to build a binary .mpy lvgl driver right now to sort out the one last MCU issue I'm fighting (getting touch to work on my LCD). Assuming I figure that out, I would be interesting to try running a local version of that link I showed above - so you can see the MCU screen either by looking at the screen - or by loading a web browser from anywhere else, and seeing a copy of the screen inside chrome.