How to filter noise on uart rx line

Which system do you use? Android, Ubuntu, OOWOW or others?

Ubuntu

Which version of system do you use? Please provide the version of the system here:

Linux 5.15

Please describe your issue below:

Using pyserial to read values, but sometimes it returns incorrect value. For example, when I expect ‘l’, I receive ‘\x1f\xfb’ or other random junk sometimes. Baud rate is correct on both sides at 115200.

The picture above is the scope on rx and tx line for khadas, blue is tx yellow is rx. I think the UART might be mistaking the small yellow spikes on the yellow as a message start sometimes. Is there anyway to filter that?

Thanks.

Hello @ericz9002

Which uart you used? Are you sure your hardware connection is stable?

How do I check which uart I used? I know the serial port is /dev/ttyS3 if that helps.

I think something in the hardware is causing some noise, but there should be some way in software to filter that out right? The correct received signal is much stronger than the noise on the scope.