I've been trying to setup an RPi0 with a GPS module.

This is the GPS antenna I'm using

This is the GPS module I'm using to connect to the Pi

I've tried the module with USB on my desktop (Windows 10) and it works fine I can see the GPS info coming in via PuTTY and doing the same on the RPi via USB I can see the GPS output in /dev/ttyACM0 and using cgps -s

I can see from the output in PuTTY (and there is also a red LED on the GPS module itself that begins to blink once its acquired a signal) that it is working and I am getting the correcct co-ordinates from the GPS

The issue I'm having is that when I connect my GPS module to my Pi using the serial pins (as per this tutorial) rather than the USB port I'm only seeing the GPS location sporadically in the terminal (in /dev/serial0). Instead the majority of the output from the GPS is as below.

$GPTXT,01,01,01,NMEA unknown msg*58

I did find a link to an article which said running the following command might help as the Pi might be trying to send messages back to the GPS module which would essentially confuse it, apologies I can't seem to find the link again but hopefully the command will make some sense:

$ sudo stty -F /dev/ttyS0 -echo

This didn't seem to have any effect but I then unplugged the TX pin on the Pi so it couldn't send anything to the reciever and that seems to have done the trick for the raw output I'm seeing from the module and I stopped getting the unknown msg error appear and I'm getting the GPS location information but I'm not seeing any info when I run cgps -s only with sudo cat /dev/serial0

So my question is whats going on with the serial connection? It all works as expected via USB but via serial I'm seeing the correct output only when the TX pin is unplugged (on the Pi) and I'm not getting any output from cgps -s / having to run sudo to see the output in /dev/serial0.

  • 2
    Did you enable serial port and disable serial console in Raspberry Pi Configuration, Interfaces? What baud rate are you using? – CoderMike Jun 28 at 15:55
  • @tqhien's UART advice in his answer on the following GPS Q&A might help. raspberrypi.stackexchange.com/questions/113544/…. Cheers. – tlfong01 Jun 29 at 1:38
  • @CoderMike Hi that was it the serial console was on turned it off and all working now. Thank you! – rohtua Jul 3 at 10:24

cgps and gpsd are reading at 4800 bauds per default. Your gps is sending at 9600bauds. So you'll need to tell one or the other which speed you use. When you use a

sudo cat [...]

you set console to auto-baud to show GPS sentences. So first, force 9600 bauds on the serial with

sudo stty -F /dev/ttyAMA0 speed 9600

(see https://www.raspberrypi.org/documentation/configuration/uart.md for serial uart names convention)

then configure gpsd for same speed.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.