I tried this, so i have two esp32 boards with me one is dev kit and other one is the nodemcu. And the wifi problem is only occuring in nodemcu because my other esp is able to detect and connect just fine with hotspots and wifi routers. But the nodemcu wasnât even detecting ANY of the networks. And it was only one connection name from all the neighborhood that it was able to detect and that too for just moments and then it couldnât. So maybe is there a problem with the nodemcu board??
So i tried to work it again but just in another city where i had come for work, and tried to scan for networks. And to my surprise i saw that it was able to read Many! Networks, not all, but still many. Now i am more confused as to what the problem could be. However, My phone hotspot was still not detected, neither was my router. I tried to run the following code.