Hi. I'm just started using the ESP8266 Wi-Fi Module and the one that I'm using is ESP8266-01S. I've uploaded the FirebaseDemo code to my ESP but the ESP just print "connecting........." on the serial monitor, which shows that it's not connected to the Wi-Fi.
Here are several things that I tried but it doesn't solve the problem:
I've checked my SSID and password in the code. I didn't type it wrongly.
From this post here, the ESP can't see the AP if it's in channel 13 and 14. I checked mine, it's in channel 1.
I changed the baud rate to 115200, doesn't work.
I uploaded the code to ESP8266-01 (the black one), it's not connecting to the Wi-Fi also.
Then, I try to connect to the Wi-Fi by sending AT command to my old ESP module. I want to know if there is any problem in my Wi-Fi setting which cause the ESP fails to connect to it. (I want to check the problem fast, so I didn't flash the AT firmware for the new ESP module. I just use my old ESP module since I never upload any Arduino code to that module, so the AT firmware is not corrupted.) I first send the command AT+CWMODE=1 to set it to station mode. Then I send AT+CWJAP with my SSID and password, I received "WIFI CONNECTED" and "WIFI GOT IP" on the serial monitor. So, from here I think there is no problem in my Wi-Fi setting.
Does anyone know how to solve the problem? Could there be any problem in the code? (I didn't change anything in the FirebaseDemo code except my SSID, password, FIREBASE_HOST and FIREBASE_AUTH.)
So it might due to the ESP is not being configured in station mode? May I know how do I check if the ESP is being configured in station mode? I guess it's being done in the WiFi.begin() function?
OK. So now the ESP is able to find my Wi-Fi but just can't connect to it. Any idea on how to solve this? I think I should check if the ESP is being configured in station mode, which I think I should check the code for WiFi.begin(). But I actually couldn't find the ESP8266WiFi.cpp file.
Not too experienced with the ESP8266, but I think it remembers several things from a previous sketch.
More than just SSID and password.
I always include (overwrite) the mode in setup, to AP or STA or both.
Wise to read this guide.
Leo..
I wanted to check this but I wasn't able to access the setup page of my router. Before this I have tried to changed my Wi-Fi to unprotected, because I saw some post saying that the ESP can connect to the network if the network is unprotected. But the ESP still not connected after I changed it to unprotected. So, I changed it back to the original setting (and I'm sorry that I can't remember the original setting). Now, I don't know if what I did causes me to be unable to access the router setup page.
Another thing to update you guys, I have tried to connect my ESP to my mobile hotspot and it's connected.
Hey guys! Sorry for bring up this topic again. Recently I've changed my router to a dual band router and I know the ESP won't connect to 5GHz. So now I'm again facing problem in connecting the ESP to my Wi-Fi network. Does anyone know how to solve this? Thank you.
Problem solved. There are actually 2 SSID for my Wi-Fi network. The label 2.4GHz and 5GHz are automatically added to the SSID that I set. I actually typed in the one that I set instead of the one with label added to it. After changing it to the one with label, the ESP is connecting to my Wi-Fi network now.