Dear all ![]()
I used RN-XV 171 + DFRobott xbee shield + WIFLYHQ in Arduino set Ad-hoc network,but Arduino reboot loop :~
RN-XV 171(https://www.sparkfun.com/products/10822)
DFRobott xbee shield(Xbee_Shield_For_Arduino__no_Xbee___SKU_DFR0015_-DFRobot)
WiFlyHQ libary(GitHub - harlequin-tech/WiFlyHQ: WiFly RN-XV Arduino Library)
My setup:
reboot loop video
code:
#include <WiFlyHQ.h>
#include <SoftwareSerial.h>
WiFly wifly;
void setup()
{
pinMode(13, OUTPUT);
Serial.begin(9600);
Serial.println(F("Starting"));
wifly.begin(&Serial);
wifly.createAdhocNetwork("wifly", 10);
if (!wifly.begin(&Serial)) {
Serial.println(F("Failed to start wifly"));
}
wifly.setIpProtocol(WIFLY_PROTOCOL_UDP);
if (wifly.isConnected()) {
Serial.println("Old connection active. Closing");
wifly.close();
}
if (wifly.getPort() != 80) {
wifly.setPort(80);
/* local port does not take effect until the WiFly has rebooted (2.32) */
wifly.save();
Serial.println(F("Set port to 80, rebooting to make it work"));
wifly.reboot();
delay(3000);
}
Serial.println(F("Ready"));
}
void loop()
{
if (wifly.available() > 0) {
digitalWrite(13, HIGH);
Serial.println(F("recive msg"));
Serial.write(wifly.read());
}
// wifly.terminal();
}
and idea?
thanks ![]()