When the gateway is not equipped with a GPS module and is configured with fake_gps: true, the time information is not added to the "DeviceTimeAns" MAC command specified in LoRaWAN 1.0.3.
Browsing the code I found a couple of TODOs that mention the possibility of using an alternative time source from the GPS module:
A solution could use the clock_gettime() function with CLOCK_REALTIME to get the seconds since the Unix epoch, and then convert to seconds since the GPS epoch (taking into consideration leap seconds..).
I see two way of enabling the behaviour of using the local time:
- by adding a new option, e.g. "fake_gps_time", or
- by enabling reading the local time whenever
gps_ref_valid is false.
I'm willing to propose a PR, but I'm not an expert in C or the codebase, so I might need a little guidance.
When the gateway is not equipped with a GPS module and is configured with
fake_gps: true, the time information is not added to the "DeviceTimeAns" MAC command specified in LoRaWAN 1.0.3.Browsing the code I found a couple of TODOs that mention the possibility of using an alternative time source from the GPS module:
A solution could use the
clock_gettime()function withCLOCK_REALTIMEto get the seconds since the Unix epoch, and then convert to seconds since the GPS epoch (taking into consideration leap seconds..).I see two way of enabling the behaviour of using the local time:
gps_ref_validisfalse.I'm willing to propose a PR, but I'm not an expert in C or the codebase, so I might need a little guidance.