Apple Mac OS
Arduino IDE 2.3.0
Arduino Nano ESP32
ESPAsyncWebServer
Arduino C++
For a while I was able to program my Nano ESP32, and re-program it as the code progressed. I even got it to do it twice today. Now the IDE won't allow the correct port (/dev/cu.usbmodem3485187A6A182 [not connected]) to be created. Even when it did, it appeared to do uploads, but upon completion hadn't uploaded the new program. I get downloads over the Serial Monitor so the cable has to be good. Further, I can read the output to the Serial Monitor, so the baud rate (9600) has to be okay. I've rebooted the computer a few times, including 5 minutes ago, and still have the same problem. While the port was working, I tried the Burn Bootloader without success. It kept telling me the port wasn't working, even when the line at the bottom of the IDE said it was. What am I missing?
To me, Terminal is a program I run to do low level stuff on the computer. Are you talking about the IDE? On the Nano, Tx and Rx type lights don't normally blink even when the thing is operating normally.
Yes, that opens a serial connection to the Arduino and will sometimes print data depending on what program is loaded. You can set it at a weird baud (I do not remember what) and it spits data as it boots.
Hi @fester225. I see you are experiencing multiple distinct problematic behaviors:
It is good that you listed all of them. However, I think it might be very confusing if we attempt to troubleshoot all of them simultaneously. So let's try to focus on just one for now. Solving that one might solve the others. If not, we can circle back to the remaining problems.
Please add a reply here on this forum thread to tell us which of those three problems you able to reliably reproduce right now.
I always use 115200 as my baud rate, that way when I connect it should work the first time. This works great with the IDE 1.8.18 I think the ESP default baud is 460800.
I'm not sure I understood correctly what you mean by "won't allow to be created". Please add a forum reply here that provides a more detailed description to help me to understand it.
The bottom-right of the IDE shows which port should be used, yet it is not connected.
When you look at Tools/Port, the correct port is not available to be selected.
The correct port has been available, selected, and successfully used in the past.
"the IDE won't allow the correct port (/dev/cu.usbmodem3485187A6A182 [not connected]) to be created"
Please try this experiment and then report back with the results:
Connect the Nano ESP32 board to your computer with the USB cable.
Press and release the button on the board marked "RST".
Wait for the RGB LED near the "RST" button to turn on.
It does this almost immediately, but you do need to wait for it.
While the RGB LED is still on (it only stays on for a second so you need to be somewhat quick), press and release the "RST" button again.
The green LED of the RGB LED should now start pulsing. If not, repeat the process in case you didn't get the timing quite right.
If it is already open, close the Tools > Port menu in Arduino IDE.
Open the Tools > Port menu in Arduino IDE.
Now please reply here on the forum thread with the answers to the following questions:
Do you now see the green LED pulsing?
Do you see a port for the Nano ESP32 board in the Tools > Port menu?
The Nano has been disconnected for a couple of days, so, of course, when I turned it back on, the port was there and it started working, kind of. Now the port connection works, but the board still won't program. (Let me get back to that.)
I went through the procedure you gave me. There is an LED next to the reset button, but after several tries and holding the button down for a full minute, the LED never turned on in any way until after I released the button. When I did, the color rotated between blue, red, and green. It never does pulse.
Back to the board not programming. I currently have version 1 of the program on the board. For version 1.1, I use the same program as the original but made changes to two Serial.println("")s, and added a delay(). I click on Upload and watch as it goes through its routine. After showing 4%, 8%, 12% on up to, and including 100%, it shows "done!" The Serial Monitor then starts showing output from the old program. Turn the board off, reset the Serial Monitor, turn the board back on, wait a couple of seconds, turn the board back off, then check the Serial Monitor from the beginning, and.....it's still running the old version.
It sounds like you only pressed the button once. You must press it twice.
But if the board is producing a port once again and the uploads process is completing without an error then you don't need to worry about the double-reset procedure anymore.
There are two possible explanations:
The program is not being updated by an upload (your hypothesis)
The program is being updated by the upload, but the behavior of the program does not match your expectations.
To test whether the program is being updated by an upload, you can upload a simple sketch that has a well understood and obvious behavior:
Select File > Examples > 01.Basics > Blink from the Arduino IDE menus.
The simple "Blink" sketch will open in an Arduino IDE window.
Upload the sketch to your board as usual.
Now please reply here on the forum thread with the answer to the following question:
Do you see the yellow LED on the Nano ESP32 board blinking at 0.5 Hz?
I discovered the error of my ways and started doing a fast double press on the reset key. This does in fact recover the port. Having done this I now get a blinking green light. The new program version has a couple of Serial.println in it which makes it easy to tell if I'm looking at the new version or the old. I still have the old. As a backup I use Blink. Blink does not upload, or run, either. I am noticing that I lose the port during the upload. At no time do I see a yellow LED blinking at any rate.
Nice! The double reset technique is a valuable thing to know. The tricky thing about the boards with native USB capability like the Nano ESP32 board is the USB code that creates the CDC serial port is running on the same microcontroller as your sketch. This means your sketch code can break the USB code, or stop it from running. This can either be an expected result of the behavior of the sketch program (e.g., putting the microcontroller to sleep) or an unexpected result of a bug (e.g., a divide by zero). When that happens, the board no longer produces a serial port. So the board going into this state is something we can expect to encounter from time to time while working on our projects, but as long as you know the double reset technique it is easy enough to recover the board.
I'm going to ask you to post the full verbose output from an upload.
This procedure is not intended to solve the problem. The purpose is to gather more information.
Please do this:
Select File > Preferences... (or Arduino IDE > Settings... for macOS users) from the Arduino IDE menus.
The "Preferences" dialog will open.
Uncheck the box next to Show verbose output during: ☑ compilation in the "Preferences" dialog.
Check the box next to Show verbose output during: ☐ upload.
Click the "OK" button.
Attempt an upload, as you did before.
Wait for the upload to finish.
Right click on the black "Output" panel at the bottom of the Arduino IDE window.
From the context menu, click Copy All.
Open a forum reply here by clicking the "Reply" button.
Click the <CODE/> icon on the post composer toolbar.
This will add the forum's code block markup (```) to your reply to make sure the error messages are correctly formatted.
Press the Ctrl+V keyboard shortcut (Command+V for macOS users).
This will paste the compilation output into the code block.
Move the cursor outside of the code block markup before you add any additional text to your reply.
Click the "Reply" button to post the output.
This is normal. As I mentioned above, the serial port is produced by the sketch program. The sketch program stops running during the upload process so the board stops producing a serial port for that period of time.
Normally the port will appear once again as soon as the newly uploaded sketch program starts running. However, as I mentioned above certain sketch code can cause the board to not produce a serial port so if you have uploaded such a program then the port will not reappear after the upload has completed.
Sketch uses 289125 bytes (9%) of program storage space. Maximum is 3145728 bytes.
Global variables use 30740 bytes (9%) of dynamic memory, leaving 296940 bytes for local variables. Maximum is 327680 bytes.
"/Users/danriebs/Library/Arduino15/packages/arduino/tools/dfu-util/0.11.0-arduino5/dfu-util" --device 0x2341:0x0070 -D "/private/var/folders/n_/1fp41d8s5dd7_xvctlg2jlth0000gn/T/arduino/sketches/10D789C3357322AE52AB666607F71AD2/Blink.ino.bin" -Q
dfu-util: No DFU capable USB device available
dfu-util 0.11-arduino4
Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2021 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to http://sourceforge.net/p/dfu-util/tickets/
Failed uploading: uploading error: exit status 74Sketch uses 289125 bytes (9%) of program storage space. Maximum is 3145728 bytes.
Global variables use 30740 bytes (9%) of dynamic memory, leaving 296940 bytes for local variables. Maximum is 327680 bytes.
"/Users/danriebs/Library/Arduino15/packages/arduino/tools/dfu-util/0.11.0-arduino5/dfu-util" --device 0x2341:0x0070 -D "/private/var/folders/n_/1fp41d8s5dd7_xvctlg2jlth0000gn/T/arduino/sketches/10D789C3357322AE52AB666607F71AD2/Blink.ino.bin" -Q
dfu-util: No DFU capable USB device available
dfu-util 0.11-arduino4
Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2021 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to http://sourceforge.net/p/dfu-util/tickets/
Failed uploading: uploading error: exit status 74
This description doesn't match with the output you shared in your latest reply, which shows the upload failed before it reached that "Done!" state. So what did you do differently during this upload compared to the upload you described previously which produced that "Done!" message?