0

Hi guys i'm quite new to raspberry pi and i'm having trouble with a GPS module that i have bought. https://wiki.52pi.com/index.php/USB-Port-GPS_Module_SKU:EZ-0048#Trouble_Shooting i go to installing all the packages required for the module and begin to testing the to see if it picks up a latitude/longitude and this is what occurs.

enter image description here

when i check the status of the module it seems to be fine showing the following:

enter image description here However lastly when i check the serial to see if it is receiving any data this occurs

enter image description here i have been at this for hours and i'm not sure if the module itself is the problem or its me. If anyone can help that would be great

  • Do you have it connected via serial port, or via USB? – Seamus Jun 2 at 7:20
  • 1
    Thanks for the advice, i received a long antenna device today and have i might hook it up tomorrow when its a clear day, ill have a look at your thread as well, for the price the module i bought is "garbo" – Antos Jun 2 at 7:47
  • 1
    Please don't post pictures of text. Instead paste the text direct into the question. – Ingo Jun 2 at 10:34
  • 1
    @tlfon01 yeah thanks for all the help i'm going to read and go through what you initially sent now, and i'm going to give another go outside today, ill find somewhere out in the open and give it a go. ill keep you updated, ill be working on this thing the entire day today – Antos Jun 3 at 1:15
  • 1
    @tlflon, yes i finally got a fix with another hour or so playing around. i did some extra research and apparently GPS modules do not work well with tin and tin roofing. since that being everyones roof in my area, after some walking around outside i finally got a fix, not completely ideal but at-least i now know it works. Thanks so much for all the resources they truly helped. Have a good day! – Antos Jun 3 at 2:06
-1

Question

  1. The OP is quite new to Rpi.

  2. He has a common GPS module QueCtel L80-R

  3. He has GPSD loaded and listening at the GPSD socket.

  4. He has two problems:

    a. "$ cgps" does not show any GPS data.

    b. "$ cat /dev/ttyUSB0" does not show any serial transmission signals either.

How to fix it?


l80-r 2


/ to continue, ...


Answer

Update 2020jun17hkt2143

I have found the following gps-python sample code for Rpi4 and uBlox GPS module

python-gps sample codes, Raspberry Pi 4 + uBlox GPS module (uart)

Now I am going to test the sample code using bot uBlox Neo M7 and M8 modules.


Update 2020jun15hkt1231

I found the user guide the OP is following is some 4 years old (2016), so should be a bit out of date (For example, the UART CP2012 driver recommended might not be good any more, as last year I tested CH340 is much better, and old 2012 drivers for Win7 are no longer working for new Win10 version).

I also suspected that new GPS modules on sale in these two years should have a better performance than old versions. So I bought two more GPS modules Neo M7 and M8 to compare. To my surprise, the fixing times of the 3 GPS modules do not have any substantial difference. So I concluded that the OP's Quectel L80-R GPS should still be up to date and work OK, at least for hobbyist projects like mine.


gps tests 1



Short Answer

I would suggest the OP to do the following testing/troubleshooting procedures:

  1. Install the three most basic GPS programs: gpsd, gpsd-client, python-gps, all three programs must be of same version 3.17-7. See Appendix D for more details.

  2. Enable/start/status GPSD, to make sure the software has been installed properly. In case there are installation errors, it is important to remove old installations, or use a fresh SD image to try again. It is easier to do the installation using Desktop GUI. I have tried with Rpi3B+ and Rpi4B, both with raspbian buster. See Part C below for more details.

/ to continue, ...


Long Answer

Contents

  1. Part A - Setting up the module and trying a get a fix

  2. Part B - Checking out serial hardware /dev/ttyS0 and /dev/ttyUSB0

  3. Part C - Installing GPSD and testing utilities gpsmon, cgps, and xgps

  4. Part D - Installing GPS Python library and testing python NMEA 0183 programs

  5. Part E - Discussion and recommendation

  6. References

  7. Appendices

  8. Program Listings

  9. Figures


Part A - Setting up the GPS module and trying to get a fix

