The Yellow Jacket wifi microcontroller originally from Asynclabs is being produced by The Rugged Circuits. I got one and here is a tutorial on how to read an analogue value from the board.
The Yellow Jacket is using the library WiShield from Asynclabs. I have seen a lot of puzzled comments on how to get it working. Just running one of the WiShield examples in the latest Arduino IDE gave me a few errors:
“error: conflicting return type specified for ‘virtual void Server::write(uint8_t)’”
It seems like the WiShield library isn’t really up to sync with the latest Arduino IDE. So I used the older Arduino IDE and downloaded the WiShield 1.3.0 library which is made for the older Arduino 0022.
Your network settings
Next thing I modified the example SimpleClient with my personal network settings. The local ip is the address where I will be able to access the board from and with that the sensor value of the analog input. In your network settings you can see what type of security settings your network has. Change the digit in code to correspond to your network’s security type. In my case I have got a WPA2 password that I enter in the code.
unsigned char local_ip[] = {192,168,2,240}; // I choose a free IP address in my network
unsigned char gateway_ip[] = {192,168,2,1}; // Address of my router
unsigned char subnet_mask[] = {255,255,255,0};
const prog_char ssid[] PROGMEM = {"NAME_OF_MY_WIFI_NETWORK"};
unsigned char security_type = 3; // 0 – open; 1 – WEP; 2 – WPA; 3 – WPA2
// WPA/WPA2 passphrase
const prog_char security_passphrase[] PROGMEM = {"my_password"};
Initializing WiServer
In the setup method of the sketch the WiServer is initialized together with the name of a function defining what we will see when surfing into the board.
void setup() {
WiServer.init(sendMyPage);
WiServer.enableVerboseMode(true);
}
Serving data to web page
As in any Arduino sketch the analog value can be reached through analogRead. Within the method sendMyPage the content of the web page is printed together with the sensor value.
With WiServer.print we serve the value to
WiServer.print("");
sensorValue = analogRead(sensorPin);
WiServer.print("sensorValue :");
WiServer.print(sensorValue);
WiServer.print("");
Good to know-list
Good to know when uploading your code to the board:
- You need to set your board type to Arduino Uno.
- It will take about 30 seconds for the Yellow Jacket to start up after uploading the code or adding power to it.
- You can source the Yellow Jacket with its own power by adding 7V-24VDC to pin raw.
- Depending on which code library you want to use you need to activate it in apps-conf.h within the WiServer library code. In this example I have uncommented #define APP_WISERVER
David 18:21 on February 24, 2012 Permalink
Great tip!
However, to make it work with my yellowjacket board, I had to take the regular WiShield github branch. The Wishield_user_contrib branch may have been forked before something was fixed. But I took the newest files from the user_contrib (WiServer.cpp, apps-conf.h, g2100.c and uip.c) to get advantage of their fixes too, and then made your modifications, and it is working fine now!
Thanks!
Tommy Thorn 02:09 on March 12, 2012 Permalink
I wonder why we get a different result. The latest Arduino IDE I see is 1.0. When I installed on my mac and I apply the changes you suggest I get
In file included from webserver.c:38:
/Volumes/tommy/Documents/Arduino/libraries/WiShield/webserver.h:43: error: conflicting types for ‘uip_tcp_appstate_t’
/Volumes/tommy/Documents/Arduino/libraries/WiShield/server.h:65: error: previous declaration of ‘uip_tcp_appstate_t’ was here
I notice that the Rugged Circuits Version 1.3.1 gives me the same result, so
what am I missing? Thanks.
Tom Ashe 19:40 on March 19, 2012 Permalink
Tommy… This is what you are missing, if you have not found it already. The errors you are getting are caused by the apps-config.h file. It has a series of #defines that are supposed to be commented out and uncommented for the sketch you want to run.
The file comes with the APP_WISERVER uncommented. This causes the errors you are getting.
The fix: comment this out and uncomment APP_WEBSERVER and the errors will disappear. Nothing else is required, if you downloaded 1.3.1 from Rugged Circuits.
Pedro 22:13 on March 25, 2012 Permalink
i have the same issu when i try to compile and example.
Can anybody tell me what i am doing wrong plz.
orcuthe 15:42 on April 2, 2012 Permalink
Worked fine with Wifi Bee.
Thanks a lot.
Ron 18:33 on April 9, 2012 Permalink
Same here? all the above changes where done…
In file included from /Users/dvdrony/Documents/Arduino/libraries/WiShield/request.cpp:32:
/Users/dvdrony/Documents/Arduino/libraries/WiShield/WiServer.h:198: error: conflicting return type specified for ‘virtual void Server::write(uint8_t)’
/Users/dvdrony/Desktop/~Arduino/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino/Print.h:48: error: overriding ‘virtual size_t Print::write(uint8_t)’
Thanks!
Ellen 15:07 on April 13, 2012 Permalink
@Ron You need to change the return type to size_t in WiServer.h in order for Print.h do follow the interface.
Todd 12:36 on May 6, 2012 Permalink
Thank you, just what I was looking for.
Alexander 10:48 on May 10, 2012 Permalink
Hi, i’m an Italian Student and i have some problem to compile my first wifi arduino application.
The ide write this error:
SimpleServer:15: error: conflicting declaration ‘const prog_char ssid []‘
config.h:43: error: ’ssid’ has a previous declaration as ‘char ssid []‘
how i can fix this?
thanks to all…
NelsonConect 01:38 on May 13, 2012 Permalink
Its work for me, but the wishield with flash dont work.
Ellen 08:45 on May 31, 2012 Permalink
Hi Nelson!
How is your setup with wishield with flash?
Pozza 23:23 on May 31, 2012 Permalink
Alexander
I had a similar problem with conflicting declarations. It was due to me having 2 versions of the same file, as the board I used, had it’s own version of the file.
remove one, and that fixed it for me.
Hope this helps.
Ady 22:31 on June 14, 2012 Permalink
In file included from D:\download\arduino-0023\libraries\wifilib/apps-conf.h:46,
from D:\download\arduino-0023\libraries\wifilib/uip-conf.h:141,
from D:\download\arduino-0023\libraries\wifilib/uipopt.h:104,
from D:\download\arduino-0023\libraries\wifilib/socketapp.h:41,
from socketapp.c:46:
D:\download\arduino-0023\libraries\wifilib/webserver.h:46: error: two or more data types in declaration specifiers
Ady 22:31 on June 14, 2012 Permalink
pls help me!!!
matt 16:17 on June 20, 2012 Permalink
Hi Ellen,
following the posts on (Ellen 17:22 on February 17, 2012 | 14) and (Tom Ashe 19:40 on March 19, 2012 ), i got the WebServer example to upload and work,
then i tried to get the TinyREST server to work and started getting:
TinyREST_mpb20120619b:17: error: conflicting declaration ‘const prog_char ssid []‘
/Users/matt/Documents/Arduino/libraries/WiShield/config.h:44: error: ’ssid’ has a previous declaration as ‘char ssid []‘
where are (Pozza 23:23 on May 31, 2012 ) multiple versions hiding?
i have deleted Arduino 1.0.1 on my Mac and i still get the same errors.
i went back to the WebServer and it also is giving me the same error now, even though it had uploaded and worked,
/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/bin/avr-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000L -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=101 -I/Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino -I/Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/variants/standard -I/Users/matt/Documents/Arduino/libraries/WiShield /tmp/build6266653682354258881.tmp/WebServer_mpb20120617.cpp -o /tmp/build6266653682354258881.tmp/WebServer_mpb20120617.cpp.o
WebServer_mpb20120617.cpp:19: warning: only initialized variables can be placed into program memory area
WebServer_mpb20120617:15: error: conflicting declaration ‘const prog_char ssid []‘
/Users/matt/Documents/Arduino/libraries/WiShield/config.h:44: error: ’ssid’ has a previous declaration as ‘char ssid []‘
WebServer_mpb20120617.cpp:24: warning: only initialized variables can be placed into program memory area
WebServer_mpb20120617.cpp:28: warning: only initialized variables can be placed into program memory area
WebServer_mpb20120617.cpp:49: warning: only initialized variables can be placed into program memory area
Youmna 03:21 on June 25, 2012 Permalink
THANKS!!@
Brian Ballsun-Stanton 19:31 on July 11, 2012 Permalink
Matt, I made, in config.h, char ssid to prog_char, and in the demo, removed the constant.
Chrigu 12:53 on October 27, 2012 Permalink
God thank you soo much Ellen! I spent already hours trying to fix things!
Christian 23:00 on November 7, 2012 Permalink
Hi Ellen, I just got one error now: /Applications/Arduino.app/Contents/Resources/Java/libraries/WiShield/clock-arch.c:44:10: error: #include expects “FILENAME” or This is pointing on: #include “Arduino.h” which seems strange? Can you pls help?
Poledust 20:33 on November 25, 2012 Permalink
I have made the changes that you have suggested here and it did allow me to load to the mega 2560 but the Wishield 2.0 still will not light up and I cant see the Wishield over wifi. In case I am in the wrong place I am using a Arduino mega 2560 with a Wishield 2.0 I have found several blogs and or sites with so many different solutions to this problem and I have tried all of them and still it doesnt work I dont know much about this stuff to get to deep on my own. I would appriciate any help!
liuxy 05:52 on January 19, 2013 Permalink
help me !!
void udpapp_init(void)
{
uip_ipaddr_t addr;
struct uip_udp_conn *c;
uip_ipaddr(&addr, 192,168,1,100);
c = uip_udp_new(&addr, HTONS(0));
if(c != NULL) {
uip_udp_bind(c, HTONS(12344));
}
s.state = STATE_INIT;
PT_INIT(&s.pt);
}
udpapp.c: In function ‘udpapp_init’:
udpapp.c:58: error: dereferencing pointer to incomplete type