# WiFi doesn't reconnect after rebooting router

**URL:** https://wled.discourse.group/t/wifi-doesnt-reconnect-after-rebooting-router/285
**Category:** Issues
**Created:** [April 1, 2020, 5:33am UTC](https://wled.discourse.group/t/wifi-doesnt-reconnect-after-rebooting-router/285 "2020-04-01T05:33:35Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![mstringer](https://avatars.discourse-cdn.com/v4/letter/m/bbe5ce/32.png) [@mstringer](https://wled.discourse.group/u/mstringer)
#### Post date: [April 1, 2020, 5:33am UTC](https://wled.discourse.group/t/wifi-doesnt-reconnect-after-rebooting-router/285/1 "2020-04-01T05:33:35Z")

</div>

If I have to restart my router, which takes 2-3 minutes for the WiFi to come back up. The ESPs don’t reconnect.

I have to power cycle the ESPs and they connect straight away.

I have disabled WiFi sleep, but that didn’t fix it.

I auto-reboot the router twice a week at 2am.

Is there anything else I can do?

The WiFi is rock solid without rebooting

---

<div class="post-metadata">

### Author: ![Aircoookie](https://yyz2.discourse-cdn.com/free1/user_avatar/wled.discourse.group/aircoookie/32/2_2.png) [@Aircoookie](https://wled.discourse.group/u/Aircoookie)
#### Post date: [April 1, 2020, 9:51am UTC](https://wled.discourse.group/t/wifi-doesnt-reconnect-after-rebooting-router/285/2 "2020-04-01T09:51:18Z")

</div>

Hi,

that does sound like it is an issue with my reconnection code… Is the WLED-AP started when connection is lost? What version is this with and what is your ESP board? Also make sure that the `AP opens` setting in WiFi settings is set to `No connection after boot`

---

<div class="post-metadata">

### Author: ![mstringer](https://avatars.discourse-cdn.com/v4/letter/m/bbe5ce/32.png) [@mstringer](https://wled.discourse.group/u/mstringer)
#### Post date: [April 1, 2020, 10:38am UTC](https://wled.discourse.group/t/wifi-doesnt-reconnect-after-rebooting-router/285/3 "2020-04-01T10:38:44Z")

</div>

No connection after boot is set  
Version 0.9.1  
ESP8266

I will check to see the AP is started when I get home.

I have a WiFi MAC whitelist on my Asus AC68u the WiFi startup sequence is a bit strange with this.

Router powers on

2.4ghz WiFi turns on broadcasts SSID  
But blocks anything from connecting (presumably until the Mac filter is running)

After about 60-90 seconds, then, the router allows devices to connected to WiFi.

It looks like to me, wled is getting rejected by my router trying to reconnect, and by the time it’s allowed to connect, it’s either timed out or use maximum amount of retries?

---

<div class="post-metadata">

### Author: ![huggy-d1](https://yyz2.discourse-cdn.com/free1/user_avatar/wled.discourse.group/huggy-d1/32/51_2.png) [@huggy-d1](https://wled.discourse.group/u/huggy-d1)
#### Post date: [April 1, 2020, 12:31pm UTC](https://wled.discourse.group/t/wifi-doesnt-reconnect-after-rebooting-router/285/4 "2020-04-01T12:31:59Z")

</div>

Reserve IP addresses for your WLED device(s) and assign static IP addresses.

---

<div class="post-metadata">

### Author: ![mstringer](https://avatars.discourse-cdn.com/v4/letter/m/bbe5ce/32.png) [@mstringer](https://wled.discourse.group/u/mstringer)
#### Post date: [April 1, 2020, 12:36pm UTC](https://wled.discourse.group/t/wifi-doesnt-reconnect-after-rebooting-router/285/5 "2020-04-01T12:36:03Z")

</div>

I have done that, I do that with every device i have.

---

<div class="post-metadata">

### Author: ![huggy-d1](https://yyz2.discourse-cdn.com/free1/user_avatar/wled.discourse.group/huggy-d1/32/51_2.png) [@huggy-d1](https://wled.discourse.group/u/huggy-d1)
#### Post date: [April 1, 2020, 12:46pm UTC](https://wled.discourse.group/t/wifi-doesnt-reconnect-after-rebooting-router/285/6 "2020-04-01T12:46:47Z")

</div>

Is your router able to change the boot order so wifi chip turns on the SSID announce after MAC filtering is enabled. Or, maybe allows rudimentary connections until the mac filter is online, Firewall then allows connections once mac filtering is online.

I know it sounds easy to say. That said, you sound like the type of person that could pull something like that off if your router would allow it.

---

<div class="post-metadata">

### Author: ![Aircoookie](https://yyz2.discourse-cdn.com/free1/user_avatar/wled.discourse.group/aircoookie/32/2_2.png) [@Aircoookie](https://wled.discourse.group/u/Aircoookie)
#### Post date: [April 1, 2020, 4:21pm UTC](https://wled.discourse.group/t/wifi-doesnt-reconnect-after-rebooting-router/285/7 "2020-04-01T16:21:52Z")

</div>

That indeed is a bit strange. Maybe the ESP thinks it is connected even though the connection is actually reset and as such doesn’t attemp to reconnect again. There is no such thing as maximum tries or timeout in WLED, it will always attempt reconnection normally…

---

<div class="post-metadata">

### Author: ![mstringer](https://avatars.discourse-cdn.com/v4/letter/m/bbe5ce/32.png) [@mstringer](https://wled.discourse.group/u/mstringer)
#### Post date: [April 1, 2020, 5:33pm UTC](https://wled.discourse.group/t/wifi-doesnt-reconnect-after-rebooting-router/285/8 "2020-04-01T17:33:55Z")

</div>

Ok thank you.

I have one last thing to try in my router, I have wireless scheduling, so I can turn the wireless radio off in 1 hour segments.

So on reboot nights i can turn off the wireless radio at 3am to 4am, the reboot happens at 3:30am. That should allow plenty of time for the router to start up.

I’m testing now, but have to wait 30mins because it wont schedule if I am already in the hour segments.

Also can i trigger a power cycle with a macro?

---

<div class="post-metadata">

### Author: ![Aircoookie](https://yyz2.discourse-cdn.com/free1/user_avatar/wled.discourse.group/aircoookie/32/2_2.png) [@Aircoookie](https://wled.discourse.group/u/Aircoookie)
#### Post date: [April 1, 2020, 10:45pm UTC](https://wled.discourse.group/t/wifi-doesnt-reconnect-after-rebooting-router/285/9 "2020-04-01T22:45:19Z")

</div>

That sounds like a possible solution!

Macros unfortunately can’t trigger a reset at this time, but perhaps i could add that capability 🙂  
It is possible to trigger a reset with `[WLED-IP]/reset`, but you’d need an external sender for it.

---

<div class="post-metadata">

### Author: ![phrozen77](https://avatars.discourse-cdn.com/v4/letter/p/a587f6/32.png) [@phrozen77](https://wled.discourse.group/u/phrozen77)
#### Post date: [April 5, 2020, 3:35pm UTC](https://wled.discourse.group/t/wifi-doesnt-reconnect-after-rebooting-router/285/10 "2020-04-05T15:35:56Z")

</div>

I seem to be having a similar issue, after a power cut, my router takes around 3 minutes until WiFi is available again, the NodeMCU is booted at the same time.

If I reset the NodeMCU, it connects straight away.

On power loss and not being connected to the WiFi it will not open the AP (even though it is configured to do so)…

Since the PSU and the NodeMCU is in the attic, I have to get the ladder every time and that su… er, is a bit unfortunate…

Maybe you can try to reconnect to the WiFi until it can ping the router? To add, I don’t have static IPs set up, everything is configured via DHCP on my Pihole…

Thanks in advance!

---

<div class="post-metadata">

### Author: ![Aircoookie](https://yyz2.discourse-cdn.com/free1/user_avatar/wled.discourse.group/aircoookie/32/2_2.png) [@Aircoookie](https://wled.discourse.group/u/Aircoookie)
#### Post date: [April 5, 2020, 10:11pm UTC](https://wled.discourse.group/t/wifi-doesnt-reconnect-after-rebooting-router/285/11 "2020-04-05T22:11:57Z")

</div>

Interesting! Just to confirm, you are running WLED 0.9, right? It might be that the ESP connects, but doesn’t get a DHCP response because the router is not yet initialised. Can you try if setting a static IP resolves the issue? (just to confirm my hypothesis)

Not opening the AP also seems to indicate that the ESP indeed “thinks” it is already connected, even though it might not have an IP assigned.
