No output in Serial Monitor from ESP32-CAM

same problem with Arduino IDE 2.0 RC6 on Windows 10 with ESP32-CAM and CH340G .
Serial monitor works with Arduino 1.8.16 but not in Arduino IDE.

Useless to install the downloaded the CH340 driver from http://www.wch.cn/downloads/CH341SER_ZIP.html .

Thank you for communication, if the problem is solved.

Hi @erhy. Thanks for taking the time to give the Arduino IDE 2.0.0 release candidate a try!

Please provide a detailed description of the problem you have experienced when using the Arduino IDE 2.0.0-rc6 Serial Monitor and I will investigate.

Thank You for Your interest about the problem.
Because there are some pictures the detailed description in a Google Docs:
[Arduino IDE 2.0 problem with Serial monitor - Google Docs]

Please tell me about your thoughts

I see there are previous reports of the problem here:

As I mentioned there, I don't own one of these ESP32-CAM boards and haven't been able to reproduce the problem with any of the many other boards I do have.

I think the best way to proceed with the investigation is bisecting the origin of the problem.

The Arduino IDE 2.x code base is mostly only for the GUI components. Most of the non-GUI capabilities are provided by other tools. The next level down under the Arduino IDE 2.x is the "Arduino CLI" command line tool. This tool actually uses another command line tool named "serial-monitor", which translates the serial communication with the board and TCP/IP communication with the Arduino IDE 2.x. However, it can be a little tricky to use the serial-monitor tool directly, so I think using Arduino CLI will be the most convenient.

I'll provide instructions:

  1. Use the Arduino IDE to upload a sketch to your board that produces periodic serial output. The one you showed in your screenshot is perfect, but I'll provide another example here for the sake of others who might later follow this and find it useful to have some text formatted code to copy/paste:
    int counter;
    void setup() {
      Serial.begin(9600);
    }
    void loop() {
      Serial.print("hello #");
      Serial.println(counter++);
      delay(500);
    }
    
  2. Take note of which port your board is on (as selected in the Tools > Port menu of the Arduino IDE).
  3. Close the Arduino IDE so we can make sure it isn't using the serial port.
  4. Download the version of Arduino CLI used by Arduino IDE 2.0.0-rc6 from this link:
    https://downloads.arduino.cc/arduino-cli/arduino-cli_0.21.0_Windows_64bit.zip
  5. Unzip the downloaded file to any convenient location.
  6. If it is not already open, start Windows "File Explorer".
  7. Open the folder where you unzipped the Arduino CLI download.
  8. In that folder listing, hold the Shift key while clicking the right hand button on the mouse.
  9. From the context menu, click "Open PowerShell window here".
    "PowerShell" will now open with the current directory set to the folder containing Arduino CLI.
  10. Type the following command:
    ./arduino-cli monitor --port <port name>
    
    :exclamation: Replace <port name> with the name of the port of your board.
  11. Press the Enter key.

After a small delay, you should see something like this printed:

Connected to <port name>! Press CTRL-C to exit.

If the serial communication is working as expected, that should be followed by the expected output from the board.

For example, with the sketch I shared above:

hello #1
hello #2
hello #3

... and so on.

Do you see that expected output?

Thanks for the update, my PC just died but I will try the latest RC candidate as soon as I fix my PC

1 Like

Thank You!
I added code for led blinking, to see whether the code is executed:

#define flash 4
int counter;
void setup() {
  pinMode(flash, OUTPUT);
  Serial.begin(9600);
}
void loop() {
  if ( counter & 1 ) {
    digitalWrite(flash, LOW);
  }
  else {
    digitalWrite(flash, HIGH);
  }
  
  Serial.print("hello #");
  Serial.println(counter++);
  delay(500);
}

Plug USB the LED blinks
start the command ./arduino-cli.exe monitor -p COM5
The led is dark and the message is
Connected to COM5! Press CTRL-C to exit.
no output is logged.
after pull USB arduino-cli.exe ends

starting the command with unplugged USB
and plug USB few seconds after the message is