First thing first is to set up the GPS module and try to get a fix (Figures 1 ~ 3).

I placed the antenna about 15cm outside the window and powered up. As usual, the first fix takes about 1 to 2 minutes. The subsequent power off power on fixes takes from 15 sec to 45 sec, with an average of 30 seconds. This fixing timing is similar to last time of 2019may. So I quickly concluded that setup and fixing is reliable.

This is the imgur fixing video.


And the photo.

Notes:

  1. When power is on, blue LED is turned on and steady. When there is a fix, blue LED blinks as shown in the above Imgur video.

  2. The serial cable is not connected in this fixing test. Serial cable test is the next step.

gps antenna


Part B - Checking out the serial cable

I used my serial loopback program v0.99 (Ref 12) to verify that Rpi's on board Tx/Rx wiring and software are more or less OK.

Next step is to install GPSD.


Part C - Installing GPSD

I quickly read the Quectel L80RE GPS Module User Guide and follow the instructions there to install the following:

gpsd, gpsd-clients, and python-gps,

and starting running it. Everything was smooth, except a couple of errors during installation. I could enable, start, status without any problem but cgps does not seem to run properly, such as indicating no fix, though there are actually a fix.

gpsd install


The above installations using CLI terminal commands $sudo apt-get install were not smooth, with a couple of error messages. So I used buster Desktop GUI and installed the similar gpsd and client packages v3.17-7 as shown below:


gpsd and clients installation


setup1


setup2


setup3


setup4


setup5


Part D - Installin GPS Python library and testing python demo programs

(15) Quectel GPS Module User Guide Reading Summary V0.3 (Python Demo Programs)

/ to continue, ...


References

(1) Quectel L80-R GPS Module User Guide

(2) Quectel L80-R Hardware Design GPS Module Series Rev. L80-R_Hardware_Design_V1.2 Date: 2016

(3) Quectel L80-R Compact GPS Module Integrated with Patch Antenna - 2015

(4) Quectel L80-R Compact GPS module integrated with Patch antenna for Acquisition and tracking - DIYMall US$14

(5) Quectel GPS Module User Guide Reading Summary V0.1

(6) Quectel GPS Module User Guide Reading Summary V0.2

(7) Quectel GPS Module User Guide Reading Summary V0.3 (Python Demo Programs)

(8) SkyTraq ATK1218-BD (ATK-S1216) GPS/BD dual mode GPS module - Risym ¥98

(9) SkyTraq GPS + Beidou Two-mode positioning module - US$24

(10) SkyTraq Products - SkyTraq

(11) SkyTraq S1216 [renamed S1218-BD] Family GNSS Module Data Sheet - SkyTraq

(12) Serial Port Loopback Test Program V0.60 - tlfong01 2019apr15 Ask Question

(13) Serial LoopBack Program v0.98 -tlfong01 2020jan08

(14) Serial Port Multiple Problem

(15) Serial UART LoopBack Program v0.99 tlfong01 2020jun03hkt1510

(16) Rpi3 Old Driver Serail Cable Test Results - HL340, PL2302, CP2102 might not work)

(17) Raspberry Pi Serial (UART) Tutorial - Roland Pelayo 2018jun12

(18) NMEA 0183 - Wikipedia

(19) NMEA User Guide

(20) gpsd_json — gpsd request/response protocol

(21) gpsd(8) manual pages

(22) libgps(3) manual pages

(23) gspmon manual pages - ubuntu

(24) gpsmon forum discussion - rpi.org.forum

(25) BerryGPS Tutorial Setup Guide

(26) MakerPro Daniel Hertz Tutorial: How to Use a GPS Receiver With Rpi 4 - 2020feb03

(27) MakerPro Daniel Hertz Tutorial: How to read GPS data with Python on Rpi - Daniel Hertz, MakerPro 2020feb24

(28) How can Rpi connect a GPS module? Rpi.StackExchange Q&A - tlfong01 2019

(28) Fixing: GPS TTFF/TTSF (Time To First Fix, Time To Subsequent Fix) - Wikipedia

