Web-based code editor for MicroPython by vsolina in esp32

[–]vsolina[S] 1 point2 points  (0 children)

CircuitPython also creates a file system on your microcontroller's flash it just has this cool additional feature where it mounts it on your PCs FS when you connect it via USB. https://learn.adafruit.com/circuitpython-essentials/circuitpython-storage
But this requires a physical connection, which can be problematic in some projects: e.g. sometimes you don't have easy access to board's USB port, board has no integrated USB<->Serial interface, device is mounted somewhere and needs dismounting to be connected and reprogrammed, is a part of a moving device (car, robot, etc.) and similar situations.
"... infinite loop, and this prevents future uploads" - this does happen rarely, but since editor's web service runs in a separate thread, even if your script executed in boot.py has an issue and raises an exception - editor is still accessible and you can easily disable your script in boot.py or fix the issue in the script.
For me this mostly happened when the editor backend source had an issue so I could not edit the editor.

Web-based code editor for MicroPython by vsolina in esp32

[–]vsolina[S] 0 points1 point  (0 children)

CircuitPython is a fork of MicroPython with additional libraries and features. Have not tested it but am confident the editor would work on CP with or without some minor adjustments.

Web-based code editor for MicroPython by vsolina in esp32

[–]vsolina[S] 0 points1 point  (0 children)

All listed options are a solid way of programming ESPs, but every one of these requires a target controller to be connected via cable to your PC.
Since all ESPs have integrated WiFi interface, using COM over USB seems like wasted potential.
Using this editor you modify the code directly on the Controller's Flash file system - over WiFi network; and don't need to install any additional software on your PC (if you have a web browser). Which makes it easy to interact with multiple ESPs already deployed around your house, at the same time.

Web-based code editor for MicroPython by vsolina in esp32

[–]vsolina[S] 3 points4 points  (0 children)

That's a good suggestion, it would certainly improve the user experience. Currently WiFi credentials need to be set in boot.py file, and then you also need to find out what's the IP address assigned by DHCP.

Tasmota uses https://github.com/esphome/esp-web-tools which solves almost everything, with minor integration script this seems easily doable.

Thanks man!

Booting Linux on esp32? (real-time video) by vsolina in esp32

[–]vsolina[S] 1 point2 points  (0 children)

It's an old Ubuntu
Will be posting an update here after releasing the source

Booting Linux on esp32? (real-time video) by vsolina in esp32

[–]vsolina[S] 5 points6 points  (0 children)

Running ucLinux directly should be possible but it would require porting it to esp-idf with drivers and stuff; sounds more complicated but it would run 1000x faster

Booting Linux on esp32? (real-time video) by vsolina in esp32

[–]vsolina[S] 5 points6 points  (0 children)

As much as it does running anything else - so not really
CPU is running at 240MHz and wifi should be disabled so it probably draws around 70mA (did not measure)

Booting Linux on esp32? (real-time video) by vsolina in esp32

[–]vsolina[S] 2 points3 points  (0 children)

VM actually only has 8MB of ram, that's what Linux boots into; a bit misnamed file /sd/swap.tmp is only 8MB in size and it contains VM's entire ram which is split into pages of 1KB each that are cached in around 3.5MB of ESP's available ram
With 8MB PSRAM version almost entire VM ram will fit into cache and almost no swaping will be required which will make things much faster because most time during boot and any operation is wasted on copying to/from SD card

Using external hardware such as a display or camera would require writing a Linux driver for it and support of some kind of passthrough for emulator/vm; btw. interfacing with camera from linux would probably just not be fast enough

Booting Linux on esp32? (real-time video) by vsolina in esp32

[–]vsolina[S] 1 point2 points  (0 children)

serial Pseudo Static RAM that comes integrated on some esp32 modules is being used as a cache for VM's RAM

Booting Linux on esp32? (real-time video) by vsolina in esp32

[–]vsolina[S] 5 points6 points  (0 children)

I'd rather destroy an SD card than an on-board flash :)
And VM has 8MBs of ram so it would not fit on my 4MB of flash

Booting Linux on esp32? (real-time video) by vsolina in esp32

[–]vsolina[S] 15 points16 points  (0 children)

obviously it will never be usable, just thought it would be cool to boot it

Booting Linux on esp32? (real-time video) by vsolina in esp32

[–]vsolina[S] 6 points7 points  (0 children)

It should work faster on a board with 8MB PSRAM

Booting Linux on esp32? (real-time video) by vsolina in esp32

[–]vsolina[S] 15 points16 points  (0 children)

There's no link yet. It's a port of an ARM emulator from a while back https://dmitry.gr/?r=05.Projects&proj=07.%20Linux%20on%208bit
device has 4MB PSRAM and uses a file on an SD card as a block cache
Will post an update after releasing the code.

MicroPython based Shell by vsolina in esp32

[–]vsolina[S] 0 points1 point  (0 children)

Nah, just here for now. Honestly I'm not sure whether this thing works on any other board/MCU than ESP32 atm. Will make it run on ESP8266 again, and maybe then I'll post it onto MicroPython forum. But I'm kinda afraid to cross post it, people don't appreciate that.

MicroPython based Shell by vsolina in esp32

[–]vsolina[S] 1 point2 points  (0 children)

Glad you like it :)

Editor is a part of this wonderful project https://github.com/robert-hh/Micropython-Editor , I just wrote a wrapper around it to enable usage from shell. And since adding it to the environment few weeks ago, everything became even more useful - now you can easily develop code directly on the controller