Connected to COM5! Press CTRL-C to exit.
��f������`���

and the led is dark.

same with Arduino 1.8.16 after press reset:

20:24:35.642 -> 9Zv⸮c/a{)a5⸮⸮⸮V:⸮aQVHhello #0
20:24:37.143 -> hello #1
20:24:37.658 -> hello #2
20:24:38.128 -> hello #3
20:24:38.641 -> hello #4
20:24:39.153 -> hello #5
20:24:39.622 -> hello #6
20:24:40.136 -> hello #7
20:24:40.648 -> hello #8
20:24:41.159 -> hello #9
20:24:41.625 -> hello #10
20:24:42.138 -> hello #11

and led blinks

OK, thanks. That is very valuable information.

Since you were able to reproduce the problem when using the same version of Arduino CLI and serial-monitor used by Arduino IDE 2.x, we now know that it is not caused by anything in the Arduino IDE code base. That eliminates a huge amount of complexity from the equation.

The next thing to determine is whether the issue still occurs when using the latest version of Arduino CLI and serial-monitor. This will tell us one of two things:

If it no longer occurs

The bug has been fixed by the development work done on those projects since the release versions used by Arduino IDE 2.x.

In this case, the developers will only need to update the Arduino IDE 2.x dependencies and the problem will be solved.

If it still occurs

There is still a bug in serial-monitor (or maybe in Arduino CLI, but that is less likely). The developers will need to investigate and fix the issue.

Instructions

I'll provide the instructions you can follow to run this new test:

Set up board

  1. Use the Arduino IDE to upload a sketch to your board that produces periodic serial output. The one you shared in your last reply perfect.
  2. Take note of which port your board is on (as selected in the Tools > Port menu of the Arduino IDE).
  3. Close the Arduino IDE so we can make sure it isn't using the serial port.

Install serial-monitor tool tester build

  1. Create this folder:
    C:\Users\<user name>\AppData\Local\Arduino15\packages\builtin\tools\serial-monitor\0.9.2-beta.1
    
    (where <user name> is your Windows user name)
    If looking for it with your file browser or command line, note that the C:\Users\<user name>\AppData folder is hidden by default. On Windows "File Explorer", you can make it visible by opening the "View" menu, then checking the box next to "☐ Hidden items".
  2. Sign in to your GitHub account.
    (GitHub only allows downloads of the tester builds of serial-monitor when you are signed in)
  3. Open this page in your browser:
    https://github.com/arduino/serial-monitor/actions/runs/2262985440#artifacts
  4. From the "Artifacts" section of the page, click the "Windows_X86-64" link.
    A file named Windows_X86-64.zip will be downloaded.
  5. Unzip the downloaded file.
  6. Unzip the serial-monitor_test-a7951e03266934f0793f86df2c92522f52aa3f48-git-snapshot_Windows_64bit.zip file from the unzipped folder.
    (yes, there is a ZIP inside of a ZIP :upside_down_face:)
  7. Move the serial-monitor.exe file from the unzipped folder to the 0.9.2-beta.1 folder you created in step (1). The final location should be:
    C:\Users\<user name>\AppData\Local\Arduino15\packages\builtin\tools\serial-monitor\0.9.2-beta.1\serial-monitor.exe
    

Install Arduino CLI nightly build

  1. Download the nightly build of Arduino CLI from this link:
    https://downloads.arduino.cc/arduino-cli/nightly/arduino-cli_nightly-latest_Windows_64bit.zip
  2. Unzip the downloaded file to any convenient location.

Run test

  1. If it is not already open, start Windows "File Explorer".
  2. Open the folder where you unzipped the Arduino CLI nightly build download.
  3. In that folder listing, hold the Shift key while clicking the right hand button on the mouse.
  4. From the context menu, click "Open PowerShell window here".
    "PowerShell" will now open with the current directory set to the folder containing Arduino CLI.
  5. Type the following command:
    ./arduino-cli monitor --port <port name>
    
    :exclamation: Replace <port name> with the name of the port of your board.
  6. Press the Enter key.

After a small delay, you should see something like this printed:

Connected to <port name>! Press CTRL-C to exit.

If the serial communication is working as expected, that should be followed by the expected output from the board.


Please let me know if you have any questions or problems while following those instructions.

It seems, that the behavior is the same
start the command ./arduino-cli.exe monitor -p COM5
The led is dark and the message is
Connected to COM5! Press CTRL-C to exit.
no output is logged.
after pull USB arduino-cli.exe ends

starting the command with unplugged USB
and plug USB few seconds after the message is

Connected to COM5! Press CTRL-C to exit.
��f������`���

with Arduino 1.8.16 after press reset:
15:13:12.284 -> ⸮v⸮cA⸮8⸮⸮⸮
15:13:12.284 -> ay8&jVM@.1&⸮⸮hello #0
15:13:13.790 -> hello #1
15:13:14.308 -> hello #2
15:13:14.780 -> hello #3
15:13:15.298 -> hello #4

Thanks! We now know that the bug remains to be fixed, so it is time to pass the baton to the developers.

Please submit a bug report here:

You can put this in the "serial-monitor version" field of the bug report form:

 test-a7951e03266934f0793f86df2c92522f52aa3f48-git-snapshot

