RAK7243 could not get a valid message from GPS (no time)

Hello,

I just set-up a RAK7243.

Procedure:

nothing else
all defaults on Lora Gateway, packet forwarder, Lora Server and Lora App Server, no nodes connected

Problem:
tailing syslog I found multitudes of the message
Aug 27 15:53:07 rak-gateway ttn-gateway[580]: WARNING: [gps] could not get a valid message from GPS (no time)

and it keeps spamming the syslog at a warning rate, something that is not good for the sdcard and neither for parsing log files.

some times it logs (gps values obfuscated not actual xx)
Aug 27 15:52:27 rak-gateway ttn-gateway[580]: # GPS coordinates: latitude xx.xxxxx, longitude xx.xxxxx, altitude 82 m

Aug 27 15:52:57 rak-gateway ttn-gateway[580]: JSON up: {"stat":{"time":"2019-08-27 12:52:57 GMT","lati":xx.xxxxx,"long":xx.xxxxx,"alti":94,"rxnb":0,"rxok":0,"rxfw":0,"ackr":100.0,"dwnb":0,"txnb":0}}

continue with testing:

/opt/ttn-gateway/lora_gateway/libloragw/test_loragw/gps
outputs the same message

Beginning of test for loragw_gps.c
*** Library version information ***
Version: 5.0.1;
***
WARNING: [gps] could not get a valid message from GPS (no time)
WARNING: [gps] could not get a valid message from GPS (no time)
WARNING: [gps] could not get a valid message from GPS (no time)
WARNING: [gps] could not get a valid message from GPS (no time)
...

the same with:
/opt/ttn-gateway/packet_forwarder/lora_pkt_fwd/start.sh

Gateway_ID set to XXXXXXXXXXXXXXXX in file ./local_conf.json
*** Beacon Packet Forwarder for Lora Gateway ***
Version: 4.0.1
*** Lora concentrator HAL library version info ***
Version: 5.0.1;
***
INFO: Little endian host
INFO: found global configuration file global_conf.json, parsing it
INFO: global_conf.json does contain a JSON object named SX1301_conf, parsing SX1301 parameters
INFO: lorawan_public 1, clksrc 1
INFO: no configuration for LBT
INFO: antenna_gain 0 dBi
INFO: Configuring TX LUT with 16 indexes
INFO: radio 0 enabled (type SX1257), center frequency 867500000, RSSI offset -166.000000, tx enabled 1, tx_notch_freq 0
INFO: radio 1 enabled (type SX1257), center frequency 868500000, RSSI offset -166.000000, tx enabled 0, tx_notch_freq 0
INFO: Lora multi-SF channel 0>  radio 1, IF -400000 Hz, 125 kHz bw, SF 7 to 12
INFO: Lora multi-SF channel 1>  radio 1, IF -200000 Hz, 125 kHz bw, SF 7 to 12
INFO: Lora multi-SF channel 2>  radio 1, IF 0 Hz, 125 kHz bw, SF 7 to 12
INFO: Lora multi-SF channel 3>  radio 0, IF -400000 Hz, 125 kHz bw, SF 7 to 12
INFO: Lora multi-SF channel 4>  radio 0, IF -200000 Hz, 125 kHz bw, SF 7 to 12
INFO: Lora multi-SF channel 5>  radio 0, IF 0 Hz, 125 kHz bw, SF 7 to 12
INFO: Lora multi-SF channel 6>  radio 0, IF 200000 Hz, 125 kHz bw, SF 7 to 12
INFO: Lora multi-SF channel 7>  radio 0, IF 400000 Hz, 125 kHz bw, SF 7 to 12
INFO: Lora std channel> radio 1, IF -200000 Hz, 250000 Hz bw, SF 7
INFO: FSK channel> radio 1, IF 300000 Hz, 125000 Hz bw, 50000 bps datarate
INFO: global_conf.json does contain a JSON object named gateway_conf, parsing gateway parameters
INFO: gateway MAC address is configured to 0000000000000000
INFO: server hostname or IP address is configured to "127.0.0.1"
INFO: upstream port is configured to "1700"
INFO: downstream port is configured to "1700"
INFO: downstream keep-alive interval is configured to 10 seconds
INFO: statistics display interval is configured to 30 seconds
INFO: upstream PUSH_DATA time-out is configured to 100 ms
INFO: packets received with a valid CRC will be forwarded
INFO: packets received with a CRC error will NOT be forwarded
INFO: packets received with no CRC will NOT be forwarded
INFO: GPS serial port path is configured to "/dev/i2c-1"
INFO: Reference latitude is configured to 10.000000 deg
INFO: Reference longitude is configured to 20.000000 deg
INFO: Reference altitude is configured to -1 meters
INFO: fake GPS is disabled
INFO: Auto-quit after 6 non-acknowledged PULL_DATA
INFO: found local configuration file local_conf.json, parsing it
INFO: redefined parameters will overwrite global parameters
INFO: local_conf.json does not contain a JSON object named SX1301_conf
INFO: local_conf.json does contain a JSON object named gateway_conf, parsing gateway parameters
INFO: gateway MAC address is configured to XXXXXXXXXXXXXXXX
INFO: packets received with a valid CRC will be forwarded
INFO: packets received with a CRC error will NOT be forwarded
INFO: packets received with no CRC will NOT be forwarded
INFO: [main] TTY port /dev/i2c-1 open for GPS synchronization
INFO: [main] concentrator started, packet can now be received
INFO: [down] PULL_ACK received in 0 ms

