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.