Pages: [1]   Go Down
Author Topic: WiShield (async / CUHead)  (Read 6946 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 13
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Code:
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....
Code:
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
« Last Edit: December 13, 2011, 11:22:37 pm by mdn15 » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I am having the same problem.

Code:
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?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 13
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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!
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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!
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 653
Posts: 50883
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I replaced:
#include "wiring.h"
with:
#include "arduino.h"
Why? The file is Arduino.h.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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!
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 653
Posts: 50883
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
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.
Logged

ਪੰਜਾਬ
Offline Offline
Edison Member
*
Karma: 12
Posts: 1619
Another year! Alone! :(
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm facing:

Code:

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:

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

« Last Edit: February 16, 2012, 01:13:39 am by NI$HANT » Logged

"Real Men can Accomplish  Anything"
-  Website  
- skype : nishants5  

ਫ਼ਤੇਹ ਕਰੂਂ !

ਪੰਜਾਬ
Offline Offline
Edison Member
*
Karma: 12
Posts: 1619
Another year! Alone! :(
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

"Real Men can Accomplish  Anything"
-  Website  
- skype : nishants5  

ਫ਼ਤੇਹ ਕਰੂਂ !

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 653
Posts: 50883
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
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.
Logged

Boston
Offline Offline
God Member
*****
Karma: 3
Posts: 575
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

ਪੰਜਾਬ
Offline Offline
Edison Member
*
Karma: 12
Posts: 1619
Another year! Alone! :(
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Do this
Logged

"Real Men can Accomplish  Anything"
-  Website  
- skype : nishants5  

ਫ਼ਤੇਹ ਕਰੂਂ !

Boston
Offline Offline
God Member
*****
Karma: 3
Posts: 575
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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/

Quote
3. 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);
Logged

Pages: [1]   Go Up
Jump to: