I have been using a WiFly for about one week transferring data via UDP communication. However, recently, the WiFly has been unable to connect in infrastructure mode and receive data. I have been using a sample UDP Server sketch that was posted earlier on this forum. Here are the symptoms:
- WiFly's green LED blinks fast unable to connect to valid IP Address on network.
- WiFly connects to valid IP Address only to disconnect once I open the Serial monitor for Arduino
- WiFly turns DHCP on and sets an IP address of 192.168.1.5 after I upload the UDP Server sketch and only after I upload this sketch.
The WiFly had been working earlier and I am unsure of what could be occurring, whether it is going to default settings or not, but I have not found anything in the datasheet. Any help would be appreciated.
Code: Select all#include "WiFly.h"
#include "Credentials.h"
#include "SPI.h"
WiFlyServer server(7778);
void setup() {
WiFly.begin();
if (!WiFly.join(ssid, passphrase)) {
while (1) {
// Hang on failure.
}
}
Serial.begin(9600);
Serial.print("IP: ");
Serial.println(WiFly.ip());
server.begin();
}
void loop() {
WiFlyClient client = server.available();
if (client) {
while (client.connected()) {
if (client.available()) {
/*(char c = client.read();
Serial.print(c);*/
Serial.println("");
char c;
}
client.stop();
}
}