Please let me know if you have any questions.

had submit the bug report https://github.com/arduino/serial-monitor/issues/17

1 Like

Hi @erhy. Did you ever get the chance to follow up on the issue as requested by the developer?:

https://github.com/arduino/serial-monitor/issues/17#issuecomment-1135676990

I'd like to send you a small terminal program written in golang to try out, to further reduce the possible causes. May you compile a golang program in case?
Otherwise I can post here a prebuild executable if you're ok with that.

It would be great to see if we can move forward towards a resolution for this issue.

Still the same problem with the final version 2.0.
The ESP32-CAM-MB board (MB = Mother Board) must have a problem.

A solution has been found by PlatformIO: in file platformio.ini, you have to add the lines:

monitor_rts = 0
monitor_dtr = 0

it works perfectly.

Too bad that the solution having been found, the Arduino developers were not inspired by it, because it makes their IDE unusable with the ESP32-CAM-MB which is a great progress in the use of the ESP32-CAM.

1 Like

Hi @68tjs. I don't know what you mean by "inspired by it". In fact, more likely it was PlatformIO that was "inspired" by the addition of such a configuration capability in the Arduino IDE 5 years ago:

If you look at the bug report linked above, the developers have been working on adding this capability to the modern tooling. It was originally implemented in the Java codebase of Arduino IDE 1.x. Since that time, the Serial Monitor system has been completely reworked, using a flexible and powerful "pluggable monitor" approach that allows the monitoring of any communications channel rather than assuming Arduino boards will only ever communicate with the tooling via serial or network ports. This was a lot of work that was done in stages. The support for the control signal properties simply hadn't been added yet.

I don't want to argue.

I notice:
Today with ESP32-CAM-MB:

  • with the Arduino IDE the serial monitor does not work
  • with PlatformIO it works with the two lines I found and indicated, it works perfectly.

Why it works or doesn't work is none of my business.
I'm just a simple user, I'm not in charge of developing an IDE.
I just want a solution.

Platformio gave a solution, IDE V2 did not give one since users still encounter the same problems.

If you have a solution, it must be indicated and clearly indicated in arduino.cc.
The ball is in your court.

1 Like

We do not and will not track development tasks on arduino.cc. We do that using the efficient infrastructure present in the GitHub repositories where the work happens. If you want to find the list of known bugs, feature requests, deficiencies, etc., you must go to the GitHub repositories of the relevant projects.

You must : No I have no obligation.

When I see users who still have problems with the ESP32-CAM-MB board when a simple solution exists, I share what I learned.
I never advised to use such or such IDE, I make an answer among others which can exist.

You choose to use GitHub, it's your responsibility, other competitors maintain easily accessible sites: platformIo, rp2040, Espressif.
Assume that your choices do not suit all users.

Please share a link to the pages on those sites where low impact software bugs are prominently documented.

I do.

This discussion has become fruitless.
As far as I remember, the "so-called" Arduino IDE is that of Processing taken over by E Barragan. Arduino is an unfriendly fork of Wiring.
The first card I bought, an UNO R2, had a bootloader that only worked under XP. Cannot use it under Vista or Linux. I bought it in June 2011, the solution was known since February 2011. There was indeed an indication of the bug, but well hidden at the bottom of the Arduino site and inaccessible. It was very difficult for me to obtain the explanation and the solution, given by an independent reseller, different from the one where I had bought my card.
You now understand why I am sensitive to non-information.

I don't spit in the soup, as we say in France. I recognize the eminent role of the company Arduino SA, Swiss law based in Lugano, in the popularization of microcontrollers and help to make them accessible to as many people as possible.

It's only those who do nothing that don't make mistakes.
But when there are mistakes, you shouldn't be outraged when they're pointed out. Acknowledging mistakes is the basis for improvement.

Some of board directors are from ARM inc

??? That is a forum post. How does that in any way back up your claim:

Arduino also has a forum. The bug and fix is also discussed in a forum post. So what exactly is it you think those competitors are doing differently?

Arduino IDE 2.x is a complete rewrite of the IDE. It doesn't share any DNA with Processing or Wiring.

ehry pointed out the mistake. There was no outrage. Instead there was an investigation and a lot of work to prepare a very high quality fix that doesn't involve users having to mess with unfriendly configuration files.

Surely. We use public issue trackers to clearly document all known bugs in the Arduino IDE and associated tools.

I didn't take it out on you personally, calm down.
You refuse information from the PlatformIo forum oK .
Give the same information in less than 10 lines on the arduino forum instead of sending read several github sites.
I think users, especially beginners, will find this alternative method more user-friendly.

End of discussion.
No response will follow.