-
Notifications
You must be signed in to change notification settings - Fork 288
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue with GPS Synchronization in LoRa Packet Forwarder-waveshare SX1302 pi Hat #116
Comments
I believe I found the root cause. In your quote (and I'm seeing the same problem on my own hardware as well) you logged the following NMEA message:
This message has 14 data fields in total. According to all NMEA specs I've checked in the process it should only have 13 fields, and that's what packet_forwarder expects. If the number of fields doesn't match, the basic GPS time sync fails, and if this is not done, no position is accepted either. The patch (as in: "make it work and don't care") is easy: Just make packet_forwarder accept the message with 14 fields, the last one (which is the superfluous one) doesn't hurt. This preliminary fix is running fine on my system without the earlier problem. However, a true solution (as in: "why is this field number 14 there in the first place?") I can not provide. The trailing ",V" in your message just shouldn't be there as much as I understand. |
Did you solve this? I am running into the same problem. |
In the meantime I did some more research and found that the NMEA spec is not as absolute as I assumed it to be. Apparently, there are a number of manufacturers who transmit messages not strictly conforming to the spec, so the parsing needs to accomodate for this (see discussion from the developers of gpsd, they are recommending the gpsd unified communication syntax over NMEA for exactly this reason.) Therefore the case at hand doesn't appear to be that out of the ordinary, but rather "NMEA business as usual". And since the required payload of the GNRMC message is not affected by the unexpected addition, it may as well just be ignored. So yes, I believe you can actually call it a "solution" instead of just a "patch". |
Got it, thank you. Could you share this code? |
Thak you for the response , I will check it out let you know the result. |
It's trivial, really: In libloragw/src/loragw_gps.c, you'll find:
Change that to something like:
This change will accept NMEA G?RMC messages with 13 or 14 fields, not only those with 13 as before. The L76K receiver apparently defaults to sending 14-field-messages. |
Thank you for you response. After adding to adapt nb_field 14, now it woking. |
Excellent, thanks for the feedback! PS: Does anyone know how to get the change into the repository? Is there even a maintainer still active? I can see pull requests still pending from 2022, not sure if it's worth creating another one. |
I made these changes but still having some issues. Its picking out the GPS coords now, but the timing is still off.
|
I tried a few years ago to get this exact change in. This repo ONLY supports UBLOX gpses, and the Waveshare decided to use a non UBLOX gps. See #90 (comment) |
Ah man, I was waiting whole night to get it to catch a lock, then checking with gpsd in the morning, packet forwarder just don't understand the GPS... and gpsd had perfect lock with GPS data.... I'm going to try the fix with 14-field-messages. Or maybe give the chirpstack gateway os a try, since it looks like the maintainer abandoned this repo :( |
Hello @VladoPortos , this repo is not abandoned, but the support of various GPS receiver is out of the scope of this project. ;) We give an example for Ublox receiver, but fill free to adapt according to your specific hardware. The main focus of this repo is the libloragw part, which is the driver of the SX1302 chip. Though, in the next release I'll add a fix for the issue described here. |
Hi @mcoracin, ah ok... I'm sorry. I'm just frustrated a bit, since documentation for Lora - anything, is not done well for people who try to learn it. For some reason I kind of expected since this repo is linked from https://www.waveshare.com/wiki/SX1302_LoRaWAN_Gateway_HAT that it should work. However seems like none of the Lora packet forwarders support anything but Ublox,. So why the hell waveshare sticked L76K on to their HAT? This one is working fine for linux with gpsd, but none of the packet forwarders I tried supports it. The packet forwarding works fine, I got that part working, just not sure why to include GPS on the board and not support it, thus I assume this repo is not really related to waveshare at all, right ? |
You're right, this repo is not related to Waveshare at all. By the way, the GPS is only needed if you want to do LoRaWAN Class-B, or if you are using a sx1303 for fine timestamping. |
I was having the same issue with packet_forwarder and "no valid GPS coordinates available yet". |
Hello all, just for information, the necessary change to support various possible number of fields in the RMC sentence will be done in next release, which should happen during the summer. |
Thanks, appreciate that! |
Thank you, this also worked for me. |
Greeting,
I am encountering difficulties with GPS synchronization in the Lora gateway. My hardware setup is: Raspberry Pi 3B+ and SX1302 LoRaWAN Gateway HAT by waveshare. I've successfully connected to TTN and can forward Lora packets to the network server without any issues. However, I'm having trouble getting GPS coordinates from the Lora gateway. It keeps showing a synchronization warning. Did I miss any additional required configurations to retrieve GPS data?
I have used
sudo cat /dev/ttyS0
command for checking GPS port and getting this valueThe part of the config file is:
And these are the terminal logs after running the packet forwarder
Any guidance or suggestions would be greatly appreciated. Thanks in advance.
The text was updated successfully, but these errors were encountered: