Random Characters generated in Serial console

Interested to get some advice on the following please.

Working on a project for some time now and had this issue with a serial console showing weird characters.

Everything is the code works but have some minor issues that I need to resolve.

I have read about baud rates and slowing the code down to communicate to the SIM modem. Baud rate is 115200.

Q. Where do these extra characters come from?
Q. How do I debug them?
Q. Both MQTT and modem AT commands seem to generate them?
Q. MQTT pub topics seem to have more
Q. MQTT sub topics are ok

Using MQTT explorer to the cloud MQTT broker and pub/sub messages are as expected.

In serial console added to the code looking for blanks etc...

    Serial.print("<");
    SerialMon.print((char*)payload);
    Serial.println(">");

and connecting to a cloud MQTT broker
image

and sending MQTT commands I see in the serial console extra characters

How long is your TX/RX/GND serial connection?

Physically? Very short standard testing cables e.g., Jumper Wire Female to Female 6.00" (152.40mm) 28 AWG

Then I'd suspect one or more is dodgy. Getting good characters so often, occasional issues like that is either a flaky connection, something spiking your power supply (like a relay or solenoid you're turning on or off), or a big piece of equipment turning on or off in the vicinity of your apparatus. Serial is susceptible to noise.
Those are my guesses, anyways.

Thanks, but the same characters are generated as its looks repeatable rather than random if its noise?

Example A if I send the same MQTT command the extra characters are the same every time.

Example B AT Modem Commands

Concur. I suspect what you're seeing are valid characters, then, just not intelligible to Serial Monitor. Have you looked at the data with something more sophisticated? There are serial sniffers out there that will show you the hex value instead of an unintelligible character.

No I havent at this stage hence some advice from this forum. Any particular serial sniffers to look at?

Using MQTT explorer to watch the topics and that had no noise hence what you are suggesting is a good idea.

At the moment if I pause the serial console and try to copy the output it doesnt always copy those extra characters.

⸮
>⸮
0!

0#

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.