(29) Fixing: Weather - Can an overcast sky prevent your GPS from working? - Quora

(30) Fixing: Weather - Does heavy cloud cover affect GPS reception? - Rich Owings 2005sep10

(31) GPS vs GNSS: Understanding PNT Satellite Systems - Masterclock 2019jan14

(32) AliExpress Neo6M GPS Module Catalog

(33) TaoBao NEO-6M APM2 GPS Module ¥14

(34) The 10 Best Diy Gps Module of 2020 (Beginners Guide) Josie Schinner 2019sep09

(35) The 8 Best Arduino GPS Modules 2019 - 2019Sep

(36) python-gps sample codes, Raspberry Pi 4 + u-blox GPS module (uart)

(37) Getting GPS to work on Rpi3B - dragino.com

(38) NEO-6M GPS u-blox Datasheet and Protocol Specification - ublox 2013apr18

(39) NEO-6M GPS ESP32 How to boost receiving speed - Victor, Medium 2020jan12

(40) Neo-6M GPS Arduino How to boost receiver speed - 2017apr14

(41) Neo-6/7/8 Interface Manuals

(42) NEO-6 u-blox 6 GPS Modules Data Sheet - ublox

(43) NEO-6M Product Sheet and References - WaveShare

(44) NEO-6M User Manual - WaveShare

/ to continue, ...


Appendices

Appendix A - GPS Module Pinout and Block Diagram

gps module pinout


Appendix B - NMEA 0183 Message Format

nmea0183msg 1


Appendix C GPSD Commands Summary V0.1

Serial Commands

$ dmesg | grep tty [ 0.001609] console [tty1] enabled [ 0.092061] 3f201000.uart: ttyAMA0 at MMIO 0x3f201000 (irq = 87, base_baud = 0) is a PL011 rev2 [ 0.594855] console [ttyAMA0] enabled

ttyS0 = Serial for Raspberry Pi 3, ttyAMA0 = Serial for all other Raspberry Pi 'serial0' is assigned as an alias to either of the above devices. This makes the device a lot easier to remember.

pi@raspberrypi ~ $ ls -l /dev/serial0 lrwxrwxrwx 1 root root 5 Aug 28 12:49 /dev/serial0 -> ttyS0

Install gpsd

$ sudo apt-get update $ sudo apt-get upgrade $ sudo reboot $ sudo apt-get install gpsd-clients gpsd -y $ usdo apt-get install gpsmon

To enable/start/stop/disable/kill gpsd

$ sudo systemctl enable gpsd.socket $ sudo systemctl start gpsd.socket $ sudo systemctl stop gpsd.socket $ sudo systemctl disable gpsd.socket $ sudo killall gpsd

Gpsd config file

$ sudo nano /etc/default/gpsd Look for DEVICES="" and change it to DEVICES="/dev/serial0"

3 Ways To read GPS data

1. cat $ cat /dev/serial0

2. minicom

$ sudo apt-get install minicom -y $ minicom -b 9600 -o -D /dev/serial0

3. Screen

$ sudo apt-get install screen $ screen /dev/serial0 9600

To view GPS data with gpsmon or cgps, if gpsd not aut started at boot

$ sudo gpsd /dev/serial0 -F /var/run/gpsd.sock $ sudo gpsmon $ sudo cgps $ sudo xcgs

To profile on a GPS. A gnuplot scatter graph of 100 samples

$ gpsprof | gnuplot -persist

A summary of some NMEA sentences

$GPVTG Vector track and Speed over the Ground

$GPGGA GGA - essential fix data which provide 3D location and accuracy data.

$GPGLL GLL - Geographic Latitude and Longitude

$GPGSA GSA - details on the nature of the fix

$GPGSV Detailed satelite data

$GPRMC RMC - The recommended minimum


Appendix D - Installing and setting up GPSD on buster release 2020may23

Installing GPSD on buster release 2020may23


/ to continue, ...


Program Listings

(A) Serial Lookback Test v0.6 - 2019apr08 tlfong01