INFO: Disabling GPS mode for concentrator's counter...
INFO: host/sx1301 time offset=(1566912200s:651487µs) - drift=756888287µs
INFO: Enabling GPS mode for concentrator's counter.

WARNING: [gps] could not get a valid message from GPS (no time)
WARNING: [gps] could not get a valid message from GPS (no time)
WARNING: [gps] could not get a valid message from GPS (no time)
WARNING: [gps] could not get a valid message from GPS (no time)
WARNING: [gps] could not get a valid message from GPS (no time)
WARNING: [gps] could not get a valid message from GPS (no time)
WARNING: [gps] could not get a valid message from GPS (no time)
WARNING: [gps] could not get a valid message from GPS (no time)
WARNING: [gps] could not get a valid message from GPS (no time)
WARNING: [gps] could not get a valid message from GPS (no time)
WARNING: [gps] could not get a valid message from GPS (no time)
WARNING: [gps] could not get a valid message from GPS (no time)
WARNING: [gps] could not get a valid message from GPS (no time)
WARNING: [gps] could not get a valid message from GPS (no time)
^C

On the LoraAppServer > Gateways > predefined gateway
the gateway has a valid location from the GPS module (?)

Solution:

1. tried

The only solution I found so far is to disable the GPS module connection in
/opt/ttn-gateway/packet_forwarder/lora_pkt_fwd/global_conf.json

by commenting out gps_tty_path (it only stops spamming the syslog by commenting out the gps tty path and not just gps: false)

...
        "gateway_conf": {
                "gateway_ID": "0000000000000000",
                /* change with default server address/ports, or overwrite in local_conf.json */
        "server_address": "127.0.0.1",
                "serv_port_up": 1700,
                "serv_port_down": 1700,
                /* adjust the following parameters for your network */
                "keepalive_interval": 10,
                "stat_interval": 30,
                "push_timeout_ms": 100,
                /* forward only valid packets */
                "forward_crc_valid": true,
                "forward_crc_error": false,
                "forward_crc_disabled": false,
                /* gps enable */
                "gps": false,
                // "gps_tty_path": "/dev/i2c-1",
                "fake_gps": false,
                "ref_latitude": 10,
                "ref_longitude": 20,
                "ref_altitude": -1,
                "autoquit_threshold": 6
        }
}

