I try to connect Wemos D1 mini to my new router. In the router i see it with a valid IP address 192.168.1.213.
But in the serial monitor i see only endless dots and after a while a wrong IP address 194.254.220.0. The code is simple because i try to track the problem. With my older router it worked fine. All other wifi appliances works without error only the Wemos broken after the change of the router.
Do you have any suggestions?
#include <ESP8266WiFi.h>
// Set WiFi credentials
#define WIFI_SSID "ssid"
#define WIFI_PASS "pass"
void setup() {
// Setup serial port
Serial.begin(115200);
Serial.println();
// Begin WiFi
WiFi.mode(WIFI_STA);
WiFi.begin(WIFI_SSID, WIFI_PASS);
// Connecting to WiFi...
Serial.print("Connecting to ");
Serial.print(WIFI_SSID);
// Loop continuously while WiFi is not connected
while (WiFi.status() != WL_CONNECTED)
{
delay(100);
Serial.print(".");
}
// Connected to WiFi
Serial.println();
Serial.print("Connected! IP address: ");
Serial.println(WiFi.localIP());
}
void loop() {
// put your main code here, to run repeatedly:
}
Tried again to copy the serial output. The router shows the wemos immediately with a valid IP, but the serial is "dotting" ca. 4 minutes... These are the only things i see in the serial monitor.
17:46:24.665 -> ........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
17:50:05.260 -> Connected! IP address: 169.254.220.0
PS C:\WINDOWS\system32> ping 169.254.220.0
Pinging 169.254.220.0 with 32 bytes of data:
Reply from 169.254.220.0: bytes=32 time=98ms TTL=255
Reply from 169.254.220.0: bytes=32 time=3ms TTL=255
Reply from 169.254.220.0: bytes=32 time=109ms TTL=255
Reply from 169.254.220.0: bytes=32 time=23ms TTL=255
Ping statistics for 169.254.220.0:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 3ms, Maximum = 109ms, Average = 58ms
PS C:\WINDOWS\system32> ping 192.168.1.213
Pinging 192.168.1.213 with 32 bytes of data:
Reply from 192.168.1.35: Destination host unreachable.
Reply from 192.168.1.35: Destination host unreachable.
Reply from 192.168.1.35: Destination host unreachable.
Reply from 192.168.1.35: Destination host unreachable.
Ping statistics for 192.168.1.213:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
I don't understand the different IPs in the second try. And don't understand the first try too, that the pings are working, because my valid IP range is 192.168.1.XXX.
When a device fails to communicate with the DHCP server, APIPA (Automatic Private IP Addressing) takes into effect and it will assign an IP address starting with 169.254 for the computer. Computers with an IP in this range (169.254.x.x) cannot see the network. The addresses only work on local networks, not the Internet.
Search on "ip address 169.254" for some reasons and possible solutions.
Now i checked the router, the IP above was bind to the Wemos MAC. I removed the binding and now the router doesn't shot the Wemos. So the problem is that my Wemos won't connect to my new router, but worked for months with the old. Every setting is copied from the old, so i don't understand.
I need to change some wifi settings maybe? Channel or something?
Edit: i changed the Channel Width from Auto to fixed 40MHz and it works... I never would have thought of that
Nor me. That is one of the weirdest fixes I've seen in a while...
Afterthought. When I see stuff like that, I always try reverting back to the previous settings, to see if something just got "fed" and the original settings work again.
Ok, end of story, it's just a waste of time. If everything works, but one thing is not, then one thing is not good, not the other, so I'm looking for another solution.