WiShield (async / CUHead)

After upgrading my arduino software from 0022 to 1.0 the wishield library I believe broke. I did a search on the forum and did not find anything with this issue. Currently I have a basic Wifi server setup using the CUHead shield (clone to async) and when I try to upload it to the Arduino from the IDE, I get and error compiling message with 2 errors. See code section

In file included from Wifi_Test.cpp:5:
C:\Users\M\Dropbox\Arduino\arduino-1.0\libraries\WiShield/WiServer.h:199: error: conflicting return type specified for 'virtual void Server::write(uint8_t)'
C:\Users\M\Dropbox\Arduino\arduino-1.0\hardware\arduino\cores\arduino/Print.h:48: error:   overriding 'virtual size_t Print::write(uint8_t)'

I personally am not sure how to fix this issue nor do I want to actually mess with and Arduino Core file to get it working.

Is anyone else seeing this and of have found a solution.

Regards

EDIT BELOW THIS POINT
I changed the data type of the write function in the WiServer.h file to size_t instead of void... this fixed the issue above.. however, a new issue arrised....

C:\Users\M\Dropbox\Arduino\arduino-1.0\libraries\WiShield\clock-arch.c:44:20: error: wiring.h: No such file or directory

I believe this is attempting to access the wiring.h file located in the hardware folder... It is there in version 22 but not in 1.0

As before any ideas welcome

I am having the same problem.

WiServer.h:198:16: error: conflicting return type specified for ‘virtual void Server::write(uint8_t)’
/usr/share/arduino/hardware/arduino/cores/arduino/Print.h:48:20: error:   overriding ‘virtual size_t Print::write(uint8_t)’

Have you got any solution?

I did, but I did not fix the entire lib. I am also not sure if it is "arduino legit" I basically used my knowledge of c and modified it to compile it in V1.0. You can still run it in its original code in v0022.

I am experiencing the same problem getting the CuHead shield working with the UNO with Arduino version 1.0. Has anyone else been able to get this working? Any advice would be greatly appreciated!

I replaced:
#include "wiring.h"
with:
#include "arduino.h"

and replaced:
#include "WProgram.h"
with:
#include "arduino.h"

I also had to change the return type on virtual void Server::write(uint8_t) in WiServer.h to size_t and it seems to work.

Hope this helps!

I replaced:
#include "wiring.h"
with:
#include "arduino.h"

Why? The file is Arduino.h.

PaulS you are absolutely correct, it should be Arduino.h. I was working in a Windows environment (shame I know) and it seems that it didn't care whether or not the A in Arduino.h was capitalized or not, it compiles either way. Thanks for the correction!

and it seems that it didn't care whether or not the A in Arduino.h was capitalized or not

But, refer to them as microsoft and they get upset. Go figure.

I'm facing:

In file included from D:\Removable Disk\arduino-1.0\hardware\arduino\cores\arduino/Arduino.h:4,
                 from WebServer.cpp:9:
d:/removable disk/arduino-1.0/hardware/tools/avr/lib/gcc/../../avr/include/stdlib.h:111: error: expected unqualified-id before 'int'
d:/removable disk/arduino-1.0/hardware/tools/avr/lib/gcc/../../avr/include/stdlib.h:111: error: expected `)' before 'int'
d:/removable disk/arduino-1.0/hardware/tools/avr/lib/gcc/../../avr/include/stdlib.h:111: error: expected `)' before 'int'
In file included from WebServer.cpp:9:
D:\Removable Disk\arduino-1.0\hardware\arduino\cores\arduino/Arduino.h:108: error: declaration of C function 'long unsigned int pulseIn(uint8_t, uint8_t, long unsigned int)' conflicts with
D:\Removable Disk\arduino-1.0\libraries\WiShield/wiring.h:98: error: previous declaration 'long unsigned int pulseIn(uint8_t, uint8_t)' here

i also made the same changes to the Wiserver.h (to the write function made it of size_t typw)and i got now:

D:\Removable Disk\arduino-1.0\libraries\WiShield\WiServer.cpp:38:22: error: WProgram.h: No such file or directory

Loaded the WProgram.h file with in the libraries under the Wishield directory its done , code is compiling fine now.

Loaded the WProgram.h file with in the libraries under the Wishield directory its done , code is compiling fine now.

That was absolutely the wrong thing to do. The WProgram.h file was renamed for a reason. The changes made to the renamed file make WProgram.h incompatible with newer versions of the IDE. You should not just copy old files into the new environment without knowing what you are doing.

The proper solution is to edit the library, and change WProgram.h to Arduino.h.

Anyone have a WiShield library that compiles with Arduino 1.0 they could pass along?
I'm not quite sure what I should be changing.

The proper solution is to edit the library, and change WProgram.h to Arduino.h.

Do this

Found these instructions for anyone else looking. Compiles fine with 2 of the given examples I tested.
http://www.sundh.com/blog/2012/02/make-wishield-work-in-latest-arduino-ide/

  1. In order to get rid of these error you need to change the corresponding names in the following files:

clock-arch.c
Replace #include “wiring.h” with #include “Arduino.h”

WiShield.cpp
Replace #include “WProgram.h” to #include “Arduino.h”

WiServer.cpp
Replace #include “WProgram.h” to #include “Arduino.h”
Replace void Server::write(uint8_t.. to be size_t Server::write(uint8_t..

WiServer.h
Replace virtual void write(uint8_t); to virtual size_t write(uint8_t);