Page 1 of 1

mu editor

Posted: Tue Nov 23, 2021 1:02 am
by OutoftheBOTS_
I am currently delivering tech education courses in a number or settings like schools, universities and council tech hubs. The courses are mainly robotics and programming and mainly for children between age 10 and 18 depending upon the course.

I want to do some micro-python stuff for high school kids on ESP32 as ESP32 is so cheap making it very affordable for me to give away the hardware at end of course for the kids to take home and keep.

I have done a little with some Adafruit boards using circuit-python and programmed using the mu editor which is a nice simple editor for kids to learn to use easily that is capable of running python live, downloading to the board and also has a serial terminal and plotter.

I am trying to use mu editor to program ESP32 board that has a wroom module at it's heart and I have installed this binary "esp32-idf3-20210202-v1.14.bin". When I start mu editor it detects micropython on esp32 connected and I can type code into the editor and hit run and it works correctly (I assume this uses put and paste mode of micropython) and I also can type in to the serial terminal at repl and it works but I am unable to download the .py file like "main.py" to the board with the mu editor.

I think it might because the ESP32 doesn't show up as external drive like the Adafruit boards did. Is there a binary for ESP32 that does mount as an external drive??

Does anyone here have experience with using mu editor on ESP32 or can suggest another IDE that would be good for teaching kids

Re: mu editor

Posted: Tue Nov 23, 2021 2:05 am
by scruss
ESP32s (before the S2, anyway) can't do virtual drives.

I'd recommend Thonny, as it understands more types of devices than mu

Re: mu editor

Posted: Tue Nov 23, 2021 3:16 am
by OutoftheBOTS_
scruss wrote:
Tue Nov 23, 2021 2:05 am
ESP32s (before the S2, anyway) can't do virtual drives.

I'd recommend Thonny, as it understands more types of devices than mu
I assume that is because before the S2 ESP32 didn't have native USB. I think to have virtual drive will be much better for kids to use as having to use tools like ampy or rshell is just another complication for the kids to understand.

Re: mu editor

Posted: Tue Nov 23, 2021 9:34 am
by pythoncoder
Please see this observation about MSC mode. Pyboards retain it for compatibility reasons but it's not supported on other platforms.

Re: mu editor

Posted: Tue Nov 23, 2021 5:31 pm
by scruss
OutoftheBOTS_ wrote:
Tue Nov 23, 2021 3:16 am
I assume that is because before the S2 ESP32 didn't have native USB. I think to have virtual drive will be much better for kids to use as having to use tools like ampy or rshell is just another complication for the kids to understand.
Yes, lack of USB capability is why it doesn't work on ESP32. But as Peter points out, it's a double-edged sword: sure, it appears easy to use, but MicroPython/CircuitPython's ability to modify the filesystem outside control of the host can cause corruption.

This is approximately every second question on the Raspberry Pi Pico forum. I used to be very pro-VCP, but am far less so now

Re: mu editor

Posted: Thu Nov 25, 2021 10:10 am
by pythoncoder
scruss wrote:
Tue Nov 23, 2021 5:31 pm
...
This is approximately every second question on the Raspberry Pi Pico forum. I used to be very pro-VCP, but am far less so now
That is why I wrote that FAQ: answering that question here every other day was becoming tedious. MSC mode is :twisted: and experienced Pyboard users routinely disable it in boot.py. Alas there is a lobby on GitHub wanting to enable it on the Pico :(

Re: mu editor

Posted: Thu Nov 25, 2021 11:17 pm
by OutoftheBOTS_
After trying Thorny editor it seems to be much more functional with the ESP32 Wroom module where it is quite easy to save code to the board as well as run it live and also use repl.

On the rare occasions we have to drop files that are not python scripts I suppose we will just use ampy.

Re: mu editor

Posted: Fri Nov 26, 2021 3:15 am
by scruss
You can copy any file across using the Files pane.

And the Plotter view is solid gold. Print an array, and every column is plotted as a different trace