Time awareness and scheduling events
-
Probably not something you need guys, but something i did the other day - a sketch to request the time from Vera and set an RTC.
My requirement is to keep the RTC synced when daylight saving changes, so sync would be at 2:01 Sundays.
-
No prob... you can remove the bugs ive added ;-)
-
I would suggest to sync times a little bit more because if i remember correct the 1307 is quite sensitive for drifting because of temperature, if it would drift 3 seconds a day would be around 16 minutes a year, the DS3231 compansates this with the build in temp sensor.
But i could be incorrect, but, update your rtc more often anyway ;)
-
Just tried the DS3232RTC library from the examples provided by @hek and it seems like the RTC I2C DS1307 AT24C32 (link to device in earlier post) I have is working happily with this library also. I guess all the features of the library does not work but since the features on my device are working I will stick with this lib since it is provided by MySensors.
Maybe you should try it out to @gregl
BTW!, the RTC I have seems to drift quite allot (~1s/h) so I would not recommend it to someone that needs accuracy.
-
All - help me understand the use-case for a RTC on a sensor please.
From the discussion above I get that we might have two different needs:
- really high accuracy
- a second (or few seconds) deviation are acceptable
We lose accuracy in RF transmission already, therefore fetching the time on the controller or gateway and sending it to the nodes is not appropriate for the high accuracy need. A RTC would not help in this case because you need to tell the RTC the current time to start with and if that's already inaccurate, you won't get the accuracy needed. The only way to get real accuracy would be to fetch it on the node directly e.g. with a DCF77 receiver.
For the "less accuracy needed" scenario why would you add hardware to the node if receiving a time broadcast from the controller every x minutes is good enough to get the required (lower) accuracy "in software" without the need for hardware? -
You would be better of with an http://www.maximintegrated.com/en/products/digital/real-time-clocks/DS3231.html which has a theoretically drift between 1 and 2 minutes a year (depending on operating temperatures).If i'm correct it uses the internal temp sensor for drift compensation (and could also be read?).
-
All - help me understand the use-case for a RTC on a sensor please.
From the discussion above I get that we might have two different needs:
- really high accuracy
- a second (or few seconds) deviation are acceptable
We lose accuracy in RF transmission already, therefore fetching the time on the controller or gateway and sending it to the nodes is not appropriate for the high accuracy need. A RTC would not help in this case because you need to tell the RTC the current time to start with and if that's already inaccurate, you won't get the accuracy needed. The only way to get real accuracy would be to fetch it on the node directly e.g. with a DCF77 receiver.
For the "less accuracy needed" scenario why would you add hardware to the node if receiving a time broadcast from the controller every x minutes is good enough to get the required (lower) accuracy "in software" without the need for hardware? -
All - help me understand the use-case for a RTC on a sensor please.
http://forum.mysensors.org/topic/284/simple-temp-light-time-setup-with-lcd-1-4-no-beta-anymore
Time currently is being pushed every minute by the device created on the controller to "the display" (It has no RTC now). When it fails to receive the new time it would then be standing still. So it is nice to have without power failure.
-
All - help me understand the use-case for a RTC on a sensor please.
http://forum.mysensors.org/topic/284/simple-temp-light-time-setup-with-lcd-1-4-no-beta-anymore
Time currently is being pushed every minute by the device created on the controller to "the display" (It has no RTC now). When it fails to receive the new time it would then be standing still. So it is nice to have without power failure.
@hek @John
using the "time.h" library on the node the time will continue to run. It will not be very accurate (as accurate as the "millis" in arduino) which should be sufficient to turn off the water after 15 minutes (no matter if that's a few seconds off) and good enough to let the clock tick further unless the next successful submission is received from the controller. -
@hek @John
using the "time.h" library on the node the time will continue to run. It will not be very accurate (as accurate as the "millis" in arduino) which should be sufficient to turn off the water after 15 minutes (no matter if that's a few seconds off) and good enough to let the clock tick further unless the next successful submission is received from the controller.