NodeMCU + LED Strips -> Problem with WIFI connectivity

Hey!… hoping this is the right spot to ask some help on this.

I've been getting into some DYI projects with arduino and home automation and a while ago I made some light strips following this guide (its in German but Google translate or Chrome makes wonder :P). For that I used a bunch of LED strips I had leftover from another project and a NodeMCU I bought from Amazon. The code I'm using is this one here.

The problem I'm having is that while everything works great and I can both see the Arduino posting topics to the MQTT broker and control the lights from my home-assistant instance it eventually stops working with what I think is some kind of connectivity/wifi issue. It will basically still show up as connected when looking at the router's admin UI but pinging the device doesn't work and of course operating the lights either.

Reading and doing some research I found out something about these chips having issues with the 2.4ghz band with bandwidth other than 20mhz and with some channels as well so I set everything to manual on the router but it still works only temporarily. Something like once ever 24ish hours or so it stop working and to make it come up I need to make any change on the router that forces the wifi adapter to be rebooted (like changing the channel, bandwidth, whatever).

I also read something about the WIFI mode and sleep settings for the adapter/arduino so I tweaked those as well but still the same results.

Here's the relevant code for the WIFI settings:

void setup_wifi() { delay(10); // We start by connecting to a WiFi network Serial.println(); Serial.print("Connecting to "); Serial.println(ssid); WiFi.setSleepMode(WIFI_NONE_SLEEP); WiFi.mode(WIFI_STA); WiFi.begin(ssid, password); while (WiFi.status() != WL_CONNECTED) { delay(500); Serial.print("."); } Serial.println(""); Serial.println("WiFi connected"); Serial.println("IP address: "); Serial.println(WiFi.localIP()); } 

Being pretty new at this I have no idea how to troubleshoot this so… any pointers? Anything I should look into or try?.

Thanks!.

Touch here for the full post on the Arduino Apprentices tumblr

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s