Chirpstack not syncing time&date with GPS

Hi!

I have a SX1302 LoRaWAN Gateway HAT mounted on a Raspberry Pi 3.
I can’t get the Chirpstack to sync date and time with the GPS. I have to manually click the “Sync with browser” button on the web interface every time I power up th RPi.

The GPS data is ok on /dev/ttyAMA0 but somehow Chirpstack is not reading it (or maybe something else).

$GNGGA,181105.000,4544.17000,S,06817.34548,W,1,10,2.6,481.0,M,14.7,M,,*4A
$GNGLL,4544.17000,S,06817.34548,W,181105.000,A,A*45
$GNGSA,A,3,04,09,11,16,20,26,,,,,,,3.3,2.6,2.0,1*3B
$GNGSA,A,3,74,73,65,72,,,,,,,,,3.3,2.6,2.0,2*35
$GPGSV,3,1,11,03,29,056,,04,49,118,34,06,49,278,,07,37,345,,0*6D
$GPGSV,3,2,11,09,77,229,21,11,31,234,29,16,18,101,17,20,10,231,22,0*60
$GPGSV,3,3,11,26,15,132,24,30,08,332,,31,,,14,0*6D
$GLGSV,3,1,10,74,43,109,25,66,09,257,,73,17,152,21,75,30,037,,0*7A
$GLGSV,3,2,10,65,53,225,20,88,35,279,,87,11,331,,81,25,217,,0*75
$GLGSV,3,3,10,71,06,092,,72,48,117,26,0*79
$GNRMC,181105.000,A,4544.17000,S,06817.34548,W,0.00,349.41,130324,,,A,V*04
$GNVTG,349.41,T,,M,0.00,N,0.00,K,A*28
$GNZDA,181105.000,13,03,2024,00,00*41
$GPTXT,01,01,01,ANTENNA OK*35

I didn’t make custom configs. I installed the full SD card factory image. I noticed there isn’t an package manager to install new tools, compile code, etc.

How could I fix this?

Thanks.

Enabling bluetooth by commenting the line dtoverlay=disable-bt sets the port for the GPS antenna to /dev/ttyS0.

But Chirpstack is still not reading it …

When I run /opt/libloragw-sx1301/utils/test_loragw_gps I get the following error:

GPS on /dev/ttyAMA0
~~ UBX NAV-TIMEGPS sentence, triggering synchronization attempt ~~
    Failed to read timestamp, synchronization impossible.

GPS on /dev/ttyS0
No output.

I can’t find the same test utility for sx1302 so I assume it’s the same.
Also, I can’t find anything related to gps or gnss module through logread command.

The GNSS module is enabled through the web interface. And I can see it in the /etc/config/chirpstack-concentratord config file:

config global
        option chipset 'sx1302'

config sx1301
        option model 'imst_ic880a'
        option region 'EU868'
        option channel_plan 'eu868'
        option gateway_id 'b827ebfffeebe18a'
        option antenna_gain '2'

config sx1302
        option model 'waveshare_sx1302_lorawan_gateway_hat'
        option region 'AU915'
        option channel_plan 'au915_0'
        option antenna_gain '0'
        option gnss '1'

config 2g4
        option model 'semtech_sx1280z3dsfgw1'
        option region 'ISM2400'
        option channel_plan 'ism2400'
        option antenna_gain '2'

What if this port is not generated ??? How to debug …

Thu Mar 21 17:57:52 2024 user.info chirpstack-concentratord-sx1302[7393]: Enabling GPS device, tty_path: /dev/ttyAMA0
Thu Mar 21 17:57:52 2024 user.info chirpstack-concentratord-sx1302[7393]: Starting GPS validation loop
Thu Mar 21 17:57:53 2024 user.warn chirpstack-concentratord-sx1302[7393]: GPS time reference is not valid, age: 1711024073.534612527s


~# ls /dev/ttyA*
/dev/ttyACM0

??

Are you sure that your shield has an uBlox GNSS module? This is the only one that is supported by the Semtech HAL because it uses some proprietary commands when communicating with the GNSS module. This might explain that the /opt/libloragw-sx1301/utils/test_loragw_gps fails to sync as well.

yes shield has an uBlox GNSS module

You could always use cat to read the NMEA output, e.g.

root@chirpstack-3b780a:~# cat /dev/ttyAMA0
b ii	v$GNRMC,082606.00,A,3716.56822,N,00848.33203,W,0.157,,110424,,,A*7A
$GNVTG,,T,,M,0.157,N,0.291,K,A*34
$GNGGA,082606.00,3716.56822,N,00848.33203,W,1,12,0.83,90.0,M,47.3,M,,*66
$GNGSA,A,3,29,28,32,24,12,11,25,,,,,,1.55,0.83,1.31*17
$GNGSA,A,3,75,76,67,85,86,87,,,,,,,1.55,0.83,1.31*1B
$GPGSV,3,1,10,06,00,028,,11,15,059,24,12,34,057,25,24,14,128,19*79
$GPGSV,3,2,10,25,62,032,25,26,08,269,,28,46,315,30,29,67,172,29*74
$GPGSV,3,3,10,31,17,309,23,32,49,243,31*7C
$GLGSV,3,1,09,66,24,227,,67,32,287,28,68,11,333,,75,08,086,19*69
$GLGSV,3,2,09,76,50,039,33,77,44,323,,85,19,031,25,86,45,086,23*61
$GLGSV,3,3,09,87,29,152,23*5F
$GNGLL,3716.56822,N,00848.33203,W,082606.00,A,A*62
b hi	$GNRMC,082607.00,A,3716.56821,N,00848.33201,W,0.109,,110424,,,A*71
$GNVTG,,T,,M,0.109,N,0.201,K,A*36
$GNGGA,082607.00,3716.56821,N,00848.33201,W,1,12,0.83,89.7,M,47.3,M,,*69
$GNGSA,A,3,29,28,32,24,12,11,25,,,,,,1.55,0.83,1.31*17
$GNGSA,A,3,75,76,67,85,86,87,,,^C

Hi! Sorry for the late response.

I was able to read the NMEA output by doing cat /dev/ttyAMA0 (output on the main post) so I supose there is nothing wrong with the hardware itself.

I have no way to check if the GNSS module it’s from U-Blox since it’s not in my possession. But if I was able to read the ttyAMA0 port through the RPi3 Chirpstack OS, wouldn’t this imply that the module is ok? Or I’m missing something here?

I could make some remote tests on the module or eventually a full re-install of Chiprstack if needed.

What could I try next?

Thanks for the response , I got it … But what if there is no such port like /dev/ttyAMA0