Problems with arduino-ethernet library (relating to botanicalls)

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

Why aren't you using the standard Ethernet library?

I am using the code provided by Botanicalls which I found here: http://www.botanicalls.com/kits/customize/ I used the library's they outline on that page because they are built into the code.

Is there a better code solution I should use?

dbmiller5:
Is there a better code solution I should use?

Well, you could use the standard library, which has the advantage of being compatible with the current Arduino IDE. It would require changing that botanicalls code to use the different Ethernet API and without comparing the two I can't say how much effort that would take.

Alternatively you could encourage the people who wrote the botanicalls code to bring it up to date with the current Arduino IDE.