Submitted by TrystanLea on Sun, 01/01/2012 - 17:32
I have just added to github a new NanodeRF example that at the same time as sending sensor data to a server gets the server time from the reply and adjusts a software realtime clock accordingly. Saves needing a real time clock onboard.
For a quick overview of how it works, here is the main bit of code that decodes the time string from the reply and adjusts the software rtc.
The software RTC library is another of Jean-Claude Wippler's great pieces of work and can be downloaded here
static void my_callback (byte status, word off, word len)
{
get_header_line(2,off); // Get the date and time line from the header (line 2)
Serial.println(line_buf); // Print out the date and time
// Decode date time string to get integers for hour, min, sec, day
// Search for the date time characters and hope they are in the right place
NanodeRF adjust onboard time from server reply
Submitted by TrystanLea on Sun, 01/01/2012 - 17:32I have just added to github a new NanodeRF example that at the same time as sending sensor data to a server gets the server time from the reply and adjusts a software realtime clock accordingly. Saves needing a real time clock onboard.
For a quick overview of how it works, here is the main bit of code that decodes the time string from the reply and adjusts the software rtc.
The software RTC library is another of Jean-Claude Wippler's great pieces of work and can be downloaded here
The full example can be found here:
https://github.com/openenergymonitor/NanodeRF/tree/master/NanodeRF_singleCT_rtc