Is anybody working with this Shield and has a working application ?
i am looking for the same thing...
i was tinkgering around the wishield code and got the little led on the board to go on...but that is about the success i had...no connection
i hope to get some help around here as well....
I am using the webserver sketch...
it compiles and downloads to the arduino...but from there nothing...
heeelp
Ive got it working without any problems folowing the instructions.
Its connecting to my wifi router.
I can get to the webserver sketch that I connected up to a buzzer and could turn it on and off.
I havnt done anything major with it yet.
As to applications have you looked at the coupleof projects documented on there forum?
The examples in the library work.
Whats the problem?
Have you looked at the Async forum to see if there is help there?
Its probaly nothing more than setting the correct ip address, gateway and credentials for your wifi router.
Gordon
I've got one working and it can tweet or throw up a simple web page.
I'm working on a weather station and want it to tweet and show the results on an lcd screen.
The problem I have is tweeting and the LCD don't seem to work together even though I have changed the pins to LiquidCrystal lcd(4, 3, 8, 7, 6, 5);
The WiSheild library's take a lot of memory.
If you are using a 168 it might not have the room.
Even the 328 could struggle if you try to do to much but I would have thought there would be room for and lcd library.
Pin 8 is selectable by the jumpers on the WiShield.
Have you got the jumper in the correct position?
"# Switchable interrupt pin usage between INT0 (port D, pin 2) and digital pin 8 (port B, pin 0)
Switchable LED on digital pin 9 (port B, pin 1) "
From http://asynclabs.com/wiki/index.php?title=WiShield_1.0
Also have you tried the LCD on its own without the WiShield?
Can the Arduino power both devices?
Or do you need to look at an extra power supply for the LCD?
Gordon
I am using IDE 17 have the lcd and Wishield both working seperately and am using interrupt set to pin 2. The problem comes when I add line LiquidCrystal lcd(4, 3, 8, 7, 6, 5);, then it no longer tweets.
I also have 3 sensors hooked up. I didn't think it was a power issue as when I comment out the LiquidCrystal line and leave the lcd on, it still tweets, but it may be a power issue.
Any suggestions are welcome. Thanks.
I ordered an LCD from Adafruit to check this out for myself (having the LCD screen on-hand for other projects wouldn't be bad either). I'm still waiting for this to come in the mail.
I've used all those pins previously for a demo with a seven segment display, but I wasn't trying to tweet at the same time.
Once I get the LCD panel in my hand, I can try and hook it up.
Excellent - thanks for testing out an LCD with the Wishield.
In the meantime I have ordered 5 volt power supply and will test to see if it is a power issue.
Pauly, Asynclabs
I had a play as I had an lcd and power supply to hand.
Its not just tweeting that causes the problem.
Ive included my sketch below.
It should serve a hello world page with a hit count and display the Wifi connection status and hit count on the lcd.
I hooked up a 2x16 lcd using the liquidcrystal library and a modified simpleserver example.
Using the wiserver option in apps-conf.h
I got the garbage on the lcd until I started changing the pins about for the lcd.
LiquidCrystal lcd(0, 1, 4, 5, 6, 7, 8);
This works and displays on the LCD anything you print from setup() and serves up a web page.
But nothing is being printed to the lcd from within loop().
and some strange characters get printed at random locations on the lcd.
If I used pins 2 or 3 it just put garbage on the lcd so the Wishield is using these.
10 - 13 are used for the spi interface.
I have the interrupt jumper set to Int0 so that is why pin2 cant be used.
Ive used pin8 for data bus 7 on the lcd, so the jumper is isolating that pin.
Why pin3 is a problem, I dont know, the schematic on the Async wiki doesnt show it connected to anything.
Is it being referenced in the libraries when it shouldnt be?
I hooked up an additional 5v supply for the LCD to test to see if its the power consumption.
Same result, nothing on the lcd from within the loop and some strange characters.
So something to do with the Wishield or Wishield library is interfering with the LiquidCrystal library
after WiServer.server_task() is called.
Is pin3 a clue?
Are there other pins referenced by mistake maybe and conflicting with the liquid crystal library pins?
I hope this helps AsyncLabs.
Gordon
/*
* A simple sketch that uses WiServer to serve a web page
* and an lcd to show status and hits
*/
#include <WiServer.h>
#include <LiquidCrystal.h>
// initialize with the numbers of the interface pins
LiquidCrystal lcd(0, 1, 4, 5, 6, 7, 9);
// page hit count
int count = 0;
#define WIRELESS_MODE_INFRA 1
#define WIRELESS_MODE_ADHOC 2
// Wireless configuration parameters ----------------------------------------
unsigned char local_ip[] = {192,168,1,231}; // 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 = {"ssid"}; // max 32 bytes
unsigned char security_type = 3; // 0 - open; 1 - WEP; 2 - WPA; 3 - WPA2
// WPA/WPA2 passphrase
const prog_char security_passphrase[] PROGMEM = {"xxxxxxxxxx"}; // 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 ----------------------------------------
// This is our page serving function that generates web pages
boolean sendMyPage(char* URL) {
// Check if the requested URL sets bleeper on
if (strcmp(URL, "/") == 0) {
// Use WiServer's print and println functions to write out the page content
WiServer.print("<html>");
WiServer.print("Hello world
");
WiServer.print(count);
WiServer.print(" Hits");
WiServer.print("</html>");
count++;
return true;
}
// URL not found
return false;
}
void setup() {
// set up the LCD's number of rows and columns:
lcd.begin(16, 2);
// Print a message to the LCD.
lcd.print("Connecting");
// Initialize WiServer and have it use the sendMyPage function to serve pages
WiServer.init(sendMyPage);
// display connected on the lcd
lcd.setCursor(0, 0);
lcd.print("Connected!");
lcd.setCursor(0, 1);
// print the number of hits
lcd.print(count);
lcd.print(" Hits");
// Enable Serial output and ask WiServer to generate log messages (optional)
Serial.begin(57600);
WiServer.enableVerboseMode(true);
}
void loop(){
// Run WiServer
WiServer.server_task();
//Serial.print("Loop");
// This is not working with the wishield
lcd.setCursor(0, 1);
// print the number of hits
lcd.print(count);
}
Pauly,
Ive just seen your other post on the same subject.
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1252460302/8#8
This could have clues to the problem.
Maybe Asynclabs can comment on the possible timing issues with the cli() command in wiring.c
While this may not be the solution it could provide some clues.
If I get some time later Ill have another play.
Id like to get this working as I want to use these together myself now.
Gordon
Ive raised this now on the AsyncLabs forum and linked to these posts with an update on some info I found on interrupts.
http://asynclabs.com/forums/viewtopic.php?f=10&t=97&p=458#p458
Gordon
lol I have to post a normal message before I can post a message with links in it. My 2c incoming.
Hey there,
I've had a bit of luck with the wishield / lcd combo. From what I can see here are a few problems I had:
- Wishield uses pin 9 for the led. If you want to use the lcd you have to unplug the jumper near the led.
- While the wishield can do psk etc I couldn't get it to work. I just don't know if the little arduino has the go to make it happen. Test it on an open wireless first.
- At here:
WiServer.print("<html>");
WiServer.print("Hello world
");
WiServer.print(count);
WiServer.print(" Hits");
WiServer.print("</html>");
I found the Wiserver.print to only horrendously enjoy doing the whole page in one go. If you want to print variables you may have to use strcat to cobble together a buffer string and then print it all in one go. I did that in this first little program I did here:
http://asynclabs.com/forums/viewtopic.php?f=18&t=104
- For my server I used pins 3,4,5,7 for data and pin 6 because it was pwm to fade the backlight. In this configuration I couldn't run serial at the same time as the lcd. For whatever reason writing to the serial threw some random voltages around that crashed the lcd.
My full writeup for the thing that I did is here:
http://asynclabs.com/forums/viewtopic.php?f=18&t=107
at the asynclabs forums or here:
http://allthingsbecause.org/?p=40
at my blog. The code is reasonably solid it occasionally crashes but I think this is more to do with some of the string handling.
Hope this helps ...