Success: Installed MicroPython in new Nano ESP32!

Hello,

I wanted to share my individual experience on how I was able to install MicroPython in the new Arduino Nano ESP32 board after 4 hours of several attempts. Note that my experience might not be the optimal solution, but I am sharing what worked for me in case it might work for you.

Process
First, I downloaded the software as described here
Then, I opened MicroPython Installer app, which detected the Nano ESP32 successfully, but when I hit "Install", it gave an error of "Installing from native bootloader is not supported yet."
So after reading this specific Arduino forum posts from previous users, I went into a learning journey on DFU ports and drivers. I went back to Arduino IDE and installed the board package for both Arduino ESP32 Boards and the single package of esp32. I tried to upload a simple Blink script, but it failed with error:
"Cannot open DFU device 2341:0070 found on devnum 6 (LIBUSB_ERROR_NOT_FOUND)
No DFU capable USB device available
Failed uploading: uploading error: exit status 74".

I went back to the GitHub repo from where I downloaded the MicroPython Installer here and almost gave up because of their specific note in the repo:
"The board can currently not be flashed when in native bootloader mode. The reason is that the installer flashes an app image that requires a bootloader and recovery image to be running. A full firmware image will be added in an upcoming release."

Fixing
Very bizarre solution: At the end of the day, I clicked more than 5 times "Install MicroPython" continuously under the MicroPython Installer and it did install!! It said that the board probably needed to reboot, so I unplugged and plugged it back in and I could see the purple light come on. However, when I opened Arduino Lab for MicroPython, I could not see the available port to connect the board under the "connect" option. So, I pressed the reset button again. Then, I had to install MicroPython again and this time with just one single click it worked and proceeded to install MicroPython again! Then I unplugged it again. Plugged it back in, Still not showing as an available port in the Arduino lab app. Then I pressed reset again. Unplugged it. Installed Micropython one more time and it finally showed as an available port connection under "Arduino Lab for MicroPython" and was able to get two scripts running successfully!

Recommendation
To me this was very strange and probably magic. So I say reset your board as many times as possible (try to press the reset button for more than 5 seconds), forcefully click "install Micropython" continuously under the installer. You should see the purple light come on and a notification in the GUI with "Congratulations!". Unplug the board. Plug back in until at some point if this method works for you as well, you should see all the flashing LEDs stop blinking and finally have the available port to your board under the "Arduino Lab for MicroPython" app.

Thank you for sharing your experience @cmch!
Last Friday we released a new version of the installation tool that supports installing from native bootloader which will avoid the issues you described. Also, the MicroPython guide contains the steps to follow for an easy installation :slight_smile:

1 Like

@cmch
I've also wanted to know how to do it on RP2040 connect so that was very helpful thanks

1 Like

Thank you for writing this up @cmch ! Let me explain. The Nano ESP32 comes factory flashed with a DFU recovery image. That way you can just plug in the board and install MicroPython with the installer tool. We initially had some misleading instructions in the tutorial. Based on your report you followed those which instructed you to short B1 to GND to enter native bootloader. This was initially not supported by the installer.
Anyway, for any installation method to work on Windows you need to install the board drivers. To do that you need to install "Arduino ESP32 Boards" in the Arduino IDE. I assume you are a Windows user.
The reason why it worked for you is A: You installed the drivers by installing the core in the Arduino IDE. And B: You put the board into recovery (which is not the native bootloader) by double tapping the reset button. The tricky part there is the timing. You do a first press and the second one cannot be too quick after but neither too late. It needs to be while the RGB LEDs are flashing. With two of the 5 times that you pressed the reset button you apparently matched that.
I hope this clarifies things.

1 Like

@zm476 For the Nano RP2040 the process is quite different actually. Installing from bootloader is currently not supported. This is because the RP2040 does not expose a serial port when in bootloader. Instead, just plug in the board and click "Install MicroPython". If you're on Windows, make sure you install the drivers first by installing the board's core in the Arduino IDE.

@sbhklr thanks for that otherwise it might have taken me a little while to notice that

On Windows systems make sure you have:
"Arduino ESP32 2.0.14plus debug byArduino" installed in the Boards manager.
Unfortunately the name of the board lib is quite misleading as the latest version is 3.0.0-arduino3r2
Consider that "esp32" library by Espressif is not enough because it won't install the board drivers as @sbhklr said

The above names refer to internal testing cores, not fully validated. Please stick to the official releases supporting the new IDE 2.3 features (Arduino-ESP32 2.0.15 and 3.0), which will be available as soon as Espressif releases them.