Ubuntu 10.10 32 bit
Arduino Mega 2650 with arduino Ethernet shield (want on Nanode as well)
Arduino version 22
Got Arduino 22 from
Got NTP client code from
When I compile I get: ntp_client:40: error:
‘UDP’ does not name a type
I downloaded the time library from the first post of this forum:
and dropped it in my libraries arduino folder.
Then I copied from mems second code block form mem’s second post and saved it in my sketchbook as ntp_sync/ntp_sync.pde
I compile it at this point and it says:
ntp_sync.cpp:3:81: error: UdpBytewise.h: No such file or directory
ntp_sync.cpp: In function ‘long unsigned int getNtpTime()’:
ntp_sync:59: error: ‘UdpBytewise’ was not declared in this scope
ntp_sync.cpp: In function ‘long unsigned int sendNTPpacket(byte*)’:
ntp_sync:70: error: ‘UdpBytewise’ was not declared in this scope
ntp_sync.cpp: In function ‘long unsigned int getUlong()’:
ntp_sync:87: error: ‘UdpBytewise’ was not declared in this scope
ntp_sync.cpp: In function ‘void write_n(int, int)’:
ntp_sync:97: error: ‘UdpBytewise’ was not declared in this scope
So, I went to here on the playground
And found a link to here for the udp additions to the Ethernet library
I got the libraries from that download and merged them into my arduino library folder and it copied the String library in and merged the new UDP stuff into the Ethernet library.
I then compile the code and get:
In file included from /home/dsmurl/Desktop/arduino-0022/libraries/Ethernet/Ethernet.cpp:1:
/home/dsmurl/Desktop/arduino-0022/libraries/Ethernet/utility/w5100.h:14:17: error: SPI.h: No such file or directory
As of Arduino 0019, the Ethernet library depends on the SPI library.
You appear to be using it or another library that depends on the SPI library.
So I then modify the ntp_sync.pde with the following line at the top’
When I compile this I get:
/home/dsmurl/Desktop/arduino-0022/libraries/Ethernet/UdpString.cpp:33:19: error: types.h: No such
From what I understand types.h is missing or something in version 22 of the Arduino libraries and some forums have mentioned that it was last working in arduino version 18. My problem here is that I want to get this stuff work on 22 because I plan on using a mega 2650 which had a lot of problems on the version 18. Are there updated versions of these libraries somewhere for the 22?
My final goal is to build a web server on the mega 2650 with the Ethernet shield that knows to hit a time server on boot to insure that it always has the proper time. Maybe there is a simpler way to do this without udp since I’m building a web server anyways. I really want an accurate time on boot and the ability to sync if need be. Is there a simpler way to get a time server time?