2. looking for

Is the warning messages in syslog something normal?
And if it is,
is there another way not disabling the gps and keeping the logs clean? (maybe, some configuration value for logging level)


thank you

pic-1
2019-08-20%2009%3A01%3A07


pic-2
2019-08-20%2009%3A00%3A50


Which rak7243 is the above two figures?pic-1 or pic-2?

If it is pic-1, you should download https://downloads.rakwireless.com/en/LoRa/Pilot-Gateway-Pro-RAK7243/Firmware/RAK7243_LTE_based_on_Raspbian_OS_V2.9.2_20190820.rar
If it is pic-2, you should download https://downloads.rakwireless.com/en/LoRa/Pilot-Gateway-Pro-RAK7243/Firmware/RAK7243_based_on_Raspbian_OS_V2.9.2_20190820.rar

pic-1, it is the version with LTE
4 antennas,
I have installed the correct firmware

The GPS antenna is placed indoors, but it is at the last floor of the building.
Even if that is the cause,
a. how does it set the correct coordinates?
b. why does periodically states coordinates and time and then spams the syslog with warnings?

I will try the module outside, but the main issue is how not to write hundreds of warnings into syslog.

I let (indoors) the
test_loragw_gps
run a little longer

Beginning of test for loragw_gps.c
*** Library version information ***
Version: 5.0.1;
***
WARNING: [gps] could not get a valid message from GPS (no time)
WARNING: [gps] could not get a valid message from GPS (no time)
WARNING: [gps] could not get a valid message from GPS (no time)
WARNING: [gps] could not get a valid message from GPS (no time)
WARNING: [gps] could not get a valid message from GPS (no time)
WARNING: [gps] could not get a valid message from GPS (no time)
WARNING: [gps] could not get a valid message from GPS (no time)
WARNING: [gps] could not get a valid message from GPS (no time)
WARNING: [gps] could not get a valid message from GPS (no time)

~~ UBX NAV-TIMEGPS sentence, triggering synchronization attempt ~~
    Synchronization error.
WARNING: [gps] could not get a valid message from GPS (no time)
WARNING: [gps] could not get a valid message from GPS (no time)
WARNING: [gps] could not get a valid message from GPS (no time)
WARNING: [gps] could not get a valid message from GPS (no time)
WARNING: [gps] could not get a valid message from GPS (no time)
WARNING: [gps] could not get a valid message from GPS (no time)
WARNING: [gps] could not get a valid message from GPS (no time)
WARNING: [gps] could not get a valid message from GPS (no time)
WARNING: [gps] could not get a valid message from GPS (no time)
WARNING: [gps] could not get a valid message from GPS (no time)

~~ UBX NAV-TIMEGPS sentence, triggering synchronization attempt ~~
    Synchronization error.

~~ UBX NAV-TIMEGPS sentence, triggering synchronization attempt ~~
    * Synchronization successful *
    UTC reference time: 1567001263.000000000
    GPS reference time: 1251036480.999656661
    Internal counter reference value: 8354525
    Clock error: 1.000000000
    * Test of timestamp counter <-> GPS value conversion *
    Test value: 8854525
    Conversion to GPS: 1251036481.499656661
    Converted back: 8854525 ==> 0µs
    * Test of timestamp counter <-> UTC value conversion *
    Test value: 8854525
    Conversion to UTC: 1567001263.500000000
    Converted back: 8854525 ==> 0µs
