4

I have tried to complete this project from Raspberry Pi GPS Module Interfacing Tutorial, where I used a NEO-6M GPS module in my Raspberry pi 3 B+. After setting up everything, when I write sudo cat /dev/ttyAMA0 in a terminal to test the device output, I get some garbage message instead of my location. The output is:

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

...........................
...........................

$GPRMC,,V,,,,,,,,,,N*53

$GPVTG,,,,,,,,,N*30

$GPGGA,,,,,,0,00,99.99,,,,,,*48

$GPGSA,A,1,,,,,,,,,,,,,99.99,99.99,99.99*30

$GPGSV,1,1,00*79

$GPGLL,,,,,,V,N*64

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

.......................

I used minicom and also get the same garbage.

Entering cgps -s after setting gpsd.scok also result in a timeout.

I have tried two GPS modulea, they all show the same output.

What is the possible thing that results in such error?

2
  • 1
    My first suspect would be the serial port configuration on the Pi. forum.u-blox.com/index.php/1031/gptxt-nmea-unknown-msg-meaning seems to agree
    – Dirk
    Sep 8, 2018 at 10:13
  • Did you also run the command: sudo minicom -D/dev/ttyAMA0 -b9600 ? Also, did you ask your question of the author of the tutorial you followed (at the bottom of the page containing the tutorial)?
    – Seamus
    Sep 8, 2018 at 16:37

3 Answers 3

3

The output you see from your GPS module is perfectly normal. What the NMEA messages tell you is that your GPS module does not (yet) have a fix, i.e. it does not have enough information to calculate its current position (+other information).

You can read up on the detailed format of the messages from the NMEA protocol: link 1, link 2. Whenever you see several commas in a row it means that the information that you expect between the commas is not available at the moment in your GPS module.

What can be the root cause for the missing GPS fix?

  1. Your hardware + antenna does not work properly
  2. You are indoors and the GPS signal from the satelites is not strong enough
  3. You have just started using this module fresh from the factory and it needs some time to get ahold of its coordinates. The time to first fix for such a brand new device can be up to 15 minutes.

My advice:

  1. Make sure that at your location, the GPS signal from the satelites is strong enough. Ideally by moving outdoors.
  2. Give your module some time. Wait for up to 20 minutes, before going to step 3.
  3. Only if the first two did not help, you might need to check your hardware (+antenna).

By the way, the $GPTXT,01,01,01,NMEA unknown msg*58 messages you see are no problem for your modules' ability to provide accurate position data. Either you ignore them, or you remove them by the method proposed in the link posted in the comment by @Dirk to your question.

3

What worked for me was stty -F /dev/ttyS0 -echo. Add it to your /etc/rc.local file so it applies on boot. Basically, the pi was echoing the message it was getting from the GPS back to it, and the GPS receiver understood it as input and couldn't understand it.

Edit: While you can add it to your /etc/rc.local file, this isn't the best way to run something on startup. You can take this file, and save it in /etc/systemd/system/no-serial-echo.service

[Unit]
Description=Disable serial echo
DefaultDependencies=no
Before=basic.target
After=sysinit.target

[Service]
Type=oneshot
ExecStart=/bin/stty -F /dev/ttyS0 -echo

[Install]
WantedBy=basic.target

After that, run sudo systemctl enable no-serial-echo. This will disable serial echoing fairly early in the boot-up process. You can always run sudo systemctl disable no-serial-echo to re-enable serial echoing on boot again.

5
  • Please take note that using /etc/rc.local has limitations due to Compatibility with SysV. We have seen many problems here on this site using it. Following the recommendation of the developers from systemd you should avoid using it.
    – Ingo
    Oct 6, 2019 at 19:32
  • @Ingo for a one-liner shell command, it's simply way easier to add it to rc.local rather than creating an entire new systemd oneshot service for it. But yes, the proper thing to do would be to create a new systemd.service with Type=oneshot and ExecStart=/bin/stty -F /dev/ttyS0 -echo Oct 6, 2019 at 20:13
  • 1
    Also one-liner doesn't work. And I think it is a bad thing that Raspbian still provide this unsupported feature. Debian doesn't have it for a long time.
    – Ingo
    Oct 6, 2019 at 20:24
  • @Ingo I don't think it's necessarily a bad thing if the goal is to make something that "just works", but for the sake of completeness and to encourage people to do things the right way, I've added the systemd service I use in my setup. Oct 6, 2019 at 20:38
  • +1 for systemd, but rc.local is bad. Please read the last sentence from Compatibility with SysV: "Note that there are some areas where systemd currently provides a certain amount of compatibility where we expect this compatibility to be removed eventually." This was written over one year ago.
    – Ingo
    Oct 6, 2019 at 20:46
0

I was getting the $GPTXT,01,01,01,NMEA unknown msg*58 message 80% of the time on an ESP8266 SoftwareSerial connection.

I found this neat solution, Then wondered if leaving the RX unconnected might be causing confusion to the NEO-7m

Connecting the RX calmed everything down and the "unknown message" message stopped.

Your Answer

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

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