wishield error

im new to arduino..... struggling a lot for my project.....

when i compile a simple program using the wishield. i got many errors. i cleared maximum. but still i have errors

#include <WiShield.h>
void setup()
{
Serial.begin(9600);
WiFi.init();
}
void loop()
{
WiFi.run();
}

im getting the error as

In file included from socketapp.c:46:
F:\arduino-1.0\libraries\dataflash/socketapp.h:52: error: conflicting types for 'uip_tcp_appstate_t'
F:\arduino-1.0\libraries\dataflash/webserver.h:43: error: previous declaration of 'uip_tcp_appstate_t' was here

what should i do now. pls help me :cold_sweat:

look at the sample programs included with the library, you need to configure the IP addresses etc too. this is the setup of a client:

#include <WiServer.h>

#define WIRELESS_MODE_INFRA	1
#define WIRELESS_MODE_ADHOC	2

// Wireless configuration parameters ----------------------------------------
unsigned char local_ip[] = {192,168,1,2};	// IP address of WiShield
unsigned char gateway_ip[] = {192,168,1,1};	// router or gateway IP address
unsigned char subnet_mask[] = {255,255,255,0};	// subnet mask for the local network
const prog_char ssid[] PROGMEM = {"ASYNCLABS"};		// max 32 bytes

unsigned char security_type = 0;	// 0 - open; 1 - WEP; 2 - WPA; 3 - WPA2

// WPA/WPA2 passphrase
const prog_char security_passphrase[] PROGMEM = {"12345678"};	// max 64 characters

// WEP 128-bit keys
// sample HEX keys
prog_uchar wep_keys[] PROGMEM = { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d,	// Key 0
				  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,	// Key 1
				  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,	// Key 2
				  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00	// Key 3
				};

// setup the wireless mode
// infrastructure - connect to AP
// adhoc - connect to another WiFi device
unsigned char wireless_mode = WIRELESS_MODE_INFRA;

unsigned char ssid_len;
unsigned char security_passphrase_len;
// End of wireless configuration parameters ----------------------------------------

I voted for #4. Hope that helps you solve your problem.

How could you vote for #4, #6 is obviously the way to go.


Rob

How could you vote for #4, #6 is obviously the way to go.

So, why didn't you vote for it?

Oops, my bad :slight_smile:

I voted 2 on the last poll, so I'm sticking with that. I don't think the OP will ever get a decent consensus though.

I voted 2 on the last poll, so I'm sticking with that. I don't think the OP will ever get a decent consensus though.

Yeah, it's like picking the Republican nominee to run for President. There are just too many bad choices.

sorry boss it still shows me the error after configuring your code

//eror---------------------------------------------------------------------------
In file included from F:\arduino-1.0\libraries\dataflash\request.cpp:32:
F:\arduino-1.0\libraries\dataflash/WiServer.h:198: error: conflicting return type specified for 'virtual void Server::write(uint8_t)'
F:\arduino-1.0\hardware\arduino\cores\arduino/Print.h:48: error: overriding 'virtual size_t Print::write(uint8_t)'

wat to do now :drooling_face:

wat to do now

Fix the error.

The particular problem has been posted, and solutions defined, often enough now. No mas.

coool...... cant get u buddy...... pls give me solution...... this is my final year engineering projet :grin:

this is my final year engineering projet

And you still haven't learned any programming or how to do research? Please do not apply at Boeing.

