{"id":1090,"date":"2023-10-11T18:45:35","date_gmt":"2023-10-11T17:45:35","guid":{"rendered":"https:\/\/www.kolkataonweb.com\/code-bank\/?p=1090"},"modified":"2025-02-09T19:26:03","modified_gmt":"2025-02-09T19:26:03","slug":"problems-with-esp32-configures-as-both-client-and-ap","status":"publish","type":"post","link":"https:\/\/www.kolkataonweb.com\/code-bank\/arduino\/problems-with-esp32-configures-as-both-client-and-ap\/","title":{"rendered":"Problems with ESP32 configured as both Client and AP"},"content":{"rendered":"<p>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.<\/p>\n<p>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.<\/p>\n<p>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.<\/p>\n<p>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.<\/p>\n<pre class='wp-code-highlight prettyprint'>WiFi.softAPgetStationNum()<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>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&hellip; <a class=\"more-link\" href=\"https:\/\/www.kolkataonweb.com\/code-bank\/arduino\/problems-with-esp32-configures-as-both-client-and-ap\/\">Continue reading <span class=\"screen-reader-text\">Problems with ESP32 configured as both Client and AP<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10,373,64],"tags":[415,417,14,418,416],"class_list":["post-1090","post","type-post","status-publish","format-standard","hentry","category-arduino","category-electronics","category-esp-8266","tag-esp32","tag-esp32-web-server","tag-esp8266","tag-esp8266-web-ui","tag-softapi","entry"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/posts\/1090","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/comments?post=1090"}],"version-history":[{"count":2,"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/posts\/1090\/revisions"}],"predecessor-version":[{"id":1097,"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/posts\/1090\/revisions\/1097"}],"wp:attachment":[{"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/media?parent=1090"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/categories?post=1090"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/tags?post=1090"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}