gotthardp / lorawan-server

Compact server for private LoRaWAN networks
https://gotthardp.github.io/lorawan-server
MIT License
956 stars 329 forks source link

issue on Timestamp #213

Closed pdl86 closed 7 years ago

pdl86 commented 7 years ago

Hello when we process the frames received from Gotthardp via a mqtt connector, the timestamp field ( tmst) contains strange value , not related to the real time stamp ( as seen by the lorawan server exemple frame received in gotthardp at 2017-10-05 19:39:16 (france) ( normally ts should be: 1507225156) received then via mosquitto broker with tmst = 1131506996 , Wed, 09 Nov 2005 03:29:56 GMT ???

any clue ? regards Philippe

gotthardp commented 7 years ago

Hello, the documentation describes tmst as an "internal timestamp". It's not a standard timestamp; it's a number of microseconds since some unknown moment. This moment is gateway specific.

pdl86 commented 7 years ago

ok is there a way to obtain the Lorena network timestamp ? , ideally the time of emission by a device ? regards

philippe

Le 5 oct. 2017 21:42, "Petr Gotthard" notifications@github.com a écrit :

Hello, the documentation https://github.com/gotthardp/lorawan-server/blob/master/doc/JSON.md describes tmst as an "internal timestamp". It's not a standard timestamp; it's a number of microseconds since some unknown moment. This moment is gateway specific.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/gotthardp/lorawan-server/issues/213#issuecomment-334571123, or mute the thread https://github.com/notifications/unsubscribe-auth/AcwIuyBwAXYsaxgKNR0zfoSA-mvWCF56ks5spTEUgaJpZM4Pvcq7 .

gotthardp commented 7 years ago

the gateway sends timestamps only when it has GPS. does your gateway have gps?

pdl86 commented 7 years ago

yes and the devices are gps trakers.

by the way thanks for the support on multitech conduit. it's working quite well . regards

Le 5 oct. 2017 22:34, "Petr Gotthard" notifications@github.com a écrit :

the gateway sends timestamps only when it has GPS. does your gateway have gps?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/gotthardp/lorawan-server/issues/213#issuecomment-334584111, or mute the thread https://github.com/notifications/unsubscribe-auth/AcwIu0EVBtl4_itnC7LZN0JiWcfhKqIKks5spT1agaJpZM4Pvcq7 .

gotthardp commented 7 years ago

If the gateway has GPS then you should see rxq.time, do you? If there is no rxq.time, then I suspect the GPS might not be working properly.

pdl86 commented 7 years ago

Hello we do not have rxq.time in the frame sent by Lorawan.server to mosquitto , the gps is working fine ( in parallel , we query gpsd to get the position every minuet, moreover, the gps is used to sync the time, and it's ok)

for example , this is what with get via mqqt : {"data":"0047319100008E9728A0018E","devaddr":"0024BBF5","fcnt":23,"group":"FS_tracker","port":1,"rxq":{"codr":"4/5","datr":"SF12BW125","freq":868.5,"lsnr":6.5,"rssi":-35,"tmst":2835187340}}

so any any help ill be appreciated. regards Philippe

gotthardp commented 7 years ago

For start you can add datetime to "Uplink Fields" in the setting of your connector. It's the server time, but at least something for now.

Then, would you be able to check the gateway to server UDP communication and send some rxpk structure the gateway sent to the server?

pdl86 commented 7 years ago

Hello

Le 06/10/2017 à 12:01, Petr Gotthard a écrit :

For start you can add |datetime| to "Uplink Fields" in the setting of your connector. It's the server time, but at least something for now.

yes, it wokrs ( in fact we did already that by extracting the local gaetway time and adding it to the frame send to application)

Then, would you be able to check the gateway to server UDP communication and send some |rxpk| structure the gateway sent to the server?

this a raw UDP packet ( sent by lora-wan server) as captured

E$@@_[9~$:V 0 v1/gotthardp{"data":"0047329B00008EC32EE00178","datetime":"2017-10-06T11:28:43Z","devaddr":"00254FD3","fcnt":11,"group":"FS_tracker","port":1,"rxq":{"codr":"4/5","datr":"SF12BW125","freq":868.3,"lsnr":9.0,"rssi":-21,"tmst":2001624364}}

no trace of rxq.time

regards philippe

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/gotthardp/lorawan-server/issues/213#issuecomment-334713007, or mute the thread https://github.com/notifications/unsubscribe-auth/AcwIu0bZ7wbQo_Z8pJjc5jaXsZY9X9KMks5spfp-gaJpZM4Pvcq7.

gotthardp commented 7 years ago

But this is UDP from the server. Could you get UDP sent by the gateway, please?

pdl86 commented 7 years ago

Hi

what do you mean by the gateway ? ( as the lorawan server is running on the multitech gaetway !) : the packet forwarder ?

here is a capture of some traffic ( pcap file)

I see a timestamp ( tmst) in the packets  , as weel as date/time in the "stat" packet .

any clue ?

regards

Philippe

Le 06/10/2017 à 13:58, Petr Gotthard a écrit :

But this is UDP from the server. Could you get UDP sent by the gateway, please?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/gotthardp/lorawan-server/issues/213#issuecomment-334734825, or mute the thread https://github.com/notifications/unsubscribe-auth/AcwIuzF5FeqP_zTXW15Uk_HoaopAgdJkks5sphXggaJpZM4Pvcq7.

pdl86 commented 7 years ago

packet_forwarder.zip

gotthardp commented 7 years ago

In the log you can see "stat" packets with time, but these are not related to any frames. Then you can see the rxpk frames, but without any timestamp (only the tmst number). The packet_forwarder (from some reason) does not send any timestamp info to the server, so the server cannot forward it to MQTT.

pdl86 commented 7 years ago

Hi

OK , any clue ? a mis configuration ? we are using te "standard" packet forwarder of Multitech ,   I do not see really a way to configure ( or not) the GPS clok source ? any hints regards Philippe Le 06/10/2017 à 15:36, Petr Gotthard a écrit :

In the log you can see "stat" packets with time, but these are not related to any frames. Then you can see the rxpk frames, but without any timestamp (only the tmst number). The packet_forwarder (from some reason) does not send any timestamp info to the server, so the server cannot forward it to MQTT.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/gotthardp/lorawan-server/issues/213#issuecomment-334756839, or mute the thread https://github.com/notifications/unsubscribe-auth/AcwIu7-X3WJq6E_SlZMVwHod8RPrecCYks5spizRgaJpZM4Pvcq7.

gotthardp commented 7 years ago

The packet_forwarder comes in 2 flavours: basic and gps. Perhaps your gateway does not run the gps flavour. BTW, my Multitech Conduit has no GPS, your really does?

pdl86 commented 7 years ago

hi yes the newest versions (since July ) can have a gnss option. I will see with milultitech support and will let you know. By the way, on another topic where do you stand with downlink ? regards philippe

Le 6 oct. 2017 22:30, "Petr Gotthard" notifications@github.com a écrit :

The packet_forwarder comes in 2 flavours: basic and gps. Perhaps your gateway does not run the gps flavour. BTW, my Multitech Conduit has no GPS, your really does?

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/gotthardp/lorawan-server/issues/213#issuecomment-334862278, or mute the thread https://github.com/notifications/unsubscribe-auth/AcwIu-xXE3i3fRzq7LOwF2HVdEIY-P01ks5spo3ugaJpZM4Pvcq7 .

gotthardp commented 7 years ago

OK, thanks. What kind of downlink you mean?

pdl86 commented 7 years ago

Hi

I was referrng to "HTTP backend for downlinks #171"

regards

Philippe

Le 06/10/2017 à 23:13, Petr Gotthard a écrit :

OK, thanks. What kind of downlink you mean?

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/gotthardp/lorawan-server/issues/213#issuecomment-334871755, or mute the thread https://github.com/notifications/unsubscribe-auth/AcwIu-vcfrMfTliuMCMEbW65XnzPeKZuks5sppgRgaJpZM4Pvcq7.

gotthardp commented 7 years ago

I have it on my todo list with no target date. I have to focus on other priorities for now.

pdl86 commented 7 years ago

no worries as we can adress that via websocket or Mqtt and some sniffing of needed

regards Philippe philipe

Le 7 oct. 2017 10:39, "Petr Gotthard" notifications@github.com a écrit :

I have it on my todo list with no target date. I have to focus on other priorities for now.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/gotthardp/lorawan-server/issues/213#issuecomment-334920149, or mute the thread https://github.com/notifications/unsubscribe-auth/AcwIu-UxREJW5-TOr7M3jQtB1nLNHGAIks5spzjIgaJpZM4Pvcq7 .

gotthardp commented 7 years ago

May I close this issue now?

pdl86 commented 7 years ago

if you can better to wait the feedback of multi tech support thanks reds philippe

Le 7 oct. 2017 12:44, "Petr Gotthard" notifications@github.com a écrit :

May I close this issue now?

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/gotthardp/lorawan-server/issues/213#issuecomment-334926321, or mute the thread https://github.com/notifications/unsubscribe-auth/AcwIuyF_8F2YIpv-k6BRfqRg5sJu4KPyks5sp1YVgaJpZM4Pvcq7 .

gotthardp commented 7 years ago

Sure! :)

pdl86 commented 7 years ago

Hi after several exchanges with Multitech, as per their statement, the mLinux version is a "developpement" version, and as such , some features may not be fully implemented or tested . the rxpk.time attribute beeing one of them . !!! they suggest to use a utility : gpspipe process to "pipe" the GPS time into the packet_forwarder, and admit that their engineer were not able to have it working in a stable way ! they suggest to move on the AEP version, aimed at developping application, but then stopping to use Gotthardp lorawan server, unless to make the effort to integrate it. So as a result , we will spend some (mimited) time to sse if we can "fix" the gpspipe usage , otherwise implement the timestamping as part of the data payload from the device .

so I think you can close the issue regards Philippe

gotthardp commented 7 years ago

Thanks for the info.