Hello there, I wasn't able to complete a tutorial even though I did all the steps as best as I could, so I hope someone who has run into this same problem can help
I was following this Wifi Manager with AsyncWebServer. I used PlatformIO and I have set the 'platform = espressif32@3.5.0' due to recent error. I've uploaded the website filesystem images in a data folder, so I'm certain I haven't missed any steps.
I was able to connect to the ESP32 access point at 192.168.4.1, and finished setting up the wifi SSID and password. I've seen the serial monitor successfully connect to wifi and display the IP 192.168.1.200. I then connect my phone to the same wifi SSID, but when I type in 192.168.1.200, it immediately responds with an error page, stating that "This site can't be reached" and "192.168.1.200 refused to connect". I think the ESP32 is there in the network, but it's not serving the index.html file? I'm not entirely sure what's going on
I'm not too sure what I did wrong or what I missed, but I've combed over the tutorials for a few hours now.... I greatly appreciate it if you guys could help me out
remove your SSID and your password from the code and then
post your complete sketch as a code-section.
Without seeing your sketch this could be caused by dozens of different things.
A wifi-manger does only wifi-managing nothing else.
The wifi-manager shows his wifi-managing website but this doe snot mean that everything is already there for showing additional websites.
You have to add extra-code for a a website that shall be shown.
EDIT:
To analyse what is going wrong you should add additional serial debug-output inside that functions that are called if you make a request to your ESP32
I've linked the tutorial in my post. They have all the debug included, I simply used their code and followed the steps. I'm honestly baffled cause I'm not sure what I could've missed.
I'm not too familiar with using ESP32 as a webserver with files stored in flash. The SPIFFS-files-system is deprecated. The new filesystem is called littleFS
this might be relevenat but I'm not sure.
You should post the serial output that you get as a code-section
adjust the compiler to write maximal information and then post the compiler-log as a code-section too.
How should anybody analyse what might be the problem without information what is really going on?
I've finally found the problem. It seems that the problem comes when you set the ESP32 wifi address to a static IP address, in this case, it's 192.168.1.200. When I commented out the part that sets ESP32 local IP and gateway and prints its local address after connecting to the wifi, everything worked when I connect to the local address that the ESP32 provided. This is what I commented out
if (!WiFi.config(localIP, localGateway, subnet)){
Serial.println("STA Failed to configure");
return false;
}
I'll have to check why it doesn't work when it config the wifi like that
It's because the static IP given to it (192.168.1.200) was invalid to my ESP32. When I start Wifi without configuring the IP, I got gateway IP = 192.168.113.1 and subnet mask = 255.255.255.0. Therefore, a valid static IP can only be like 192.168.113.XXX
So yeah, setting the static IP to 192.168.113.200 solved the problem.
Yes, you must join a subnet that actually exists. If you really must have the ESP32 on a "static" IP address, it's best to do that with your WiFi router instead of the ESP. Use the router's configuration web page to assign a fixed IP address to the ESP's MAC address. That way the ESP can continue using DHCP while always getting the same IP address from the router.
Yeah, the main problem that I had was because I was following a tutorial that guides you to create a web server on the ESP32. They seem to have a newer ESP32 model that supports subnet 225.225.0.0 and they set a default custom IP to 192.168.1.200 (so that the user can easily check out the website). My ESP32 seems to be an older model, so it doesn't work with what they wrote.
NOPE. More likely problem is that your router is set up for subnet 192.168.113/24. So there's no possible way for any station to connect with an address like 192.168.1.200. That's just the way subnets work. The issue is entirely with your router's configuration.