Bad characters while communication over serial port

General project discussion / help
Did you make a robotic coffee pot which implements HTCPCP and decafs unauthorized users? Show it off here!

Moderator: phalanx

Post Reply
pavanvd
Posts: 6
Joined: Thu May 11, 2017 10:14 am

Bad characters while communication over serial port

Post by pavanvd » Thu Sep 20, 2018 5:04 am

Hello All,

I am interfacing a SIM800 GSM module with Pi 3 over serial ports (pins 6, 8, 10). While things work OK most of the time, every now and then I get spurious characters in the response. For example, I get:

['+CLCC: 1,0,2,0,0,"+919812x\x9c\xd3\x13\x93\x93\x12)\xa25,""', 'OK']

whereas the expected response is: ['+CLCC: 1,0,2,0,0,"+919812012321,""', 'OK']

As I said, this happens once in a while (may be 1 in 10) and happens with other commands too. Also, this is not the only GSM module or Pi having the problem. So very unlikely hardware issue, unless the GSM module is buggy. The GSM module in question is this http://www.rhydolabz.com/wiki/?p=10450

The baudrate is set to 9600.

What could be going wrong? Could it be bad connections? I usually crimp dupont connectors to the open ends of the cable supplied with the modem. As far as I can tell, the crimps are decently done. How do I fix this?

Thanks,
Pavan

paulvha
Posts: 253
Joined: Sat Nov 11, 2017 2:39 am

Re: Bad characters while communication over serial port

Post by paulvha » Thu Sep 20, 2018 8:28 am

the "real" serial port on Pi3 is set by default to communicate to the on-board bluetooth. Make sure to disable. There are many articles around that e.g. see https://spellfoundry.com/2016/05/29/con ... ding-pi-3/

regards,
Paul

pavanvd
Posts: 6
Joined: Thu May 11, 2017 10:14 am

Re: Bad characters while communication over serial port

Post by pavanvd » Fri Sep 21, 2018 9:05 am

paulvha wrote:
Thu Sep 20, 2018 8:28 am
the "real" serial port on Pi3 is set by default to communicate to the on-board bluetooth. Make sure to disable. There are many articles around that e.g. see https://spellfoundry.com/2016/05/29/con ... ding-pi-3/

regards,
Paul
Hi Paul,

Thanks for the response. I am very sure that I have setup UART correctly. Bluetooth is disabled.

Code: Select all

$ ls -lrt /dev/serial*
lrwxrwxrwx 1 root root 5 Sep 21 12:17 /dev/serial1 -> ttyS0
lrwxrwxrwx 1 root root 7 Sep 21 12:17 /dev/serial0 -> ttyAMA0
Things work mostly. But the problem is with that erratic response once in every 20 times may be, especially to CLCC commands.

Thanks,
Pavan

Post Reply