hooo :(..... i can program using embedded c but still im a begginer

So, what part of:

F:\arduino-1.0\libraries\dataflash/WiServer.h:198: error: conflicting return type specified for 'virtual void Server::write(uint8_t)'
F:\arduino-1.0\hardware\arduino\cores\arduino/Print.h:48: error: overriding 'virtual size_t Print::write(uint8_t)'

do you not understand?

The statements say that a derived class, WiServer, is overriding a method in a base class, Print, and that it is doing it incorrectly. Since you should NOT be trying to fix the base class, you have only one choice. Fix the derived class, WiServer.

The messages are telling you that the write() method, in the Print class, that takes a uint8_t argument returns a size_t, and that the write() method, in the WiServer class, that takes a uint8_t argument returns a void.

So, you need to change the return type of the write() method in the WiServer class to have a return type of size_t, in both the header file, WiServer.h, and the source file, WiServer.cpp.

You also need to revise the WiServer::write() method to actually return a value.

Change the data type of the write function in the WiServer.h file to size_t instead of void.

I have a v1 Async labs WiFi module that i got from ebay second hand for just 11 Dollars in a bid ,IM HAPPY and its the best ever thing i have got from eBay (or available on eBay, India).

soon i ran into problems however solved, also do care about apps-conf.h file also it's also a CULPRIT in making the code compile :smiley:

thank u..... i replaced void by size_t in both wiserver.h and wiserver.cpp......... now it shows me the error as-


dataflash\uip.c.o: In function uip_process': F:\arduino-1.0\libraries\dataflash/uip.c:776: undefined reference to webserver_appcall'
F:\arduino-1.0\libraries\dataflash/uip.c:815: undefined reference to webserver_appcall' F:\arduino-1.0\libraries\dataflash/uip.c:1570: undefined reference to webserver_appcall'
F:\arduino-1.0\libraries\dataflash/uip.c:1597: undefined reference to webserver_appcall' F:\arduino-1.0\libraries\dataflash/uip.c:1674: undefined reference to webserver_appcall'
dataflash\uip.c.o:F:\arduino-1.0\libraries\dataflash/uip.c:1755: more undefined references to webserver_appcall' follow dataflash\stack.c.o: In function stack_init':
F:\arduino-1.0\libraries\dataflash/stack.c:77: undefined reference to `webserver_init'

and my simple program is,


#include <WiShield.h>
#define WIRELESS_MODE_INFRA 1
#define WIRELESS_MODE_ADHOC 2

// Wireless configuration parameters ----------------------------------------
unsigned char local_ip[] = {192,168,1,2}; // IP address of WiShield
unsigned char gateway_ip[] = {192,168,1,1}; // router or gateway IP address
unsigned char subnet_mask[] = {255,255,255,0}; // subnet mask for the local network
const prog_char ssid[] PROGMEM = {"ASYNCLABS"}; // max 32 bytes

unsigned char security_type = 0; // 0 - open; 1 - WEP; 2 - WPA; 3 - WPA2

// WPA/WPA2 passphrase
const prog_char security_passphrase[] PROGMEM = {"12345678"}; // max 64 characters

// WEP 128-bit keys
// sample HEX keys
prog_uchar wep_keys[] PROGMEM = { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, // Key 0
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Key 1
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Key 2
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 // Key 3
};

// setup the wireless mode
// infrastructure - connect to AP
// adhoc - connect to another WiFi device
unsigned char wireless_mode = WIRELESS_MODE_INFRA;

unsigned char ssid_len;
unsigned char security_passphrase_len;
// End of wireless configuration parameters ----------------------------------------
void setup()
{
Serial.begin(9600);
WiFi.init();
}
void loop()
{
WiFi.run();
}

what i need to do now, help me again pls

Why you changed the variable i told you to change in both the files i just told to make changes in the h header file no c++ file, Please ensure you undo all changes that are previously made by you.

also, use Arduino 0022 IDE ,Go as i defined here definitely problem will get solved but don't go Haywire here and there.

i made changes as you said now it shows me


dataflash\uip.c.o: In function uip_process': F:\arduino-1.0\libraries\dataflash/uip.c:776: undefined reference to webserver_appcall'
F:\arduino-1.0\libraries\dataflash/uip.c:815: undefined reference to webserver_appcall' F:\arduino-1.0\libraries\dataflash/uip.c:1570: undefined reference to webserver_appcall'
F:\arduino-1.0\libraries\dataflash/uip.c:1597: undefined reference to webserver_appcall' F:\arduino-1.0\libraries\dataflash/uip.c:1674: undefined reference to webserver_appcall'
dataflash\uip.c.o:F:\arduino-1.0\libraries\dataflash/uip.c:1755: more undefined references to webserver_appcall' follow dataflash\stack.c.o: In function stack_init':
F:\arduino-1.0\libraries\dataflash/stack.c:77: undefined reference to `webserver_init'

what is this error...... what should i do now

Try out with the attached sketch it's compiling for me in the 0022 IDE , just open the 0022 IDE DO NOT double click on the sketch itself to open in the IDE by default because then the latest Arduino 1.0 IDE will get opened , so open 0022 IDE first then DRAG-DROP the sketch after downloading.

I was able to make buttons and turn LED on and off(this sketch will not do it its just a test sketch), Should not be a problem for you now and if it still remains then something messy is on with your library then unzip again to put the fresh library at its place and carefully make the changes as told above.

working_WiFi_Sketch.pde (2.8 KB)

NI$HANT:
soon i ran into problems however solved, also do care about apps-conf.h file also it's also a CULPRIT in making the code compile :smiley:

Pretty sure that will solve the error. You have to un-comment the right line in that file.

By stating that this is for your final project, I'm encouraged to never give a 100% answer, but some guidance instead.