Closed LouneCode closed 1 year ago
Hi @LouneCode please do create a pull-request for this :+1:
I think we can use the seconds part of the time_since_gps_epoch
for the fine_time_since_gps_epoch
+ the packet.ftime
as nanos
, then we have the full duration since GPS epoch.
OK, I'll try make a pull-request with the suggested improvements.
Thanks! :)
Summary
I have investigated the consentratord backend code and found that the Fine timestamp information basis on PPS signal missing from current implementation?
Consertratord-sx1302 implementation has been build on Semtechs's HAL library (libloragw). Sx1302_hal library includes code for Fine timestamp implementation (for hardware with PPS signal). It seems that the Fine Timestamp solution can be added to consertratord-sx1302 backend quite easily.
Similar cases can be found from following issues:
What is the use-case?
A Fine Timestamp is used to get the TDoA geolocation of the transmitter (sensor).
Implementation description - Solution proposal
Add Fine Timestamp information to the up-event of the concentratord-sx1302 backend.
1) consertratord.toml
consertratord.toml file found in the same folder where
chirpstack-concentratord-sx1302
executable is. Following lines to be added into consertratord.toml configuration file for enabling Fine Timestamp functionality:model_flags=["USB","GNSS"]
[gateway.fine_timestamp]
enable=true
mode="ALL_SF"
2) chirpstack-concentratord-sx1302/src/handler/uplink.rs
Added
frame.ftime
andframe.ftime_received
fields and needed formating to info!() macro.Now consertratord-sx1302 log shows Fine Timestamp information "...fts: 143869299, fts_recv: true". The
Fts
field is a nano secons since last trailing edge of the PPS signal of the GPS module. This nano second information is need for aproximation of the geolocation.3) chirpstack-concentratord-sx1302/src/wrapper/mod.rs
pub fn uplink_to_proto() returns Result. fine_time_since_gps_epoch structe is added to gw::UplinkFrame.
packet.ftime
field holds precise receiving time information if Fine Timestamp property is enabled on consertratord-sx1302.And here is whole changed uplink_to_proto() function.
I wrote a simple Rust zeromq client program for printing up-events of the consertratord-sx1302 backend. Now Fine Timestamp information found in
fine_time_since_gps_epoch: Some(Duration { seconds: 0, nanos: 48290698 })
Structure as follows. In this example second part is allway zere. Only nano second part matters for the geolocation calculations.Can you implement this by yourself and make a pull request?
Yes ! can. I have a smoke tested this solution proposal and it seems to work . But first let's wait for the review and comments of the idea....