Monthly Archives: October 2023

Problems with ESP32 configures as both Client and AP

In one project I had an ESP32 configured both as Access Point (AP) and as a Wifi Client. Everything was fine, until I changed my home Wifi password.

After changing the home Wifi password I wanted to change the Wifi password set on the device through the Web UI I made and hosted on the device. The problem started there. I was unable to access the UI.

Reviewing the code realised that the Wifi Client is continuously trying to re-establish the connection in a loop. And hence is unable to process the incoming request and process the page.

So either need to stop the scanning from time to time or stop the scanning when an AP client is connected. For short and fast resolution I stopped the wifi connection retry when a client is connected to AP.

WiFi.softAPgetStationNum()

FASTLed Library and RGB Led

Recently I was trying to make a device that will indicate different status through different light colors.

Now after developing everything a strange thing started to happen – the RGB LED was not showing the colors properly. For example – suppose the current color is Green and then I put Red. It is not glowing pure RED, the Green pixel (the individual green pixel of the LED) is still faintly on.

After some thoughts and searches found the solution is to first turn of the LED fully

leds[0] = CRGB::Black;
FastLED.show();

and then show the new color.

Hope this helps someone.