mstrens / oXs_on_RP2040

version of openXsensor to be used on raspberry pi pico RP2040 (more protocols, more functionalities)
87 stars 22 forks source link

transmit GPS date/time only when the year is 2023 or newer #71

Closed ParkerEde closed 1 year ago

ParkerEde commented 1 year ago

is it possible that the GPS date/time is only transmitted when the year is 2023 or newer? The background is that the TBS M8.2 GPS module immediately transmits the date/time, even if it is not yet set correctly, and delivers a date/time from 2013. If you now want to use the feature in OpenTX/EdgeTX to set the date/time using the GPS sensor and you get a date/time from 2013 because you have not waited long enough and then switch off the receiver and sensors again, you have an extremely incorrect date/time in the radio from 2013. If the data were only delivered when the date/time is set correctly (year is at least 2023 or newer), you would not have this problem.

Satcomix commented 1 year ago

Hello, I believe your problem is related to the GPS week rollover (2013-09-01). I also own a TBS8-2 GPS module ROM CORE 2.01 (75331) 00080000 SPG 2.01 PROTVER 15.00 SV:32 Get the time from another GNSS system if possible. Can also be set and saved in the U-Center. https://content.u-blox.com/sites/default/files/u-blox-GPS-WeekNumberRolloverWorkaround_IN_%28UBX-19039990%29.pdf br, Torsten

ParkerEde commented 1 year ago

Thx Torsten, this is exactly the issue. A long time powered off GPS module has delivered 2013-09-01. The value in week number roll-over compensation is set to 1756. I've checked with U-Center. Perhaps the "Example code for host-side date adjustment" https://content.u-blox.com/sites/default/files/GPS-WeekNumber-Rollover-Workaround_AppNote_%28UBX-19016936%29.pdf page 6/11 could be a solution if it were implemented here? br, Ralf

Satcomix commented 1 year ago

Hello Ralf, Since the GPS time is contained in the PVT message, which is evaluated by the oXS and transferred to the individual telemetry fields, the simplest solution would be to forward the GPS/oXs time to the handheld only after the 3D fix has been obtained. Only Mstrens can comment on this, I don't have much idea about the programming. br, Torsten

mstrens commented 1 year ago

I have to check the datasheet but if I remember well the gps message contains a flag that says if the date/time is valid or not. I thought I take care of it but I am not sure (or I did it in a wrong way). I have to check.

mstrens commented 1 year ago

I made an update (2.1.5 in test branch) in order to transmit GPS date and time only when they are valid (based on some flags set by ublox in PVT frame. This is not based on 3D fix so it can be transmitted before e.g. long/lat

ParkerEde commented 1 year ago

@mstrens I have tested this. It workss fine. Many thanks

ParkerEde commented 1 year ago

I will close this issue here. Tested in "Test" Branch. I think it's ready to go to main.