Use device filesystem instead of web editor?
klausw opened this issue · 5 comments
The web editor is nice, but I think it has some potential problems.
First of all, it's unclear where the program is stored. It seems to be in browser-local storage on the client machine. The previous program seems to sometimes be available in the editor after a reboot, but disappears when the Pixel Kit changes IP address? Losing the user's program would be discouraging for learning coders, and I think it's vital to ensure that this doesn't happen unexpectedly.
I think it would be more intuitive to store programs on the Pixel Kit's filesystem, that way they'd continue to be available when switching client browsers. Editing them would still happen through a client PC via browser or other tool, and this would also be a way to handle backup/restore or versioning.
As far as I can tell, the user program can only be launched through the web editor or WebREPL. I think it's important to be able to store one or more user programs on the device and launch them without needing a client PC directly from the Pixel Kit. A really cool thing about the Pixel Kit is its ability to write games and demos, and the previously made ones should be available easily.
I've experimented with using the USB serial REPL for storing a user program, and initial results seem promising.
Hey, @klausw !
You are spot on. I have a list of features to implement on Pixel32 (but haven't to published them as a roadmap) and it goes like this:
- v0.1.0: Create all the Python code to support WebREPL, connection screens and host the interface. The interface at this version is a simple WebREPL terminal (not even code editor)
- v0.2.0: Adds a sidebar to switch between terminal and code editor. On the code editor there is a play/stop button. Code is autosaved on
localStorage
which means it will be eventually lost if you change domain but will be safe for page refresh. Also includes a major refactoring of code to use native custom elements v1. - v0.3.0: Adds a file manager so programs can be stored and downloaded from the board. Adds also a connection status element so it's easier to understand when your page lost connection to the terminal.
- v0.4.0: Not sure yet but probably will add external links (internet connection required) for browsing and installing libraries, demos and other creations from other people. Also bring back the "captive portal" feature but instead of the terminal page, it shows a quick wifi setup page.
I don't have a sketch for the v0.3.0 yet but the feature is already implemented on the webrepl-client
(see loadFile
and sendFile
) so it's a matter of UI and UX, which might take a while to get it right.
@murilopolese hi, i'm currently looking into all your great contributions regarding the kano pixel and micropython. Did you push any further the following objective ? "Adds a file manager so programs can be stored and downloaded from the board"
My aim would be to code with my usual code editor, rather than right in the web browser.
hi @murilopolese, thank you for providing those hints.
Following this, I went deeper into your code and realized i had most of the answers i was looking for right in your repo.
At first, i was kinda hopping to find a ready-to-use python library + IDE connector to use the kano pixel board as education material for my grand son.
Then I realized that the python Library I was looking for is what you started with the PixelKit.py library.
As for the one-click IDE connector, i'll have to figure a way to persist the code from my IDE right into the Kano Pixel flash.
I'm all rookie with micropython, I'll go the hard way and install everything from scratch and then play around with PixelKit.py.
I have one question, how did you figure the right PIN mapping when writing this library, by looking at the wiring on the board + hit and miss? (Edit: Ahh, I now see you worked at Kano)
Oh, and i'm not entirely sure of the restore process: how to put back the stock firmware from Kano? I read from the issues that your flasher tool comes with a built-in image? How should I proceed to restore the stock firmware without the flasher tool ?
And the more I dig the more I have questions :-) : how does kano-pixel-kit-pixel32 compare with the work you achieved in https://kanocomputing.github.io/community-sdk-wiki ?
Thank you, again!
Unfortunately this project is no longer being developed and I don't see it happen in a near future. I do recommend flashing micropython firmware from micropython.com and using https://github.com/arduino/lab-micropython-editor as your editor from now on :/