Esp-prog and serial monitor (nothing displayed)

I am using an esp-prog to both debug and upload my executable to a Keyestudio esp32.
Both debugging and uploading work fine. But when I try and display something on the Serial Monitor it doesn’t display anything.

Here is my platformio.ini

[env:esp32dev]
platform = espressif32
board = esp32dev
framework = arduino
monitor_speed = 115200
upload_speed = 921000
debug_tool = esp-prog
debug_init_break = tbreak setup
upload_protocol = esp-prog

and here is the code

#include <Arduino.h>

void setup() {
// put your setup code here, to run once:
pinMode(23, OUTPUT);
Serial.begin(115200);
Serial.print(“xx”);
}

void loop() {
// put your main code here, to run repeatedly:
digitalWrite(23, LOW);
Serial.println(“Off”);
delay(250);
digitalWrite(23, HIGH);
Serial.println(“On”);
delay(750);
}

I did notice that when I plug in the esp-prog it show two ports /dev/ttyUSB0 and /DEV/ttyUSB1. After I upload the code only /dev/ttyUSB1 remains. I don’t know if this is related.

Any suggestion would be helpful.

Thanks
Peter

One possibility may be “monitor_port = /dev/ttyUSB1” is needed. The platformio.ini below works for me to load/debug/monitor over same port, and it is almost identical to yours. BR Pekka

[platformio]
src_dir = /coderoot/pins/examples/jane/code
lib_dir = /home/john/Arduino/libraries
build_dir = /tmp/pio_jane

[env:esp32doit-devkit-v1]
platform = espressif32
board = esp32doit-devkit-v1
framework = arduino
build_flags = -D E_OS_arduino
build_flags =
-I /coderoot/eosal
-I /coderoot/pins
-I /coderoot/pins/examples/jane/pins/carol
upload_protocol = esp-prog
upload_port = /dev/ttyUSB1
monitor_port = /dev/ttyUSB1
monitor_speed = 115200
debug_tool = esp-prog

Good thought, but still not working

[env:esp32dev]
platform = espressif32
board = esp32dev
framework = arduino
monitor_speed = 115200
upload_speed = 921000
debug_tool = esp-prog
debug_init_break = tbreak setup
upload_protocol = esp-prog
upload_port = /dev/ttyUSB1
monitor_port = /dev/ttyUSB1

Any other ideas?

How do you connect the ESP32 to your computer? Do you have two USB cables: one going to the ESP32 and one to the Esp-Prog? Or do you just have a single USB cable going to the Esp-Prog and then at least 8 wires (GND, VCC, TMS, TDI, TDO, TCK, RX, TX) to the ESP32? Or somehow else?

And what do you mean by “still not working”? Do you get an error message? Or garbled output?

2 Likes

I am using only one USB cable connected to the ESP-PROG, I only have 6 wire connected to EPS32 I don’t have RX and TX connected. Could that be the issue? There are no errors and nothing is displayed on the serial monitor (no garbled text).

I connect the RX and TX and I am now getting the serial monitor output.

Thanks for your help.
Peter

1 Like

Yes, RX and TX need to be connected because that’s where the serial output is going. You can either connect them to the ESP-Prog or connect the second USB cable. The other pins (TMS, TCK, TDI and TDO) are for JTAG.

It’s possible to route ESP log messages via JTAG (see Logging to Host). But it only applies to ESP_LOGx calls, not to serial output in general.

I got same problem with my T-display TTGO
Until I clicked on the Icon on the blue bar in the lower left corner. The Icon that look a connector stick “PlatformIO: Serial Monitor”
Then you only need the USB connection, if the display comes with the ESP32 (is soldered to the PCB)

1 Like