WARNING: [gps] could not get a valid message from GPS (no time)
WARNING: [gps] could not get a valid message from GPS (no time)
WARNING: [gps] could not get a valid message from GPS (no time)
WARNING: [gps] could not get a valid message from GPS (no time)
WARNING: [gps] could not get a valid message from GPS (no time)
WARNING: [gps] could not get a valid message from GPS (no time)
WARNING: [gps] could not get a valid message from GPS (no time)
WARNING: [gps] could not get a valid message from GPS (no time)
WARNING: [gps] could not get a valid message from GPS (no time)
WARNING: [gps] could not get a valid message from GPS (no time)
WARNING: [gps] could not get a valid message from GPS (no time)
WARNING: [gps] could not get a valid message from GPS (no time)
WARNING: [gps] could not get a valid message from GPS (no time)
WARNING: [gps] could not get a valid message from GPS (no time)
WARNING: [gps] could not get a valid message from GPS (no time)
WARNING: [gps] could not get a valid message from GPS (no time)
WARNING: [gps] could not get a valid message from GPS (no time)
WARNING: [gps] could not get a valid message from GPS (no time)
WARNING: [gps] could not get a valid message from GPS (no time)
WARNING: [gps] could not get a valid message from GPS (no time)
WARNING: [gps] could not get a valid message from GPS (no time)

~~ UBX NAV-TIMEGPS sentence, triggering synchronization attempt ~~
    * Synchronization successful *
    UTC reference time: 1567001265.000000000
    GPS reference time: 1251036483.999656841
    Internal counter reference value: 11354525
    Clock error: 1.000000000
    * Test of timestamp counter <-> GPS value conversion *
    Test value: 11854525
    Conversion to GPS: 1251036484.499656841
    Converted back: 11854525 ==> 0µs
    * Test of timestamp counter <-> UTC value conversion *
    Test value: 11854525
    Conversion to UTC: 1567001265.500000000
    Converted back: 11854525 ==> 0µs

~~ UBX NAV-TIMEGPS sentence, triggering synchronization attempt ~~
    * Synchronization successful *
    UTC reference time: 1567001265.000000000
    GPS reference time: 1251036484.999656901
    Internal counter reference value: 12354525
    Clock error: 1.000000000
    * Test of timestamp counter <-> GPS value conversion *
    Test value: 12854525
    Conversion to GPS: 1251036485.499656901
    Converted back: 12854525 ==> 0µs
    * Test of timestamp counter <-> UTC value conversion *
    Test value: 12854525
    Conversion to UTC: 1567001265.500000000
    Converted back: 12854525 ==> 0µs
WARNING: [gps] could not get a valid message from GPS (no time)
WARNING: [gps] could not get a valid message from GPS (no time)
WARNING: [gps] could not get a valid message from GPS (no time)
WARNING: [gps] could not get a valid message from GPS (no time)
WARNING: [gps] could not get a valid message from GPS (no time)
WARNING: [gps] could not get a valid message from GPS (no time)
WARNING: [gps] could not get a valid message from GPS (no time)
WARNING: [gps] could not get a valid message from GPS (no time)
WARNING: [gps] could not get a valid message from GPS (no time)
WARNING: [gps] could not get a valid message from GPS (no time)
WARNING: [gps] could not get a valid message from GPS (no time)
WARNING: [gps] could not get a valid message from GPS (no time)
WARNING: [gps] could not get a valid message from GPS (no time)
WARNING: [gps] could not get a valid message from GPS (no time)
WARNING: [gps] could not get a valid message from GPS (no time)
WARNING: [gps] could not get a valid message from GPS (no time)
WARNING: [gps] could not get a valid message from GPS (no time)
WARNING: [gps] could not get a valid message from GPS (no time)
WARNING: [gps] could not get a valid message from GPS (no time)
WARNING: [gps] could not get a valid message from GPS (no time)
WARNING: [gps] could not get a valid message from GPS (no time)
WARNING: [gps] could not get a valid message from GPS (no time)
WARNING: [gps] could not get a valid message from GPS (no time)
WARNING: [gps] could not get a valid message from GPS (no time)
WARNING: [gps] could not get a valid message from GPS (no time)
WARNING: [gps] could not get a valid message from GPS (no time)

