Hey guys,
I am trying to get the twittering plant project working(http://www.botanicalls.com), but I am having troubles with one of the library's. The botanicalls code uses arduino-ethernet (http://gkaindl.com/software/arduino-ethernet), and it does not appear to be updated.
Here are the errors I am getting:
C:\Users\David\Documents\Arduino\libraries\EthernetDHCP\EthernetDHCP.cpp:28:23: error: wiring.h: No such file or directory
C:\Users\David\Documents\Arduino\libraries\EthernetDHCP\EthernetDHCP.cpp: In member function 'int EthernetDHCPClass::begin(uint8_t*, int)':
C:\Users\David\Documents\Arduino\libraries\EthernetDHCP\EthernetDHCP.cpp:121: error: 'delay' was not declared in this scope
C:\Users\David\Documents\Arduino\libraries\EthernetDHCP\EthernetDHCP.cpp: In member function 'int EthernetDHCPClass::_startDHCPSession()':
C:\Users\David\Documents\Arduino\libraries\EthernetDHCP\EthernetDHCP.cpp:159: error: 'millis' was not declared in this scope
C:\Users\David\Documents\Arduino\libraries\EthernetDHCP\EthernetDHCP.cpp: In member function 'int EthernetDHCPClass::_sendDhcpMessage(DhcpMessageType_t)':
C:\Users\David\Documents\Arduino\libraries\EthernetDHCP\EthernetDHCP.cpp:193: error: 'millis' was not declared in this scope
C:\Users\David\Documents\Arduino\libraries\EthernetDHCP\EthernetDHCP.cpp: In member function 'DhcpState_t EthernetDHCPClass::poll()':
C:\Users\David\Documents\Arduino\libraries\EthernetDHCP\EthernetDHCP.cpp:488: error: 'millis' was not declared in this scope
I am pretty sure the error is related to the use of wiring.h instead of arduino.h. My plan is to replace wiring.h with arduino.h, however, it is not a normal #include. In "EthernetDNS.cpp" and "EthernetDHCP.cpp" the include usage is unfamiliar to me. Here it is:
extern "C" {
#include "wiring.h"
#include <utility/EthernetUtil.h>
}
Here is my solution:
#include <arduino.h>
extern "C" {
#include <utility/EthernetUtil.h>
}
In the file "EthernetCompat.cpp" (Documents\Arduino\libraries\EthernetDHCP\utility\EthernetCompat.cpp), the usage is slightly different from the other files listed above. Here it is:
extern "C" {
#include "wiring.h"
}
My solution:
#include <arduino.h>
I made the changes above and the code compiles, but its does not appear to work. Would someone please look over that library and help me figure out how to update it properly?
Thank you so much for reading,
Dave