but then immediately after the serial monitor only shows gibberish.
Only after changing the baudrate in the serial monitor to 74880 the 'on'... 'off' shows up correctly.
I also tried setting the baudrate to a different value but the problem is the same.
The baudrate during boot stays 115200 but after it is one baudrate lower than selected. With low baudrates like 9600 it doesn't work at all
I'm pretty sure I have. I have used this board before and it worked just fine.
I selected TTGO LoRa32-OLED
I also tried this with a different board of the same model and the problem is the same.
If you look under Tools, when you have selected that board, you also further down get a 'Board revision' option. In the IDE here I see 3 revision options.
I know its pretty basic, but have you tried another USB cable - just in case?
I don't suppose there is anything else connected to the serial port?
Just as an experiment, if you set the baudrate to 57600, does it then work if you set serial monitor to 37440? Or at 9600, does t show correctly at 6240 in serial monitor? Just wondering whether the timing is consistent or random.
I tried all 3 options under the menu Board revision.
If I set the baudrate to 57600 the monitor shows the text at 38400.
If set to 9600 the monitor shows only gibberish at any baudrate. I cannot select a baudrate of 6240.
It is some time since I used the ESP32 TTGO Lora Oled V1 and I remembered that the Tools>Board I used was "Heltec WiFi LoRa32"
however, using ESP32 core 3.1.0 if I run any program the serial output is garbage, e.g. at Serial.begin() and Serial Monitor set to 115200
I’ve noticed this issue with ESP devices as well. The reason, I believe, is that they program at a specific baud rate, regardless of the terminal’s settings. When the IDE uploads code, it temporarily changes the baud rate to match what the programmer needs. After the upload is complete, it switches the baud rate back to the user-defined setting.
During the upload process, data is exchanged between the ESP device and the programmer at the programming baud rate. If the buffers aren’t flushed properly before switching back to the user-defined baud rate, you may see garbage output. This issue might also include the acknowledgment for the final code record being processed.
To address this, I typically add a delay after the upload and then explicitly set the desired baud rate. This approach has worked reliably for me.
using the ESP32 TTGO Lora Oled V1 tried delay() after upload before Serial.begin() same problem of corrupt output with WSP32 Core 3.1.0
also tried closing the Serial and calling begin again, e.g.
when using ESP32 core 3.1.0 the serial monitor on my ESP32 TTGO Lora Oled V1 shows garbage all at baud rates -serial output OK with ESP32 core 2.0.17
maybe worth raising a post on the Espressif Arduino Forum
I have two of these boards and they both have the same problem. Also they worked just fine a week ago. It is pretty unlikely that both of them broke at the same time.