# uart_test06 tlfong01 2019apr08hkt1603 ***
# https://raspberrypi.stackexchange.com/questions/96534/rpi-python-serial-test-program/96535#96535

# uart_test06 tlfong01 2019apr08hkt1603 ***

# Computer = Rpi3B+
# Linux    = $ hostnamectl = raspberrypi Raspbian GNU/Linux 9 (stretch) Linux 4.14.34-v7+ arm 
# Python   = >>> sys.version = 3.5.3 Jan 19 2017

# Test 1   - repeatWriteBytes() - UART port repeatedly send out bytes.  
# Function - Repeat many times sending bytes, pause after each bytes.

# Test 2   - loopBackTest() - UART port send and receive bytes.
# Function - Send one bytes to TX, wait some time (Note 1), then read bytes back from RX. 
# Setup    - Connet Tx pin to Rx pin to form a loop.

# Note 1
# Bolutek BlueTooth BC04 needs at least 10mS to respond

from   time import sleep
import serial

serialPort0 = serial.Serial(port = '/dev/serial0',
        baudrate = 9600,
        parity = serial.PARITY_NONE,
        stopbits = serial.STOPBITS_ONE,
        bytesize = serial.EIGHTBITS,
        timeout= 1)

def setSerialPortBaudRate(serialPort, baudrate):
    serialPort.baudrate = baudrate
    return

def serialPortWriteBytes(serialPort, writeBytes):
    serialPort.write(writeBytes)
    return

def serialPortReadBytes(serialPort, maxBytesLength):
    readBytes = serialPort.read(maxBytesLength)
    return readBytes

def serialPortWriteWaitReadBytes(serialPort, writeBytes, maxBytesLength, waitTime):
    serialPort.flushInput()
    serialPort.flushOutput()
    serialPort.write(writeBytes)
    sleep(waitTime) 
    readBytes = serialPortReadBytes(serialPort, maxBytesLength)
    print('        bytes written = ', writeBytes) 
    print('        bytes read    = ', readBytes)
    return readBytes

def repeatWriteBytes(serialPort, writeBytes, pauseTimeBetweenBytes, repeatCount):
    print('       Begin repeatWriteOneByte(), ...')   
    for i in range(repeatCount):
        serialPortWriteBytes(serialPort, writeBytes)                
        sleep(pauseTimeBetweenBytes)
    print('       End   repeatWriteOneByte().')
    return

def serialPortLoopBack(serialPort, writeBytes, maxBytesLength, waitTime): 
    print('        Begin serialPortLoopBack() [Remember to connect Tx to Rx!] , ...')
    serialPortWriteWaitReadBytes(serialPort, writeBytes, maxBytesLength, waitTime)     
    print('        End   serialPortLoopBack(), ...')
    return

setSerialPortBaudRate(serialPort0, 9600)
#repeatWriteBytes(serialPort0, b'AT\r\n', 0.01, 200000000)
serialPortLoopBack(serialPort0, b'AT\r\n', 32, 0.030)

''' Sample output  tlfong01 2019apr0801
>>> 
=== RESTART: /home/pi/Python_Programs/test1193/uart_test02_2019apr0801.py ===
        Begin serialPortLoopBack() [Remember to connect Tx to Rx!] , ...
        bytes written =  b'AT\r\n'
        bytes read    =  b'AT\r\n'
        End   serialPortLoopBack(), ...
>>>
'''

# End

/ to continue, ...


Figures

Fig 1 - GPS Module Setup 1

gps setup 2


Fig 2 - GPS Module Setup 2

gps setup 3


Fig 3 - GPS Module Setup 3

gps setup 4


Fig 4 - GPS Testing Site

gps test site


| improve this answer | |
1

cat /dev/ttyUSB0 will only work if the baud rate is set correctly on both sides of the UART which may or may not be the case. Check the documentation for your module to see if there are any instructions regarding the baud rate settings.

Also, cheap GPS modules are not going to give you any meaningful data until they acquire a fix, and must be tested outside. Do a test outdoors, preferably with a laptop, and wait for at least 12.5 minutes before trying to communicate with the module.

| 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.