Pages: [1]   Go Down
Author Topic: Wifi connection????????  (Read 1014 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,

I can imagine I am not the first with this issue but I can not find a post in the forum. I recently used an Ethernet shield for a Web server sketch which worked a treat, so I thought ok lets go for the WiFi. I have the Wireless SD Shield, plugged into the Arduino just like the Ethernet shield, uploaded the sketch and it is stuck in the While loop trying to connect. The pwr LED is not illuminated,the receive flashes as I would expect. I looked on the forum and someone suggested linking pins 3-7, tried this with no such luck. If someone could be kind enough to share there wealth of knowledge on this.   

cheers,

Karl
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 601
Posts: 48543
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
uploaded the sketch
That sketch, huh? Well, there's the problem.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 15
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Karl,

What wireless module are you using? I'm assuming the WiFly since I don't know of any other modules that do WiFi in that XBee module format.

Or are you using the actually Arduino WiFi shield?

---

I have had issues with the Arduino wireless SD shield and the RN-XV WiFly 171. I've been working on getting it to work for the last few days and have not gotten it to work yet.

Like you, the pwr led does not light up for me. I don't know if that is good or bad.
Logged

Offline Offline
Sr. Member
****
Karma: 7
Posts: 275
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

When asking for help, please consider to provide as much information as you can with the minimum being:

- Links to the exact hardware specs that you are using
- the code/ sketch that you intend on running on your Arduino

And please put the code in code tags so its actually readable. Without that minimum we cannot really provide much help!
Logged


Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


sorry for the lack of info.

It is an Arduino Wireless SD Shield with an UNO board. The is the WiFi Web Server from the Arduino learning library.

#include <SPI.h>
#include <WiFi.h>


char ssid[] = "yourNetwork";      //  your network SSID (name)
char pass[] = "secretPassword";   // your network password
int keyIndex = 0;                 // your network key Index number (needed only for WEP)

int status = WL_IDLE_STATUS;

WiFiServer server(80);

void setup() {
  // start serial port:
  Serial.begin(9600);

  // attempt to connect to Wifi network:
  while ( status != WL_CONNECTED) {
    Serial.print("Attempting to connect to SSID: ");
    Serial.println(ssid);
    status = WiFi.begin(ssid, pass);
    // wait 10 seconds for connection:
    delay(10000);
  }
  server.begin();
  // you're connected now, so print out the status:
  printWifiStatus();
}


void loop() {
  // listen for incoming clients
  WiFiClient client = server.available();
  if (client) {
    Serial.println("new client");
    // an http request ends with a blank line
    boolean currentLineIsBlank = true;
    while (client.connected()) {
      if (client.available()) {
        char c = client.read();
        Serial.write(c);
        // if you've gotten to the end of the line (received a newline
        // character) and the line is blank, the http request has ended,
        // so you can send a reply
        if (c == '\n' && currentLineIsBlank) {
          // send a standard http response header
          client.println("HTTP/1.1 200 OK");
          client.println("Content-Type: text/html");
          client.println("Connnection: close");
          client.println();
          client.println("<!DOCTYPE HTML>");
          client.println("<html>");
          // add a meta refresh tag, so the browser pulls again every 5 seconds:
          client.println("<meta http-equiv=\"refresh\" content=\"5\">");
          // output the value of each analog input pin
          for (int analogChannel = 0; analogChannel < 6; analogChannel++) {
            int sensorReading = analogRead(analogChannel);
            client.print("analog input ");
            client.print(analogChannel);
            client.print(" is ");
            client.print(sensorReading);
            client.println("<br />");     
          }
          client.println("</html>");
           break;
        }
        if (c == '\n') {
          // you're starting a new line
          currentLineIsBlank = true;
        }
        else if (c != '\r') {
          // you've gotten a character on the current line
          currentLineIsBlank = false;
        }
      }
    }
    // give the web browser time to receive the data
    delay(1);
      // close the connection:
      client.stop();
      Serial.println("client disonnected");
  }
}


void printWifiStatus() {
  // print the SSID of the network you're attached to:
  Serial.print("SSID: ");
  Serial.println(WiFi.SSID());

  // print your WiFi shield's IP address:
  IPAddress ip = WiFi.localIP();
  Serial.print("IP Address: ");
  Serial.println(ip);

  // print the received signal strength:
  long rssi = WiFi.RSSI();
  Serial.print("signal strength (RSSI):");
  Serial.print(rssi);
  Serial.println(" dBm");
}
Logged

Offline Offline
Sr. Member
****
Karma: 7
Posts: 275
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The Wireless SD shield is not a WiFi shield. WiFi is not the same as Wireless.
The Ardino Wirless SD shield needs to be equipped with an XBee wireless module. You did not mention what module is installed only the shield.
Whatever you do have installed however I'd believe makes no difference. The library you are referencing is meant for the specific wifi hardware on the Arduino WiFi shield and will not work with the Wireless SD shield.

Please put your code in code tags when posting!
Logged


Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


Sorry once again (new to this),

Ok all makes sense now, I need the Xbee to plug in the top of the WiFi shield. Feel very stupid about it now. Sorry for the Inconvenience. I shall carry on and try re-frame from the silly posts.   
Logged

Offline Offline
Sr. Member
****
Karma: 7
Posts: 275
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

No. You just need to carefully read what's written before even attempting to touch the keyboard. The Xbee is N O T a WiFi solution. It's adheres to a different wireless standard but NOT WiFi. E.g. You cannot connect directly to it from an iPhone or Android phone or connect it to your internet router.
Logged


Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yeah that's fine I understand that. I was looking last night a realized my mistake. Thank you for your input. 
Logged

Offline Offline
Sr. Member
****
Karma: 7
Posts: 275
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I read through your initial post again.
If you are interested in a real WiFi solution I would currently not recommend any WiFi shield and suggest an alternate solution using a " standard" Ethenet shield connected via short Ethernet Cable to a little pocket router. That way you will not have to rewrite code but still are able to use a WiFi connection:

http://arduino.cc/forum/index.php/topic,149865.0.html
Logged


Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thank you, for the recommendation. I think I'm running before I can walk at the moment. I am going to try using two xbees to connect wirelessly so they can talk to each other, then possibly try infrared for the application I am trying to achieve. So much to learn.
Logged

Pages: [1]   Go Up
Jump to: