The
$ idf monitor command always properly used
escape codes, and did not exhibit the problem stated here. I have not been using that command much, in order to focus on the standard terminal applications most typically used like
Winterm, Putty, Screen, Cu, Minicom, and similar.
Update
While switching between
idf monitor and
screen(1) I discovered by accident, that if a ESP32-C3 is powered on for the first time and then connects its console application (basic example) using
idf monitor running on the downward facing port Linux host, that after quitting
idf monitor all other serial terminal applications (screen, cu, minicom) are served escape codes correctly by the
ESP-IDF console component. The problem does not appear in this strange situation.
Let me explain. The following failure and success sequences both use the same
examples/system/console/basic firmware running on the same
ESP32-C3 custom device connected with the same USB cable to the same Linux host.
Failure to serve escape codes
- Plug ESP32-C3 device into the Linux host with a USB cable
- Turn on the power of the ESP32-C3 device
- Run a standard terminal application on the Linux host
Success to serve escape codes
- Plug ESP32-C3 device into the Linux host with a USB cable
- Turn on the power of the ESP32-C3 device
- Run idf.py monitor on the Linux host
- Wait to see the ESP32-C3 console application connect, showing esp32c3> prompt
- Quit the idf.py monitor by typing Ctrl-]
- Run a standard terminal application on the Linux host
Summary
Using the
ESP-IDF console component with
CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG fails to serve escape codes in all cases except when (1) the
idf.py monitor is run first and (2) a
standard terminal application is run afterwards.
Question
Is this realisation enough to conclude that the
ESP-IDF console component is defective? It's clearly
not serving escape codes in all the cases where it
should do so. If anyone thinks this is a console component implementation flaw, then I will write a bug report on the ESP-IDF repository.
esp-idf/components/console/