Lora-net / sx1302_hal

SX1302/SX1303 Hardware Abstraction Layer and Tools (packet forwarder...)
Other
219 stars 271 forks source link

Allow G?RMC GPS messages with 13 //or 14// fields. #90

Closed errolt closed 1 year ago

errolt commented 1 year ago

The current RMC decoder is hard limited to messages with 13 fields. My GPS sends a 14'th field, "NavStatus", which can be ignored, but still causes this message to be rejected.

Please, either accept messages with 13 or 14 fields, or accept messages with 13 or more fields.

errolt commented 1 year ago

Stale and unsupported repo.

vtjballeng commented 1 year ago

Stale and unsupported repo.

What is the current repo for an sx1303 hal @errolt ?

errolt commented 1 year ago

@vtjballeng Not a clue. See massage from bot to other issues, ie: https://github.com/Lora-net/sx1302_hal/issues/84

vtjballeng commented 1 year ago

@errolt it seems the repo is still active but Semtech is choosing to use their forum as the location for active issues.

mcoracin commented 1 year ago

Hello, This repository is still alive, but up to now no critical issues have lead to trigger a new release (for each release, we have quite a heavy testing process). From what I understood from the thread here is that the main issue is that the Waveshare shield is not using a Ublox GPS module. As explained by Orne from Chirpstack, the Ublox configuration is required for Class-B support to output the native GPS time without leap second. Also, it seems that according to the NMEA 0183, the standard RMC sentence size is 13 fields. Waveshare has put their GPS module instead of a ublox on their shield, maybe they should provide the library to support it properly with Class-B support. We could support more fields that 13 and ignore the last one, but not sure that it would bring a proper support of non-ublox GPS modules.

errolt commented 1 year ago

@mcoracin The Waveshare shield does not use a Ublox GPS module, but it does output UBlox compatible binary data. I don't know why they modified the GPS module to output Ublox data, but then send a broken RMC message. Output from packet_forwarder with GPS debugging enabled, after modification to allow 14 fields for RMC:

Note: Valid GGA sentence, 5 sat, lat 25deg 43.762min S, lon 028deg12.708min E, alt 1266
Note: ignored NMEA sentence
Note: ignored NMEA sentence
Note: ignored NMEA sentence
Note: ignored NMEA sentence
Note: ignored NMEA sentence
Note: ignored NMEA sentence
Note: Valid RMC sentence, GPS locked, date: 2022-11-28T10:02:35.000Z
Warning: localization error processing not implemented yet
Note: ignored NMEA sentence
Note: ignored NMEA sentence
Note: ignored NMEA sentence
ERROR: TOO SHORT TO BE A VALID UBX MESSAGE
Note: parsing UBX frame> b5 62 01 20 10 00 c8 50 4e 07 02 
ERROR: UBX message incomplete
Note: parsing UBX frame> b5 62 01 20 10 00 c8 50 4e 07 02 00 00 00 be 08 12 03 83 
ERROR: UBX message incomplete
Note: parsing UBX frame> b5 62 01 20 10 00 c8 50 4e 07 02 00 00 00 be 08 12 03 83 00 00 00 fe 2a 24 47 4e 
  GPS time = 10:02:53
SUCCESS: UBX message decoded
sync successfull

##### 2022-11-28 10:02:36 GMT #####
### [UPSTREAM] ###
# RF packets received by concentrator: 0
# CRC_OK: 0.00%, CRC_FAIL: 0.00%, NO_CRC: 0.00%
# RF packets forwarded: 0 (0 bytes)
# PUSH_DATA datagrams sent: 1 (170 bytes)
# PUSH_DATA acknowledged: 100.00%
### [DOWNSTREAM] ###
# PULL_DATA sent: 3 (100.00% acknowledged)
# PULL_RESP(onse) datagrams received: 0 (0 bytes)
# RF packets sent to concentrator: 0 (0 bytes)
# TX errors: 0
### SX1302 Status ###
# SX1302 counter (INST): 120897061
# SX1302 counter (PPS):  120214635
# BEACON queued: 0
# BEACON sent so far: 0
# BEACON rejected: 0
### [JIT] ###
src/jitqueue.c:440:jit_print_queue(): INFO: [jit] queue is empty
#--------
src/jitqueue.c:440:jit_print_queue(): INFO: [jit] queue is empty
### [GPS] ###
# Valid time reference (age: 0 sec)
# GPS coordinates: latitude -25.72936, longitude 28.21180, altitude 1266 m
### Concentrator temperature: 30 C ###
##### END #####

As you can see, once there is a complete UBlox message, it does decode, and time sync does happen.

But I closed this issue as it isn't critical, and most users might not notice that the GPS doesn't work without code modifications, and getting downstream support in Chirpstack, isn't critical either. I miss-read the last commit to this repo as April of 2022, else I would not have opened the issue.

mcoracin commented 1 year ago

Ok thanks for your answer, so for now we'll stick to the support of an actual ublox module, and update in the future if needed.