Loading...
Pages: [1]   Go Down
Author Topic: Update ds1307 rtc-NTP sync tool  (Read 3400 times)
0 Members and 1 Guest are viewing this topic.
Netherlands
Offline Offline
Tesla Member
***
Karma: 101
Posts: 9551
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Together with Rodrigo Castro an Arduino 1.0 update was made for - http://www.arduino.cc/playground/Main/DS1307OfTheLogshieldByMeansOfNTP -

The code should work under 0.22, 0,23 and 1.0

As always comments and remarks are welcome, in this thread.
Logged

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -

Wales
Offline Offline
Full Member
***
Karma: 0
Posts: 233
Don't take things too seriously
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for this.

Should the code be updated to prefer DHCP if the Arduino board supports it?

Also,
Quote from: robtillaart link=topic=85764.msg642340#msg642340
07/01/2011
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1291637975#10
shows DST function, to be integrated.

Was this integrated into the 04/01/2012 version? I'm unsure how/if I would need to handle DST for my location/project.

THANKS
Logged

Netherlands
Offline Offline
Tesla Member
***
Karma: 101
Posts: 9551
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


no, not integrated, but you are free too.

I prefer to do my logging without DST to prevent gaps/doubles in my data set
Logged

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -

Belgium
Offline Offline
Full Member
***
Karma: 1
Posts: 231
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Together with Rodrigo Castro an Arduino 1.0 update was made for - http://www.arduino.cc/playground/Main/DS1307OfTheLogshieldByMeansOfNTP -

The code should work under 0.22, 0,23 and 1.0

As always comments and remarks are welcome, in this thread.

I think there is a typo in the example sketch on the playground.
Code:
#if ARDUINO >= 100
#include <EthernetUdp.h>        // New from IDE 1.0
#else
#include <UDP.h>
#endif

UDP.h should be Udp.h
At least on my system:
sketch_apr26a.cpp:31:17: error: UDP.h: No such file or directory
I'm still using version 0023, my gentoo installation and 1.0 don't play nice. I should do something about that and switch to 1.0  smiley-red

Oh, and thanks for the sketch and libraries.


« Last Edit: April 26, 2012, 02:08:33 pm by Bajdi » Logged


Netherlands
Offline Offline
Tesla Member
***
Karma: 101
Posts: 9551
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


updated the example, thanks for the feedback
Logged

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -

Mesa,AZ
Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I am using Arduino IDE 1.0.1 and I can't get UDP , I Know all about IP addressing and gateway etc...
My MAC Address don't even show up on router list....
No Compile errors....

Can this work with on v 1.0.1 ?
Logged

Mesa,AZ
Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I downloaded Arduino IDE V 1.0 and it worked!
The IDE V 1.0.1 Don't Work..... Byte Command Word ? Something changed in the compiler....


 
Logged

Netherlands
Offline Offline
Tesla Member
***
Karma: 101
Posts: 9551
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

@shane
have you checked the release notes of 1.0.1?

As I have limited time now (other prio's) I cannot dive into this and redesign it to support new version. If you have patches please share them here.

Thanks,
Rob
Logged

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -

Derbyshire, UK
Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Having originally failed continually with "No UDP available ...", I managed to get UDP working by first reading packet size by using parsePacket, and then modifying the Udp.read to use that packet size

Code:
int packetSize = Udp.parsePacket(); //<<<<<<<<<<<<NEW LINE HERE
// send an NTP packet to a time server
sendNTPpacket(timeServer);

...
Udp.read(pb, packetSize);      // New from IDE 1.0 <<<<<<<<<<<<<MODIFIED LINE


And then, if you aren't in Chile, remember to make your own adjustment to UTC in the line which reads
Code:
t4 -= (3 * 3600L);

(the notes say this is a 4 hour adjustment, but clearly it is 3 hours)
Logged

Netherlands
Offline Offline
Tesla Member
***
Karma: 101
Posts: 9551
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks John for this improvement!

can you post your complete modified version, then I will update the playground code.

Thanks again,

« Last Edit: April 07, 2013, 12:34:34 pm by robtillaart » Logged

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -

Pages: [1]   Go Up
Print
 
Jump to: