Pages: [1]   Go Down
Author Topic: UDP & NTP Woes  (Read 859 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello,

I'll start with my desired end-result, which is to sync my Arduino's time via NTP over the ethernet shield.  I've been attempting this using snippets from the playground that utilize the UDPBytewise library.  Without rehashing the many other posts I've encountered on the subject too much, I'm getting an error regarding the missing types.h file from 0019. 

I'm currently using the 0022 environment & would love some assistance with this problem.  I am also totally open to accomplishing this in any other manner.  As I mentioned, I mostly just want to sync the Arduino's time via the ethernet shield.

Thanks!
Logged

0
Offline Offline
Tesla Member
***
Karma: 147
Posts: 9750
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

What type ethernet shield are you using?
Logged

Consider the daffodil. And while you're doing that, I'll be over here, looking through your stuff.   smiley-cool

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 227
Posts: 14024
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


just using the 'standard' ethernet + udp library here - http://www.arduino.cc/playground/Main/DS1307OfTheLogshieldByMeansOfNTP -
Logged

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm using the WIZ811MJ Wiznet module.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

@robtillaart:

I've tried the method you're using as well.  As I continued to strip code away in an attempt to remove possible causes, I noticed that just including the Ethernet.h library in 0022 requires me to include the SPI library.  As soon as I include SPI.h, I get the same error I was running into before:

Quote
/Applications/Arduino.app/Contents/Resources/Java/libraries/Ethernet/Dhcp.cpp:5:21: error: types.h: No such file or directory

I can't seem to get rid of this "types.h" error.
Logged

Left Coast, USA
Offline Offline
Sr. Member
****
Karma: 7
Posts: 499
Sometimes I just can't help myself.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I gave a link for a dhcp/dns library that works with arduino-0022 Here: http://arduino.cc/forum/index.php/topic,63891.0.html.

With dhcp, I get ip address from the dhcp server on my LAN.  With dns, I get ntp time from pool.ntp.org.

[/Begin disclaimer]
I am using Arduino Ethernet shields designed around the Wiznet 5100 chip.  As far as I can tell, the same stuff should work with the Wiznet module that you have, but I have no way of testing.
[/End disclaimer]

Regards,

Dave

« Last Edit: July 03, 2011, 04:42:38 pm by davekw7x » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi Dave,

I've pulled down the code you suggested and am going to give a shot.  Would you be willing to post the code you used to fetch & set time using NTP?  I'm currently working with a mash of code from timeNTP.pde, so I'd like to see how you did it with the new DHCP/DNS libraries I'm working with now.

Thanks for your assistance!
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

@Dave:

Disregard my last request.  I found the examples in the very code you linked to.  I guess if I RTFM more often I'd get more accomplished smiley
Logged

Wellington, New Zealand
Offline Offline
Sr. Member
****
Karma: 1
Posts: 404
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Have you tried the example UdpNtpClient that comes with the Arduino IDE (at least its in 0022)?  (File->Examples->Ethernet->UdpNtpClient)? 

I had also first looked at the UpdByteWise library example but I think the playground is quite out of date.
Logged


Offline Offline
Newbie
*
Karma: 0
Posts: 14
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Have you tried the example UdpNtpClient that comes with the Arduino IDE (at least its in 0022)?  (File->Examples->Ethernet->UdpNtpClient)? 

I had also first looked at the UpdByteWise library example but I think the playground is quite out of date.

I looked up the UdpByteWise library just yesterday, then I discovered the UdpNtpClient in 0022. The UdpNtpClient in 0022 worked like a charm for me  smiley-grin
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi all,

Just wanted to reply & let you all know that the code in the 0022 examples worked great!  I ended up setting up a local NTP server on my Fedora box & having the Arduino sync from there.

Thanks again for all your help!
Logged

Pages: [1]   Go Up
Jump to: