I can't get the serial monitor to work with my new Arduino Nano ESP32. The sketch never gets past the while(!Serial). If I remove the while(!Serial) I can see the LED blinking, but nothing shows up in the serial monitor.
I have tried:
Using a regular Nano board, and it works just fine.
Changing the baud rate, no difference.
Adding different delays after the Serial.begin().
I'm using a genuine Arduino Nano ESP32, Arduino IDE 2.2.1 and Windows 10.
My sketch is the same as yours, except that I use "D5" for the LED.
It'll stay stuck till you actually bring up SerialMonitor (if its window isn't active then it won't go anywhere).
Yes, the serial monitor is set to 9600. I tried changing from D13 to D5. With while(!Serial), the code never started running. Replacing it with a 1000ms delay made the program start running, but still nothing in the serial monitor.
I used your 9600, forgetting about my 19200 (usual) - and it still worked.
Unexpected.
I changed it to 9600 and it works that way. If SerMon wasn't active initially, it sat dark, but calling up SerMon resulted operation as expected.
This is driving me insane! I have tried reinstalling the IDE, reinstalling libraries, and now tried going back to 1.8.18. Now, whether I use 1.8.18 or 2.2.1, I keep getting "No DFU capable USB device available" when trying to upload sketches.... Have tried different USB-cables and different USB-ports.
I'm giving up for now.... I have tried four different USB-cables, different USB-ports, different PC's, I have tried using the web IDE, and I keep getting the error "No DFU capable USB device available".
I'm guessing that the Nano ESP32 has possibly gone bad, since I actually could upload programs to it yesterday. I have placed an order for a new Nano ESP32 in the hopes that my current one is broken.
Will update when I have tried the new board, and hopefully this will fix my initial problem with the serial monitor as well.
Hello @schectoo, sorry to hear about that experience! I have a couple questions for you to better understand the issue:
Are you using the "Arduino ESP32 boards" core? If not, please install it - if you already have it, please "Remove" and then "Install" it again. (During the setup phase this installs some drivers that are needed for Windows to see the serial port - make sure to allow it to install, if you are prompted by Windows).
Regarding the "DFU not available" issue on your first board, it can mean the original programming was modified during some of your tests.
After updating the core, please use this procedure to fully reinstall the software on a Nano ESP32.
Also, make sure that in your IDE, the Tools -> USB Mode option is set to Normal mode (TinyUSB).
YEY! Thank you, you absolute legends on this forum! I skipped the double-tap reset, suggested by @runaway_pancake, and went straight to @lburelli second tip regardning "DFU not available". I now can upload sketches again! And even better, I have the serial monitor again!
I'm certain that some of my tests yesterday messed something up with regards to the "DFU"-error, but I can still not figure out why the serial monitor didn't work out of the box.
I was having the same problem. I ended up installing Visual Studio Code and Platformio with the Arduino framework. When I went back to check something with the Arduino ide, it now magically worked.
If the problem just that the Serial monitor isn't working (but the USB connection is okay) there is a simpler workaround. In your code comment out the while line and uncomment the delay line. With recent cores I find that 5000 ms is enough, though originally I needed 15000.
I have done this in my own code and with half a dozen of the built-in examples and it works every time. It seems like something that could be built into the library.