Anyone know of some code to set the RTC (DS1307) using NTP via the ENC28J60 chip preferable using the EtherCard library? Finding some combination out there but not all 3 of them. Just getting into Arduino so be easy. I can work a little bit of code at this point but not too complex stuff. Learning mostly from examples at this stage. Using UnoR3 if that matters.
Why would you want to do this ? Why not just use NTP and adjust your time setting from there ?
Do you need to the sub-second accuracy ? If not run an NTP update every minute or so and you are good.
Craig
craigcurtin:
Why would you want to do this ? Why not just use NTP and adjust your time setting from there ?Do you need to the sub-second accuracy ? If not run an NTP update every minute or so and you are good.
Craig
I want to be able to keep the time on power loss thus the DS1307 but it drifts over time and it doesn't handle DST. Syncing every once in a while to "My Linux NTP server" will take care of DST and keeping the clock accurate. Nothing critical just want to do it since I have net access. My projects will have net access but doesn't require it so it will continue on it own and rely on the DS1307 even after power loss and no network.
Anyway I don't know how to do it (code wise) with the enc28j60 yet. Figure I ask as somebody must of done this already but searching the net haven't yielded much.
dvo1:
craigcurtin:
Why would you want to do this ? Why not just use NTP and adjust your time setting from there ?Do you need to the sub-second accuracy ? If not run an NTP update every minute or so and you are good.
Craig
I want to be able to keep the time on power loss thus the DS1307 but it drifts over time and it doesn't handle DST. Syncing every once in a while to "My Linux NTP server" will take care of DST and keeping the clock accurate. Nothing critical just want to do it since I have net access. My projects will have net access but doesn't require it so it will continue on it own and rely on the DS1307 even after power loss and no network.
Anyway I don't know how to do it (code wise) with the enc28j60 yet. Figure I ask as somebody must of done this already but searching the net haven't yielded much.
the enc chips seem to be much more primitive in terms of how much of the IP stack they handle - personally for around the $10 mark i would not bother messing around - buy a w5100 shield. Plenty on deals extreme or ebay for $10
Craig
not tested with the enc28j60 but it should not be too hard to patch