I'm busy developing firmware for the ESP8266 module that needs to communicate with my modile app.
I use, softAP mode with IP 192.168.4.1 to pair the device to my mobile phone and my wifi network...that works fine. Then I connect to my home wifi network and get an IP address to communicate with the device but to no avail.
I can't even ping it from my laptop.
I use the module on other projects using AT commands and I have not had the same issue. Its just now that I'm using Arduino, it doesn't work.
The ESP8266 in question is running as a server that responds to requests from my mobile app.
What is device isolation? And how can I possibly fix the issue?
Device isolation means that the router don't let device A see device B on the same WiFi network and vice versa. Most routers allow to disable that feature but I've seen some that have this "feature" constantly turned on.
It might help to show us the code that does not work (above code shows the version where the ESP is the access point).
In the code above, under WIFI_Init(), I check if credentials where set, then if they where, I connect to the WIFI network that was configured. After the WiFi.begin(), I connect to the WiFi network successfully, and get the IP address, but I can't talk to it or even ping it for that matter.
Just some other information that might be useful, the ESP8266 that I am using is on the SONOFF Basic Switch.
I use a rather different way of setting up my connections, but let's see what we can do. if you change Serial.print(data.fields.devIP); to Serial.print(WiFi.localIP());
So i tend lto leave the WiFi.mode() out, just start up as WiFi.softAP(apname,appass); then connect to a Station (my router) using WiFi.begin(stname, stapass); and after successfully connecting using something like your
while (WiFi.status() != WL_CONNECTED)
{
delay(500);
Serial.print(".");
}
do WiFi.reconnect(); to reconnect to any device that was connected to the AP (connecting to an STA drops the AP-connection) You can determine is your Router is the issue btw by connecting to the AP and entering the STA IP-address (instead of the 192.168.4.1) because if the connection is there that IP-address will also bring you to your home page.
In the code above, under WIFI_Init(), I check if credentials where set, then if they where, I connect to the WIFI network that was configured. After the WiFi.begin(), I connect to the WiFi network successfully, and get the IP address, but I can't talk to it or even ping it for that matter.
That code doesn't compile so it's definitely no usable to help us track your problems.