ESP AP Mode fail
Posted: Thu Sep 01, 2016 1:18 am
I entered a test program from Sparkfun to demonstrate AP mode
const char WiFiAPPSK[] = "sparkfun";
.
.
.
void setupWiFi()
{
WiFi.mode(WIFI_AP);
// Do a little work to get a unique-ish name. Append the
// last two bytes of the MAC (HEX'd) to "Thing-":
uint8_t mac[WL_MAC_ADDR_LENGTH];
WiFi.softAPmacAddress(mac);
String macID = String(mac[WL_MAC_ADDR_LENGTH - 2], HEX) +
String(mac[WL_MAC_ADDR_LENGTH - 1], HEX);
macID.toUpperCase();
String AP_NameString = "ESP8266 Thing " + macID;
char AP_NameChar[AP_NameString.length() + 1];
memset(AP_NameChar, 0, AP_NameString.length() + 1);
for (int i=0; i<AP_NameString.length(); i++)
AP_NameChar[i] = AP_NameString.charAt(i);
WiFi.softAP(AP_NameChar, WiFiAPPSK);
}
and then I altered the security login and AP_namestring
const char WiFiAPPSK[] = "TEST";
String AP_NameString = "TESTController " + macID;
My program compiles and downloads fine but then sets up a connection using the sparkfun information, not the new information
Tried lots of resets etc but always the same....
Any ideas
const char WiFiAPPSK[] = "sparkfun";
.
.
.
void setupWiFi()
{
WiFi.mode(WIFI_AP);
// Do a little work to get a unique-ish name. Append the
// last two bytes of the MAC (HEX'd) to "Thing-":
uint8_t mac[WL_MAC_ADDR_LENGTH];
WiFi.softAPmacAddress(mac);
String macID = String(mac[WL_MAC_ADDR_LENGTH - 2], HEX) +
String(mac[WL_MAC_ADDR_LENGTH - 1], HEX);
macID.toUpperCase();
String AP_NameString = "ESP8266 Thing " + macID;
char AP_NameChar[AP_NameString.length() + 1];
memset(AP_NameChar, 0, AP_NameString.length() + 1);
for (int i=0; i<AP_NameString.length(); i++)
AP_NameChar[i] = AP_NameString.charAt(i);
WiFi.softAP(AP_NameChar, WiFiAPPSK);
}
and then I altered the security login and AP_namestring
const char WiFiAPPSK[] = "TEST";
String AP_NameString = "TESTController " + macID;
My program compiles and downloads fine but then sets up a connection using the sparkfun information, not the new information
Tried lots of resets etc but always the same....
Any ideas