The use of the ESP8266 in the world of IoT

User avatar
By tgcoder
#53799 I'm trying to connect to an ESP8266 ESP-12 using an AT+CIFSR command to get the IP address. Here is my sequence of commands.

AT+RST
AT+CWMODE=1
AT+CWDHCP=1,1
AT+CIFSR

Returns:
+CIFSR:STAIP,"0.0.0.0"
+CIFSR:STAMAC,"18:fe:34:f4:ce:c4"

On an AT+GMR command, I get:
AT version:0.21.0.0
SDK version:0.9.5

Am I missing a step or something here?
Terry
User avatar
By tgcoder
#53908 What I finally figured out is that I needed to quit the AP with an AT+CWQAP and then rejoin with an AT+CWJAP. After doing that doing an AT+CIFSR gave me a valid IP address. Therefore:

AT+CWQAP ==> quit the AP
AT+CWJAP ==> join the AP
AT+CIFSR ==> valid IP address now.