I have a question regarding wifi connection from a NodeMCU ESP8266 board to an Apple iPhone6 personal hotspot. The iOS version is 10.2.1 (14027). The NodeMCU code I use works with my home WLAN using WPA2 without any problems. If I change SSID and password to connect to the Apple hotspot the while()
loop runs forever (see code, I'm using Arduino IDE 1.8.2):
#include <ESP8266WiFi.h>
const char* ssid = "iPhone6";
const char* password = "passwd";
void setup() {
Serial.begin(115200);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
Serial.print(".");
delay(1500);
}
}
void loop() {
// do something
delay(10000);
}
To check things out I used the NodeMCU to scan for wifi networks and got my Apple hotspot listed (also using WPA2) so the board can "see" it. I can connect to the Apple hotspot with my iPad and my Dell Laptop so this works also. All the web pages I found are dealing with problems to set up the NodeMCU as WiFi server and not as a client. Is there another detail that I forgot in my code? Or is there another WiFi library than ESP8266WiFi I can use? If someone managed to get this connection work I would appreciate any hint.