0

I have a problem in which I write a VERY simple program for the ESP32 using the Arduino IDE. I am trying to write something to the Serial output, but in the console I only get gibberish. I do get the data, but it's not formatted in the way it needs to be. Here is a screenshot: enter image description here

As you can see, the code is very simple. The console is on the right rate, but the input looks like crap. I have tried using different forms, like Serial.write and Serial.print, but they all seem to not work.

I just expect to get "Testline" on different lines, which does happen sometimes, but it's not consistent.

I am using the NodeMCU-ESP32 ESP32 DEVKITV1

2
  • 2
    Have you tried using longer delays? What happens then? And all in all this looks more like some kind of buffering issues, where multiple transmissions are mixed up somehow (either on the sending or on the receiving side). Commented Mar 19, 2021 at 11:48
  • This was the fix. A delay of 40 was perfect. Any less would screw it up again. Thanks for the help, turned out to be quite easy. Don't know why this works though :) Commented Mar 19, 2021 at 11:53

2 Answers 2

2

Using a delay of 40 did the trick.

Have you tried using longer delays? What happens then? And all in all this looks more like some kind of buffering issues, where multiple transmissions are mixed up somehow (either on the sending or on the receiving side).

– Some programmer dude

Sign up to request clarification or add additional context in comments.

Comments

0

I had to spent some additional time debugging my smart hardware electronics for a home automation wall mount switch based on the ESP32 S3 ( see it on my GitHub here )

enter image description here

because I was able to upload the firmware code into it however when reading serial output it only displayed "gibberish" characters.

On the internet I could not find the answer, so I had to work harder to find the solution. Common problems found when dealing with serial output errors are:

  • poor UART ground
  • absence of a 500 Ohm resistor on the TX line
  • UART cable to long
  • track coupling and track length mismatch

are all hardware issues that cause serial communication errors and malfunctioning. However, for the ESP32 there's one missing on the list above. On this particular hardware, I had incorrectly soldered the RTC crystal of 32,768MHz into the MCU crystal place which is for one of 40MHz. The result was, it is possible to do firmware upload using a 32,768Mhz crystal for the MCU however, and due to the incorrect clock frequency, serial output is no longer 115200bps and displays "gibberish" characters.

In summary make sure the crystal has the correct clock frequency value.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.