Go Down

Topic: UDP & NTP Woes (Read 935 times) previous topic - next topic

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!

zoomkat

What type ethernet shield are you using?
Google forum search: Use Google Advanced Search and use Http://forum.arduino.cc/index in the "site or domain:" box.

robtillaart


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

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

I'm using the WIZ811MJ Wiznet module.

@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.

davekw7x

#5
Jul 03, 2011, 11:35 pm Last Edit: Jul 03, 2011, 11:42 pm by davekw7x Reason: 1
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


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!

@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 :)

dhunt

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.


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  :D

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!

Go Up