Hi
Thanks for the help! I’ve gone through the documentation and the code, and I have quite a few questions. Are any of the original developers active on this forum?
I have found the functionality I need in the lower layers of GN. Essentially, it is the MAC command DeviceTimeAns
that would do the thing I want. It receives the GPS timestamp from the gateway, converts it to a Unix timestamp and stores it as the GN’s system time. This means that I only need to send a DeviceTimeReq
, where I would get a response and the DeviceTimeAns
command would be executed.
However, I am not sure how to send the command. Initially, I thought I had to call LmHandlerDeviceTimeReq() to send a request. However, the function is declared static, meaning it is private. There is a reason for that, right?
In LoRaWAN 1.0.0, the AppTimeReq
command is used to update the node’s timestamp. In the new version (1.1.0), however, DeviceTimeReq
is used instead. Having read an old document on the LoRaWAN 1.0.0 Application Layer Clock Synchronisation Specification, I discovered that you need to deactivate ADR and set NbTrans = 1 before sending the AppTimeReq
command. As these commands do the same thing, perhaps you also need to do the same for DeviceTimeReq
.
After digging deeper into the code, I saw that you do indeed need to deactivate the ADR, set the NbTrans = 1 and also store the datarate. However, rather than calling the function, you initialise a structure of functional pointers and add it to your LoRaMAC handlers, where it is called by the LoRaWAN lower layers. In order to add the handlers, do I need to call LmHandlerPackageRegister with PACKAGE_ID_CLOCK_SYNC? Does this mean the handlers are called whenever there is a TX or RX process?
If so, this seems a bit too aggressive. I would only like this to happen when joining and once per day at most.
I noticed that the GN was implemented according to the LoRaWAN 1.0.2 specification. Does this mean that the DeviceTimeReq command is not yet finished?
If any of my assumptions are incorrect, please feel free to correct me.
Thanks for the help!