Controller script to respond time request by node

9 years 2 months ago #2272 by vickeyhort
Hi Friends

May someone helps me to write an automation code for following needs.

If some sensor node request time using "gw.requestTime(receiveTime);" , controller respond to node by sending current time to the node?

Please Log in or Create an account to join the conversation.

9 years 2 months ago #2273 by EasyIoT

vickeyhort wrote: Hi Friends

May someone helps me to write an automation code for following needs.

If some sensor node request time using "gw.requestTime(receiveTime);" , controller respond to node by sending current time to the node?


You do not need automation script. Driver itself will respond to gw.requestTime. Time is in UTC so be sure to convert time in your local time.

Please Log in or Create an account to join the conversation.

9 years 2 months ago - 9 years 2 months ago #2274 by vickeyhort
Thank you for your kind support.

I have tested the function and it is working as you told. But How can I convert UTC to GMT5+ which is UTC+5h?

Please Log in or Create an account to join the conversation.

9 years 2 months ago #2275 by EasyIoT

vickeyhort wrote: Thank you for your kind support.

I have tested the function and it is working as you told. But How can I convert UTC to GMT5+ which is UTC+5h?


Use timezone library. Example is here iot-playground.com/23-esp8266-wifi-real-time-clock-display . It uses ESP8266, but it's the same for NRF24L01.
The following user(s) said Thank You: vickeyhort

Please Log in or Create an account to join the conversation.

9 years 2 months ago - 9 years 2 months ago #2276 by vickeyhort
Thank you so much, Where to find that timezone library?
Do you mean this?
github.com/JChristensen/Timezone

Please Log in or Create an account to join the conversation.

9 years 2 months ago #2277 by EasyIoT

vickeyhort wrote: Thank you so much, Where to find that timezone library?


Search my github github.com/iot-playground/Arduino under external_libraries...
The following user(s) said Thank You: vickeyhort

Please Log in or Create an account to join the conversation.

Time to create page: 0.338 seconds

Forum latest

  • No posts to display.