Wifi Shield WIZ610Wi question

hi,
i'm pretty new to arduino and i'm not really getting the method to set up my wifi shield.
I have a arduino Uno with the following WiFi Shield (WIFI Shield For Arduino (802.11 b/g) (Discontinued) - DFRobot)
I want to create a ad-hoc network so I can connect to the arduino with an iPad. When i'm connected I would like to switch a led on and off by calling some URL's.

I have imported the WiServer library. But when I change the SSID etc it doesn't have effect on my network. I can connect to the wifi module with the standard ip (192.168.1.254) but it sends me to the config from the module. Isn't it possible to override these settings?

Thanks for you reply.

I have imported the WiServer library.

Into?

But when I change the SSID etc it doesn't have effect on my network.

Setting SSID shouldn't affect your network. It should allow the Arduino with shield to join the network.

I can connect to the wifi module with the standard ip (192.168.1.254) but it sends me to the config from the module.

Now, I recognize all of these words, but the order leaves a bit to be desired.

You connect to the wifi module from where/what? Which device is using that IP address? What is "it" that is sending you somewhere? "to the config from the module" is just a random collection of words devoid of meaning.

Please try again.

let's try again :slight_smile: I was pretty frustrated yesterday after fiddling for hours with the wifi shield.
Like I said, I would like to create an Adhoc network so my iPad can connect to Arduino. By calling an URL i would like to switch a led on/off

So far i managed to have the wifi shield up and running. I see a new wifi network and my computer can connect to it. I can open the wifi webadmin by entering the IP in my browser. I tried the WiServer library but I'm not sure it is compatible with my wifi shield.

Can someone give me some guidelines where to start?

thanks.

Are you positive you want your laptop connecting directly to the arduino?? There's nothing wrong with that, to be sure, but a more common arrangement would be to have both devices connect to an access point (typically, your router), at which point you can communicate between them via IP (TCP, UDP, etc). You do understand that if you configure your arduino as the network to connect to, your laptop will (likely) only be connecting to it and not the rest of your home network and/or internet, right? At least not through the same interface, unless you're doing something very sophisticated.

If you have both devices (laptop & arduino) associate with your router/AP, you can run a server on your arduino and talk to it from the laptop. The arduino doesn't have to provide the wireless network you associate with. And if you do go about it that way, you will have to manually configure an IP address on your laptop, one that is compatible with the one you've assigned your arduino.

I'm not trying to tell you not to do it the way you are, just want to be sure you understand.

Wimson,

i bought the same shield a few days ago and had some trouble configuring it myself but finally got it working.
This wifi shield will transform tcp packets to serial commands. I'm trying to build a wireless robot, and want to do that from within a web browser or an app.
I managed to get it working with flash, and with visual studio.net in c#. Problem for you is ofcourse that you have an ipad, so no flash for you ;).
I'd look into sockets, you can simply talk to your wifi shield when you connect to it via it's ip and the port (default 5000).

For example, my flash code to connect and send commands looks like this:

(this app prints the serial commands that are send to your arduino)

import flash.errors.*;
import flash.events.*;
import flash.net.Socket;

//Create a socket connection to the deafult tinkerProxy port
var arduinoSocket:Socket = new Socket("192.168.0.193",5000);


send_btn.addEventListener(MouseEvent.CLICK,buttonHandler);

function buttonHandler(e:MouseEvent):void{
	writeln(command.text);
}


arduinoSocket.addEventListener(Event.CLOSE, closeHandler);
arduinoSocket.addEventListener(Event.CONNECT, connectHandler);
arduinoSocket.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
arduinoSocket.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
arduinoSocket.addEventListener(ProgressEvent.SOCKET_DATA, socketDataHandler);