~~ UBX NAV-TIMEGPS sentence, triggering synchronization attempt ~~
    * Synchronization successful *
    UTC reference time: 1567001269.000000000
    GPS reference time: 1251036487.999657080
    Internal counter reference value: 15354526
    Clock error: 1.000000000
    * Test of timestamp counter <-> GPS value conversion *
    Test value: 15854526
    Conversion to GPS: 1251036488.499657080
    Converted back: 15854526 ==> 0µs
    * Test of timestamp counter <-> UTC value conversion *
    Test value: 15854526
    Conversion to UTC: 1567001269.500000000
    Converted back: 15854526 ==> 0µs

~~ UBX NAV-TIMEGPS sentence, triggering synchronization attempt ~~
    * Synchronization successful *
    UTC reference time: 1567001269.000000000
    GPS reference time: 1251036488.999657139
    Internal counter reference value: 16354526
    Clock error: 1.000000000
    * Test of timestamp counter <-> GPS value conversion *
    Test value: 16854526
    Conversion to GPS: 1251036489.499657139
    Converted back: 16854526 ==> 0µs
    * Test of timestamp counter <-> UTC value conversion *
    Test value: 16854526
    Conversion to UTC: 1567001269.500000000
    Converted back: 16854526 ==> 0µs

~~ UBX NAV-TIMEGPS sentence, triggering synchronization attempt ~~
    * Synchronization successful *
    UTC reference time: 1567001269.000000000
    GPS reference time: 1251036489.999657199
    Internal counter reference value: 17354526
    Clock error: 1.000000000
    * Test of timestamp counter <-> GPS value conversion *
    Test value: 17854526
    Conversion to GPS: 1251036490.499657199
    Converted back: 17854526 ==> 0µs
    * Test of timestamp counter <-> UTC value conversion *
    Test value: 17854526
    Conversion to UTC: 1567001269.500000000
    Converted back: 17854526 ==> 0µs
^C
End of test for loragw_gps.c

It seems like syncing time successfully and then warning a lot for not valid messages (just like syslog)

I am seeing the same thing.
It would appear (as far as I can see) to indicate data coming from the GPS module is being corrupted sometimes.
I have been using the previous generation RAK833 without any issue, and have just moved to the RAK7243 as I wanted to add cellular backhaul.

The difference with the RAK7243 is that the GPS is connected via i2c now rather than a serial interface.
There are also some SPI modification done to the reference libloragw code on the installed image.
$ cd /opt/ttn-gateway/lora_gateway
$ git status
The two main source code changes are shown by doing a diff of these two files
$ git diff libloragw/src/loragw_gps.c
$ git diff libloragw/src/loragw_spi.native.c

It would seem they have had to slow down the SPI interface 4x from default to get the interface to the SX1301 to work, but looks like there may be issues with the i2c too.

I noticed that the configuration they pass to the Ublox gps module is different too. The NAV-TIMEGPS msg has modified the iTOW configuration. If I change this back to standard then I don’t get the error messages, but I also never get a proper gps lock.

If anyone has any fixes they have found then please respond

Thanks for chipping in with some useful insight. I began to think it’s happening only to me. I suspected that was something to do with the poll frequency being too high for the gps module.
For me, the solution is still to disable the gps. I prefer it from huge log files with noise. NTP, I think, is enough for now (?).
For whomever the gps is critical I don’t know.
If I ever find the time to research further and find something useful, I will post it here.

Hello @d_c_h_w and @grk
Would you share the contents of the following files config.txt and cmdline.txt . They are located on /boot part on your RPi’s.

Regards
Todor Velev

Hi Todor,
Here mine. They are default as far as I can see, apart from the modifications done by your install scripts.

cmdline.txt

dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=PARTUUID=b5cb85fa-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait modules-load=dwc2,g_ether

config.txt

# For more options and information see
# http://rpf.io/configtxt
# Some settings may impact device functionality. See link above for details

# uncomment if you get no picture on HDMI for a default "safe" mode
#hdmi_safe=1

# uncomment this if your display has a black border of unused pixels visible
# and your display can output without overscan
#disable_overscan=1

