-
-
Notifications
You must be signed in to change notification settings - Fork 408
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 sync Node-RED server. #625
Comments
Hi @TheHysiK , do you see any messages on node-red? You can add debug nodes there to get messages printed inside a console. Maybe you can add a screenshot from the ttn console, which downlink/uplink messages where seen by the network? |
Hi @FlorianLudwig thanks for your comment. |
Hey @TheHysiK
|
@FlorianLudwig I have tested with both of them; in the images I was using |
@TheHysiK Please check, that TTN downlinks are working with your setup. Working downlink is required for time sync protocol via node red. While you're sure that your downlinks are working, but your node does not sync time, probably no timesync packet was sent by the node red timeserver. Mostly this happenes, if the node's timesync request is received via a TTN gateway that does not provide time. Check in your TTN console in your application, if there is a field "time" (not: "timestamp") with a valid and precise time. Precise means, that there must be a microsecond fraction, marked by "Z". If the gateway, which delivers the payload from/to your node, does not provide a time, or does provide a time but without microseconds, the node red time server will not work. Move to another gateway then, or try another brand of gateway. The TTN TTIG does provide microseconds. If you find that your gateway is the reason, please close this issue, since it's not a failure related to this software. Thanks. |
Hi @cyberman54 ! EDIT: Fixed URL. |
@TheHysiK Your link doesn't work. Anyway, check your Node red server:
|
@cyberman54 |
@TheHsyik your screenshot show 3 different gateways, but only 1 of 3, the TTIG, provides absolute time. For syncing time you need to make sure, that the time sync request of the node is delivered by the TTIG, not by the other gateways. |
Hi @cyberman54 I understand that, I did all the test with that gateway and no other in range of the node, nothing happened. |
please write serial log with debug level 4 and post it here. |
I checked it and it already was with Debug level 4, this is the code when Timesync is received: |
Please check payload on all ports in TTN app console. Does the node send a timesync packet on port 9? |
No, just a normal PAX counter message. |
Did you wait some time? The action is triggered asynchronally, can take up to 30 seconds (depending on settings in paxcounter.conf) |
@cyberman54 yes I waited like 5-10 minutes while doing different test.
I am checking the timeserver logic and messages received by device, it seems Gateway is compatible with microseconds and timestamp but no message is generated from the function block... |
For some reason there was a ")" missing in the timserver routine. Not sure if this caused this issue. I tested with my NODE RED timeserver, it worked. |
@cyberman54 that was the problem, it is solved now. Thanks for your help. |
@theHysik sorry that had trouble with this bug. As your sync is working now, what precision do you achieve? |
@cyberman54 I was checking today to give you a response and this is happening now: |
I am trying to sync time via NODE-RED timesync server but with M5core and Lopy4 I can't get it work.
I have configured NODE-RED as example described in readme and configured MQTT to point to AppID/devices/DeviceID/up
I send a downlink to Port 2 with 87 as message and module receives it:
][senddata.cpp:113] sendData(): Counter cleared [D][lorawan.cpp:472] myEventCallback(): TXSTART [I][lorawan.cpp:266] lora_send(): 4 byte(s) sent to LORA [D][lorawan.cpp:472] myEventCallback(): RXSTART [I][lorawan.cpp:510] myRxCallback(): Received 1 byte(s) of payload on port 2 [I][rcommand.cpp:332] set_time(): Timesync requested by timeserver [D][lorawan.cpp:472] myEventCallback(): TXCOMPLETE
but nothing is happening. I have tried with:
#define TIME_SYNC_LORAWAN 0 // set to 1 to use LORA network as time source, 0 means off [default = 1] #define TIME_SYNC_LORASERVER 1 /
and with:
#define TIME_SYNC_LORAWAN 1 // set to 1 to use LORA network as time source, 0 means off [default = 1] #define TIME_SYNC_LORASERVER 0 /
What I am doing wrong? Is there any bugs with NODE-RED time server?
Thanks in advance.
The text was updated successfully, but these errors were encountered: