How to full reset Arduino Nano ESP32 [SOLVED]

Hello,

I bought a Nano ESP32 a few days ago and I was trying to have fun with it
I started to install micropython with the softwares made by Arduino, all successfully

However, I had some problems when saving my files on the board: the file where modified without me touching it... weird!
So I used Thonny and it worked perfectly

I then wanted to install some library and unfortunatly, in the file manager on Arduino Lab I deleted a file from a library. Now, when I try to install one it says "Error Can't find /lib/pyserial-3.5.dist-info/METADATA on target" (form Thonny IDE because the way we need to install library with Arduino Lab isn't obvious for me)

Now I'm blocked with this message and I tried to upload again micropython on the board but it never delete all the files...

How do I make a real reset of the board? Deleting every file on it as if it was brand new?

Install micropython again from https://docs.arduino.cc/micropython/micropython-course/course/installation/.
I just tried it on my board again and from what I see it did a full erase before the install and now the only file I have is the boot.py which is an empty file at the moment. The only thing I had to do with the hardware was place it in bootloader mode by shorting GPIO0 to gnd before plugging it in

I already tried to reinstall micropython several times but I can do it again
What is the name of GPIO0 pls? Like D9? A2?

Download a copy of this to your PC for reference

EDIT there is only one pin with a label GPIO0

Thanks!
Do I need to keep GPIO0 shorted to ground during the flash?

I did, I put the short across GPIO and gnd then plugged the usb into the NanoESP32 and then I hit the "Install Micropython" button. After I received the success message I unplugged the Nano and removed the jumper.

Omg thank you man!!
I kept GPIO0 shorted to the ground during the procedure and now it is reset!!
Thanks a lot

@Anthony_P actually I just went back and tried it again but this time I removed the jumper just before hitting install and it still worked. It does not matter if you have it reset now all is good

I use Thonny as my REPL as I don’t think the Arduino version is ready for prime time.

@EmilyJane actually I think both can be quirky, I also us mu editor also and for the PC sublime

EDIT all those editors maybe thats my problem lol

I either VNC into a Raspberry PI 4 that has a RPi Pico plugged into USB and run Thonny or I have the microcontroller plugged into a MacBook Pro laptop or an iMac and haven’t had any problems at all. I mainly use the Pico but have successfully installed MicroPython on an ESP32 module and an esp8266 board and have had no problems with those either.

I do use the editor built into Thonny mostly or do a copy/paste from BBedit so maybe I haven’t fount the quirks.

@EmilyJane I don't normally have problems but I do remember last week something strange happened with the NanoESP32 and Thonny. I have several ESP32 devkits, the Lilygo T Displays a couple of S2's and even a couple of microbit and yes I do tend to lean toward Thonny. @Anthony_P I really like the NanoESP32 but I'm still learning I hope you get to like it too.

hey folks

Thank you for exchanging tips and trying to solve each other's issues, I love to see people interested in MicroPython on this board.

The Lab for MicroPython is still a "Lab" project, we use that label on things which are the internal efforts but we can't prioritise in matter of development timelines, yet we try to maintain the project and fix issues.

What I have noticed is that the ESP32S3 can be a bit quirky when it comes to uploading files to it, and this happens with every editor.
I even had issues using mpremote to fs_cp files, and that's the official MicroPython tool for the job.

While we were investigating the issue in Lab for MicroPython we realised that the MicroPython implementation for this port/board has some native USB quirks that don't respect a fixed amount of bytes sent over serial but just randomly pushes bytes over the CDC device.
Sorry if this can sound too advanced, but it's just to say that if the host computer side fails to properly parse the response from the board when a file is transferred or if the board sends back some garbage, this spurious data can end up in the transfer and corrupt files.

When you get one of those weird errors because file copying has been messed up, you're better off mpremote into it getting a REPL and doing something like this

from os import listdir, remove, rmdir, chdir

then via a series of listdir and chdir head into the paths which contain the corrupted files and one by one remove and then go back up to use rmdir to remove the directories.

Installing the libraries for now is still a bit quirky because you need to copy file by file from the host computer to the board's lib folder, but we've been investigating how to batch-copy properly formatted libraries.

You can also mpremote mip to install packages available either on the MicroPython-lib repository or from a GitHub repo.
Check this page for further info
https://docs.micropython.org/en/latest/reference/mpremote.html

Hope this helps get more familiar with it.
Please keep in mind that Lab for MicroPython, while being the tool we're working with to develop some demos and applications (yes, we dog-food) is still thought to be an introductory tool which embraces the Arduino philosophy of simplicity.
We do our best, bear with us :heart_decoration:

I'm open for questions about it, but won't be able to officially commit to development.
Mostly keeping my eyes peeled :slight_smile:

1 Like

Hello!

Thank you for this answer more than complete :slight_smile:
I get that this is in development and that's why I wasn't angry about it lol. However, I had (almost) zero problem for flashing the ESP32 and to use it with Thonny IDE (which is way easier to use for installing the library and editing since we can open several files at the same time).

But since you seem to me to know a lot about this board, I have a question for you if you allow me:
Currently in my project, which uses Telegram bot so HTTPS requests, I'm using an Arduino MKR WiFi 1010. It does the work perfectly, but a bit slow compared to a computer of course in therms of responding time on Telegram (certainly due to the fact that this is HTTPS).

So here is my question:

  1. On Arduino website, we can see that the MKR WiFi 1010 is working at 48 MHz
  2. Still on official Arduino website, the Arduino NANO ESP32 is running at (up to) 240 MHz

Then, why when I use (almost) the exact same code (changing WiFi library), the Arduino NANO ESP32 isn't faster?
What is odd to me also is that when I make the equivalent sketch in micropython, it isn't slower; shouldn't it be? Since python is way slower than C/C++ (I mean Arduino code)?
Or maybe that the Clock Speed isn't 240 MHz when coding in Arduino...?

If you can't answer that's fine I will open another Topic, just let me know pls :slight_smile:

Just another quick question
Do you know where I could post about "problems" on the Arduino ESP32?
Such as opening the Serial port on Arduino IDE which is a war against I don't know what exactly haha

regarding the speed when it comes to https connection it really depends on how the core is developed.
there are too many variables in the whole process for me to have an answer :slight_smile:

the port opening for Nano ESP32 is a bit finicky but there's a fix incoming.
basically to make it "auto-recognised" via a combination of USB's VID:PID, we have an extra layer based on TinyUSB.

When the board resets, for a moment, that layer is not available and the auto-select identifies a generic ESP32S3.
Now because of how that core is structured and how uncontrolled the submission of boards has been over the years, the CLI will pick up that VID:PID pair, match it against an available board association and return any random board with that VID:PID.

This is unfortunate, but we've been working on it also with the Espressif team.
A more sturdy workflow is bound to be released into the next update which is bound to be released within a couple of weeks.

I know... it's a pretty frustrating one also for me :slight_smile:

Ok ! Thank you for your time :slight_smile:
Hopefully you'll succed