-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Time information not sent when faking GPS module #25
Comments
MAC commands are processed by the back-end, not the gateway (also not the packet forwarder on the gateway) so I assume your statement is based on back-end code? What code? |
Maybe you're right, and the problem lies in the Network Server software. As I mentioned before, I'm not an expert, and I'm still trying to figure stuff out. I thought it was due to packet_forwarder because of the I'll investigate more thoroughly and report back. |
I'll report here the results of my research. LoraserverFirst, I tried to understand why the Loraserver was sending a zero payload for the Basically, when the You can see this behaviour in the
So if the Lora-gateway-bridgeThe next layer of the network is the Lora-gateway-bridge. // Time since GPS epoch
if rxpk.Tmms != nil {
d := time.Duration(*rxpk.Tmms) * time.Millisecond
frame.RxInfo.TimeSinceGpsEpoch = ptypes.DurationProto(d)
} So how is the "tmms" field set? packet_forwarderThe lora-gateway-bridge reads the JSON sent by packet_forwarder. It turns out the "tmms" field is always missing from this JSON. I could only find it mentioned in the ConclusionsProbably the easiest solution is patching the lora-gateway-bridge so that it uses the "time" field rather then "tmms" to set |
A little update. I forked the packet_forwader from Lora-net to add the "tmms" field in the uplink JSON. |
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_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:
gps_ref_valid
isfalse
.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.
The text was updated successfully, but these errors were encountered: