When the ESP8266 acting as a station, and connected to an AP, how can user know the AP's IP address? I went through the API docuement "2c-esp8266_non_os_sdk_api_reference_cn", I didn't find a proper API to do this. Can you provide some hints or solution to get AP's IP address? Thanks.
For example, I've got the following replies (bold text) to that command:
+CIFSR:APIP,"192.168.4.1" - AP address
+CIFSR:APMAC,"1a:fe:34:fe:89:8d" - AP MAC
+CIFSR:STAIP,"192.168.1.104" - station address
+CIFSR:STAMAC,"18:fe:34:fe:89:8d" - station MAC
Thanks for your reply. I tried this using the latest AT firmware, but there is no information about AP's IP. Please check the information as below:
AT version:18.104.22.168(Jul 14 2016 18:54:01)
compile time:Jul 22 2016 12:02:54
ftdiyun wrote:I tried this using the latest AT firmware, but there is no information about AP's IP
Perhaps you forgotten to enable AP by AT+CWMODE_CUR. Use either AT+CWMODE_CUR=2 or AT+CWMODE_CUR=3. Here is my initialisation sequence:
After that I can query IP addresses:
AT+CWMODE_CUR=3, means "softAP + station mode", the AP's IP address is the module its own SoftAP's address. It's not the gateway's IP address. Under this mode, "AT+CIFSR" commands do print-out its own SoftAP's address IP address, but not the gateway's IP address.
I am using "AT+CWMODE_CUR=1", means "station mode" only. Under this mode, "AT+CIFSR" commands doesn't print-out the connected AP's IP address (or gateway address).
The output message of command "AT+CIFSR" is not consistent for different mode.
Who is online
Users browsing this forum: No registered users and 2 guests
Newbies Start Here
Are you new to ESP8266?
Unsure what to do?
Dunno where to start?
Start right here!
We also have a RTOS version and a MESH version too!
Complete listing of the official ESP8266 related documentation release by ESPRESSIF!
Must read here!