stage.addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler);
stage.addEventListener(KeyboardEvent.KEY_UP, keyUpHandler);

	function writeln(str:String):void {
        try {
           arduinoSocket.writeUTFBytes(str);
			arduinoSocket.flush();
        }
        catch(e:IOError) {
            trace(e);
        }
    }

    function readResponse():void {
        serialOutput.text += arduinoSocket.readUTFBytes(arduinoSocket.bytesAvailable) + "\n";
    }

    function closeHandler(event:Event):void {
        trace("closeHandler: " + event);
    }

    function connectHandler(event:Event):void {
        trace("connectHandler: " + event);
    }

    function ioErrorHandler(event:IOErrorEvent):void {
        trace("ioErrorHandler: " + event);
    }

    function securityErrorHandler(event:SecurityErrorEvent):void {
        trace("securityErrorHandler: " + event);
    }

    function socketDataHandler(event:ProgressEvent):void {
        trace("socketDataHandler: " + event);
        readResponse();
    }

Feel free to ask more if you need some advice.

I'm trying to build a wireless robot, and want to do that from within a web browser or an app.

You probably could use a simple web page like below for control via browser.

//zoomkat 9-5-11
//simple button GET with iframe code
//for use with IDE 0021
//open serial monitor to see what the arduino receives
//use the \ slash to escape the " in the html 
//address will look like http://192.168.1.102:84/ when submited
//for use with W5100 based ethernet shields

#include <SPI.h>
#include <Ethernet.h>

byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED }; //physical mac address
byte ip[] = { 192, 168, 1, 102 }; // ip in lan
byte gateway[] = { 192, 168, 1, 1 }; // internet access via router
byte subnet[] = { 255, 255, 255, 0 }; //subnet mask
Server server(84); //server port

String readString; 

//////////////////////

void setup(){

  pinMode(4, OUTPUT); //pin selected to control
  //start Ethernet
  Ethernet.begin(mac, ip, gateway, subnet);
  server.begin();

  //enable serial data print 
  Serial.begin(9600); 
  Serial.println("servertest1"); // so I can keep track of what is loaded
}

void loop(){
  // Create a client connection
  Client client = server.available();
  if (client) {
    while (client.connected()) {
      if (client.available()) {
        char c = client.read();

        //read char by char HTTP request
        if (readString.length() < 100) {

          //store characters to string 
          readString += c; 
          //Serial.print(c);
        } 

        //if HTTP request has ended
        if (c == '\n') {

          ///////////////
          Serial.println(readString); //print to serial monitor for debuging 

          //now output HTML data header
             if(readString.indexOf('?') >=0) { //don't send new page
               client.println("HTTP/1.1 204 Zoomkat");
               client.println();
               client.println();  
             }
             else {
          client.println("HTTP/1.1 200 OK"); //send new page
          client.println("Content-Type: text/html");
          client.println();

          client.println("<HTML>");
          client.println("<HEAD>");
          client.println("<TITLE>Arduino GET test page</TITLE>");
          client.println("</HEAD>");
          client.println("<BODY>");

          client.println("<H1>Zoomkat's simple Arduino button</H1>");
          
          client.println("<a href=\"/?on\" target=\"inlineframe\">ON</a>"); 
          client.println("<a href=\"/?off\" target=\"inlineframe\">OFF</a>"); 

          //client.println("<IFRAME name=inlineframe src=\"res://D:/WINDOWS/dnserror.htm\" width=1 height=1\">");
          client.println("<IFRAME name=inlineframe style=\"display:none\" >");          
          client.println("</IFRAME>");

          client.println("</BODY>");
          client.println("</HTML>");
             }

          delay(1);
          //stopping client
          client.stop();

          ///////////////////// control arduino pin
          if(readString.indexOf("on") >0)//checks for on
          {
            digitalWrite(4, HIGH);    // set pin 4 high
            Serial.println("Led On");
          }
          if(readString.indexOf("off") >0)//checks for off
          {
            digitalWrite(4, LOW);    // set pin 4 low
            Serial.println("Led Off");
          }
          //clearing string for next read
          readString="";

        }
      }
    }
  }
}

I looked at the below tutorial and making an easy interface is probably out of the picture. May be much easier to use a wireless router and ethernet shield with an arduino so you can use a browser based interface (bottom).

http://www.lynxmotion.net/viewtopic.php?f=20&t=6343