# uncomment the following to adjust overscan. Use positive numbers if console
# goes off screen, and negative if there is too much border
#overscan_left=16
#overscan_right=16
#overscan_top=16
#overscan_bottom=16

# uncomment to force a console size. By default it will be display's size minus
# overscan.
#framebuffer_width=1280
#framebuffer_height=720

# uncomment if hdmi display is not detected and composite is being output
#hdmi_force_hotplug=1

# uncomment to force a specific HDMI mode (this will force VGA)
#hdmi_group=1
#hdmi_mode=1

# uncomment to force a HDMI mode rather than DVI. This can make audio work in
# DMT (computer monitor) modes
#hdmi_drive=2

# uncomment to increase signal to HDMI, if you have interference, blanking, or
# no display
#config_hdmi_boost=4

# uncomment for composite PAL
#sdtv_mode=2

#uncomment to overclock the arm. 700 MHz is the default.
#arm_freq=800

# Uncomment some or all of these to enable the optional hardware interfaces
dtparam=i2c_arm=on
#dtparam=i2s=on
dtparam=spi=on
dtparam=i2c1=on
dtparam=i2c_arm_baudrate=10000

# Uncomment this to enable the lirc-rpi module
#dtoverlay=lirc-rpi

# Additional overlays and parameters are documented /boot/overlays/README

# Enable audio (loads snd_bcm2835)
dtparam=audio=on
dtoverlay=pi3-disable-bt
dtoverlay=dwc2

Thank you! I will try to reproduce the situation. Will keep you informed.

Thanks Todor, have you managed to look into this any more

I’ve also tried using the latest code from https://github.com/RAKWireless/rak_common_for_gateway
and following the installation instruction there, and I still get the same gps errors

Could this be a problem with i2c clock stretching, as I believe the rpi 3 is buggy in its clock stretching implementation

Ublox 7 + RPI via i2c issues described here
https://portal.u-blox.com/s/question/0D52p00008HKCIGCA5/solved-raspberry-pi-and-neo7-reference-board-i2c-bus-access

Just a little message, to say that i just received and setuped following documentations. my RAK7243 and i get exactly the same message !

Oct  9 16:22:55 rak-gateway ttn-gateway[1403]: WARNING: [gps] could not get a valid message from GPS (no time)
Oct  9 16:22:55 rak-gateway ttn-gateway[1403]: WARNING: [gps] could not get a valid message from GPS (no time)
Oct  9 16:22:55 rak-gateway ttn-gateway[1403]: WARNING: [gps] could not get a valid message from GPS (no time)
Oct  9 16:22:55 rak-gateway ttn-gateway[1403]: WARNING: [gps] could not get a valid message from GPS (no time)

@netmonk
@grk
2019-10-10%2009%3A10%3A53

This is because the rak7243 uses the i2c interface to get gps data, the i2c interface sets a lower rate, but the polling gps frequency is faster.

Alright, any way to fix that ?

You can ignore this warning message.

Comment out the file /opt/ttn-gateway/packet_forwarder/lora_pkt_fwd/src/lora_pkt_fwd.c about 2752 lines, and execute "sudo make" in the /opt/ttn-gateway/packet_forwarder directory.

Then restart the gateway and the warning will disappear.

To be honest, this doesn’t fix the I2C issue, just hides the issue :slight_smile:

Yes, thank you very much for your advice.
Regarding the issue of i2c rate, we will solve it as soon as possible.

@netmonk

2019-10-10%2009%3A10%3A53
This problem can try this solution.

Change the value of i2c_arm_baudrate from 10000 to 100000 in the file /boot/config.txt.
2019-11-11%2018%3A11%3A54

Good evening, is it solved in latest firmware release ?
i mean RAK2245&RAK831_based_on_Raspbian_OS_for_RPI3_V4.1.0_20191202.zip

Yes, we have done this in V4.1.0 firmware.