I have an ESP8266 module connected to my Arduino Mega 2560. I sketched a simple code to pass whatever command I typed from the Serial Monitor to ESP8266 and vice versa:
void setup() {
Serial.begin(115200);
Serial2.begin(115200);
}
void loop() {
if (Serial.available())
{
Serial2.write(Serial.read());
}
if (Serial2.available())
{
Serial.write(Serial2.read());
}
}
So from here on I just type my AT commands inside Serial Monitor and receive the output also inside Serial Monitor. Managed to connect into a wifi network using the command:
AT+CWJAP="SSID","password"
And obtain my ESP8266 module's IP address using the command:
AT+CIFSR
+CIFSR:APIP,"192.168.4.1"
+CIFSR:APMAC,"5e:cf:7f:c2:ce:30"
+CIFSR:STAIP,"192.168.1.103"
+CIFSR:STAMAC,"5c:cf:7f:c2:ce:30"
OK
Problem is, whenever I run CMD and "ping 192.168.4.1" or "ping 192.168.1.103" from my PC which is connected to the same network, I will get "request timed out". Pinging my own PC's IP gets me a reply. What is wrong here? Totally clueless... :-/
EDIT My PC's IP address is 192.168.56.1