Gateway timestamps in uplink metadata - how calculated?

I am trying to synchronize the data sampling more or less and exploring the latter approach. Thanks I will check the other link.

A post was merged into an existing topic: Time synchronisation of a Node

We had some issues with buffering gateways, so this is what we found:

Usually you can evaluate at least 3 different times from a message:

  • metadata.gateways[0].time: This is the time, the message was received on the gateway
  • metadata.time: This is the time, the message was send to the backend
  • The current time when the message is received by the final application

Most of the time the differences on our applications are below 300 ms, mainly caused by the transfer time between gateway and internet, but we have seen delays up to 10 s when the backend was very busy.

So, given all devices are synchronized to an ntp, the gateway[].time is most accurate. Specially if the gateways does some buffering and retransfer (like the Kerlink CPF), it may be the only usefull time.

On some gateways it may happen, that the time stamp is zero (Nil) for some unknown reason. Then it may be useful to use the other times as a fallback.

Hi. I understand your point of view. Nevertheless, I don’t know how to set the right UTC region in order to manage that information coming in the payload. I am using a Pygate Gateway setting to AU915 but I am in Brazil. I am showing the date in to the payload on Node-red. For me, is interesting to see this date in the right format.

This is the Date as I am seeing in the Metadata payload: 2021-04-04T12:33:50.178819382Z. Right now is + 3 hours. Also my pointing router is brazil.thethings.network

It is not a point of view, it is the reality. How you set your PyGate to provide the right time and set the time zone is probably better asked at the pycom forum, they know the firmware and there will probably be more pygate owners over there.

Thank you.