Add timestamp to messages

Hi,
I use MDEK with PANS 2, i want to add timestamp to the messages sends by the devices, if it’s not possible it would be enough that the bridge take the messages and add timestamp before send in MQTT.
It’s possible to do that?

Hi Blue,

Which timestamps are you exactly refering to ? The ones received by the tag when performing two way ranging scheme with anchors ?

Thanks
Yves

Hi Yves,
Thanks for reply.
I want to know the DateTime of the localization (for example 29/08/2019 16:47:00);
I know that UWB devices cannot have this datetime because they don’t know the time and the timezone, but the RPi 3 that receive the localization data know the datetime.
I want to know if is possible to add this info at the mqtt packet.

Hi Ivan,

Technically it is possible but you would need source code of the DWM Daemon. Timestamping it on the receive end of the MQTT Client is possible but it is less accurate and prone to error when TCP/IP communication latency increase.

Cheers,
TDK

Hi Leaps,
that’s what I imagined.
Is there a possibility that the DWM Daemon’s source code will be made available?
It’s very important to know the time of the location

Regards
Ivan

Is there an update on adding localization timestamp? I’d imagine that having the daemon’s source code is the only way to customize the messages that are being written to the MQTT topics.

I found a way to actually know the time it is not perfect but it works
in the RB3Pi execute this command every second let say…

mosquitto_pub -h 192.168.1.109 -t dwm/time -m “{“time”:”$(date ‘+%Y-%m-%d %H:%M:%S’)"}"

on the MQTT receiver will get: listen to dwm/# topic

dwm/time {“time”:“2021-06-10 04:59:29”}

dwm/node/17cd/uplink/location {“position”:{“x”:1.2151766,“y”:1.5804818,“z”:-0.070536055,“quality”:76},“superFrameNumber”:901}
dwm/node/2d24/uplink/location {“position”:{“x”:0.8083024,“y”:1.642765,“z”:-0.1094755,“quality”:51},“superFrameNumber”:901}
…and so on…

you will be receiving time every second, within the position messages, at least we know the messages that bellong to that second, of course the command can be excuted second/10, or whatever the need is…

hope this helps
best regards

That’s not much different than timestamping at mqtt arrival is it ? Possible to substract a calibration delay. It all depends on the goal precision, for some there’s no way around picking the uwb timestamp, that’s what it’s made for. For others mqtt rx is enough.
Actually your method is good if the receiver is a uC that does not have time, but then it could be solved differently e.g.with an rtc and ptp sync.

it is different, because it is the timestamp on the device sending the message (time of delivery), not the (time of arrival).