Go Down

Topic: Connecting WiFly Shield (Read 279 times) previous topic - next topic

skippingtree

Hello,
I am trying to have WiFly shield connect to my wireless router.
I have Arduino Duemilanove and WiFly shield RN-131 stacked together. I was trying to run "WiFly_Autoconnect_Terminal" from the example in WiFly_Shield library. I have edited the Credentials.h to match my network but I get no responses not even "Association failed" message. I am sure the code is not the problem, am I missing or forgetting to do something?

Any advice would be appreciated, thank you.

Code: [Select]

#include <SPI.h>
#include <WiFly.h>

#include "Credentials.h"


void setup() {

  Serial.begin(9600);
  Serial.println("\n\r\n\rWiFly Shield Terminal Routine");
 
  WiFly.begin();
 
  if (!WiFly.join(ssid, passphrase)) {
    Serial.println("Association failed.");
    while (1) {
      // Hang on failure.
    }
  }
  Serial.println(WiFly.ip());
  Serial.println("Associated!");
}


void loop() {
  // Terminal routine

  // Always display a response uninterrupted by typing
  // but note that this makes the terminal unresponsive
  // while a response is being received.
  while(SpiSerial.available() > 0) {
    Serial.write(SpiSerial.read());
  }
 
  if(Serial.available()) { // Outgoing data
    SpiSerial.write(Serial.read());
  }
}


Code: [Select]

#ifndef __CREDENTIALS_H__
#define __CREDENTIALS_H__

// Wifi parameters
char passphrase[] = "12345678";
char ssid[] = "Testing";

#endif


Go Up