[howto] GL-X3000 GPS configuration guide

Hi all

to answer my question I dug deeper in troubleshooting GPS on OpenWRT. Perhaps you may be interested.
For troubleshooting GPS related stuff in Linux you'd like to opkg install gpsd-clients.

NMEA sentences from serial device

The easiest way is to
cat /dev/mhi_LOOPBACK
and you'll see NMEA messages like

$GPGSV,1,1,0,1*54
$GPGGA,121825.25,,,,,0,,,,,,,,*42
$PQXFI,121825.2,,,,,,,,*6B
$GPVTG,,T,,M,,N,,K,N*2C
$GPRMC,,V,,,,,,,,,,N,V*29

send the AT+QGPS=1 and AT+QGPSEND commands to your modem and watch the messages starting and stopping.

readable by gpsd

To interpret those messages with a "gpsd view", use gpsdecode:

cat /dev/mhi_LOOPBACK | gpsdecode
{"class":"TPV","device":"stdin","mode":1}
{"class":"TPV","device":"stdin","mode":1}
{"class":"TPV","device":"stdin","mode":1}

We expect some TPV entries, which tell the ground-based things like location, speed, etc.
and some SKY values, which tell about the satellites, how many seen, how many used, which ones, etc.

{"class":"TPV","device":"stdin","mode":1}
{"class":"SKY","device":"stdin","nSat":1,"uSat":0,"satellites":[{"PRN":31,"el":21.0,"az":92.0,"ss":16.0,"used":false,"gnssid":0,"svid":31}]}
{"class":"TPV","device":"stdin","mode":1}
{"class":"TPV","device":"stdin","mode":1}
{"class":"SKY","device":"stdin","nSat":1,"uSat":0,"satellites":[{"PRN":31,"el":21.0,"az":92.0,"ss":16.0,"used":false,"gnssid":0,"svid":31}]}

but currently, only one satellite is seen (nSat:1) and none is used (uSat:0).
ok, waiting for more satellites to be seen.

running gpsd

Next configure /etc/config/gpsd
you might logread -e gpsd -f & while starting the service.
check if gpsd is running and listening on port 2947:

root@router:~$ netstat -anp | grep gpsd
tcp        0      0 0.0.0.0:2947            0.0.0.0:*               LISTEN      28724/gpsd
tcp        0      0 :::2947                 :::*                    LISTEN      28724/gpsd

now you can use

gpspipe --json

to see the above output.
or better: use

cgps

to get the same messages, plus two boxes:
the right one with the satellites ("SKY" messages) and
the left one with the ground-based params ("TPV" messages).

watch satellites appear

┌───────────────────────────────────────────┐┌──────────────────Seen  4/Used  0┐
│ Time           n/a (0)                    ││GNSS   PRN  Elev   Azim   SNR Use│
│ Latitude         n/a                      ││GP  8    8  28.0  103.0  24.0  N │
│ Longitude        n/a                      ││GP  9    9  30.0  171.0  22.0  N │
│ Alt (HAE, MSL)         n/a,       n/a     ││GP  2    2  83.0  267.0  18.0  N │
│ Speed            n/a                      ││GP 12   12   2.0   80.0  22.0  N │
│ Track (true, var):                n/a deg ││                                 │
│ Climb            n/a                      ││                                 │
│ Status          NO FIX (6 secs)           ││                                 │
[...]

While waiting for more satellites to be seen, I checked this website, entered my location (on the right side), selected only navigational satellites (gps, galileo, glonass and beidou, down below the radar view) and selected brightness limit to "all illuminated" (left side above the radar), to get an estimate which satellites my router possibly could see.

When placing the router in the open window of my house, overseeing half of the sky (the next big mountains are 100km away), the cgps is telling me about 3 satellites seen and two of them are used. And after a while I got a fix:

┌───────────────────────────────────────────┐┌──────────────────Seen  3/Used  2┐
│ Time         2024-07-22T19:12:39.000Z (0) ││GNSS   PRN  Elev   Azim   SNR Use│
│ Latitude          -46.7635408 N           ││GP  8    8  26.0  105.0  28.0  Y │
│ Longitude       -140.19284582 E           ││GP  9    9  85.0  287.0  21.0  Y │
│ Alt (HAE, MSL)      59.383,      1.575 ft ││GP 12   12  33.0  170.0  23.0  N │
│ Speed              0.00 mph               ││                                 │
│ Track (true, var):                n/a deg ││                                 │
│ Climb            137.80 ft/min            ││                                 │
│ Status          3D FIX (1 secs)           ││                                 │
                  ^^^^^^

and yes, it can take a while to get a fix.

testing with external usb gps receiver

Beside the internal /dev/mhi_LOOPBACK i testet an external usb gps receiver on my PuliAX.

When attaching my usb gps device, I check the
dmesg | grep attached | grep ttyUSB | tail -n 1
to figure out the right device to add to /etc/config/gpsd.

btw. my usb device needs a baudrate of 57600,
how can I configure this into /etc/config/gpsd ?

same procedure as above, my external GPS device found some more satellites:

┌───────────────────────────────────────────┐┌──────────────────Seen  8/Used  8┐
│ Time         2024-07-22T19:35:51.000Z (0) ││GNSS   PRN  Elev   Azim   SNR Use│
│ Latitude         -46.76345408 N           ││GP  8    8  21.0  109.0  26.0  Y │
│ Longitude       -140.19284582 E           ││GP  9    9  21.0  109.0  15.0  Y │
│ Alt (HAE, MSL)     59.383,       1.575 ft ││GP 12   12  40.0  169.0  27.0  Y │
│ Speed              0.92 mph               ││GP 18   18   7.0   73.0  22.0  Y │
│ Track (true, var):   135.3,   2.2     deg ││GL  8   68  31.0   61.0  23.0  Y │
│ Climb              0.00 ft/min            ││GL 32  320   7.0  189.0  13.0  Y │
│ Status          3D FIX (159 secs)         ││BD 26  426  29.0   65.0  19.0  Y │
│ Long Err  (XDOP, EPX)   1.57, +/- 77.5 ft ││BD 12  312  34.0   23.0  13.0  Y |                               │

conclusion

so... back to my original question... I guess, I just had poor reception of the gps satellites (in combination sitting inside my house and with the builtin gps capabilities) and was too impatient to wait "for ages" for an gps fix.

cheers
Frank

1 Like

Hi,
thanks for your hints.
one point i am missing:

"next configure /etc/config/gpsd"

cat /dev/ttyUSB[0123] doesnt give me any gps-output.
cat /mhi_LOOPBACK does give me some output

my /etc/config/gpsd now contains:

cat /etc/config/gpsd
config gpsd 'core'
option enabled '1'
option device '/dev/mhi_LOOPBACK'
option port '2947'
option listen_globally '1'

Is this correct or am i missing some parameters?

Thank you,
Stephan

That's all I did and I get the correct coordinates out of cgps, only thing I found confusing is gpsd isn't in the clients package, I had to opkg install gspd.

That being said I only see 6 satellites, seems low, I'm in north Austin and clear line of site today.

I'm using a Peplink MAX antenna that has a dedicated GPS SMA connection which I am not using, I wonder if it's worth it to include a USB to GPS dongle to connect to that...

RM520N-GL has ANT1 for GNSS L5 and ANT3 for GNSS L1, how is this mapped to the SMA ports on X3000? I guss DIV / GNSS is ANT3, which SMA port is for GNSS L5?

btw is the PCB diagram GL-X3000(Spitz AX) disassembling/board diagram/UART pins - #6 by dohseven here correct? only 3 antenna leads shown

Here are the details you requested:

  1. RM520N-GL has ANT1 for GNSS L5 and ANT3 for GNSS L1, how is this mapped to the SMA ports on X3000? I guss DIV / GNSS is ANT3, which SMA port is for GNS

The "DIV/GNSS" port is indeed ANT3. The correspondence between other antennas and ports is shown in the diagram below.

  1. btw is the PCB diagram GL-X3000(Spitz AX) disassembling/board diagram/UART pins - #6 by dohseven here correct? only 3 antenna leads shown

The WiFi uses 3 antennas in total: 2 external dual-band antennas (supporting 2.4GHz & 5GHz) and 1 internal 5GHz antenna.

Additionally, the following antenna models have been tested.

For X3000

RV Use:

OmniRoam-420: 6-in-1 Low-Profile Mobile Antenna (4G/5G & WiFi). https://www.waveform.com/products/omniroam-420

Mobilemark: Model: LTMWG942 (Black / White).

Home Use:

QuadMini: Low-Profile Omni 4x4 MIMO Antenna.
https://www.waveform.com/products/quadmini

QuadPro: High-Gain Directional 4x4 MIMO Antenna.
https://www.waveform.com/products/quadpro

For X2000

RV Use:

OmniRoam-220: 4-in-1 Low-Profile Mobile Antenna (4G/5G & WiFi). https://www.waveform.com/products/omniroam-220

Home Use:

DualMini: Low-Profile 2x2 MIMO Window Antenna.
https://www.waveform.com/products/dualmini

2x2 Panel Kit: MIMO 2x2 Panel External Antenna Kit for 4G LTE/5G Hotspots & Routers. https://www.waveform.com/products/2x2-mimo-panel-kit

Still waiting for the GPS application to be added in the menu….. no plans?

1 Like

Sorry, there are currently no plans about GPS.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.