-->
Page 1 of 1

[solved] Newbie problem: CIFSR does not deliver IP address

PostPosted: Sun Dec 07, 2014 11:26 am
by walt22
Hi,

I got my ESP running and it works well, but with one exeption:
AT+CIFSR delivers "ERROR" instead of the IP address.

As a host, I use a STM32, which communicates with the ESP at 115200 Baud. It initialize the ESP with the following sequence:
Hard reset
AT+RST => OK...ready
AT+CWMODE=3 => no change
AT+CIPMUX=1 => OK
AT+CWJAP=.... => OK
AT+CIFSR => ERROR
Afterwards I start a TCP-Server and send and receive messages from a PC client without errors.

In case, I perform the same sequence by hand via Teraterm, the IP address will given properly.
My chip is ESP8266EX, firmware is 0016.

Any idea what the reason for this is? New firmware?

Many thanks for your hints
Walter

Re: Newbie problem: CIFSR does not deliver IP address

PostPosted: Sun Dec 07, 2014 1:59 pm
by platforma
AT+CWJAP takes a few seconds to join your AP, if you're trying to get your IP too fast, it will indeed, return an error.
Does it work if you do it manually? Just try sending commands one by one, or put a few second delay in your code after connecting to the AP.

Re: Newbie problem: CIFSR does not deliver IP address

PostPosted: Sun Dec 07, 2014 3:24 pm
by walt22
Hi platforma,

Many thanks for your hint. I have put a 5 sec. delay between the two commands and now the IP address is delivered.
The former 1 sec. delay was not long enough.

Many thanks again and best regards

Walter

Re: Newbie problem: CIFSR does not deliver IP address

PostPosted: Sun Dec 07, 2014 6:35 pm
by platforma
That's all good, glad to be of help!
The worst thing is you can't predict the amount of time it'll take to connect. But you can have some more clever stuff like timing out if IP is not received and trying to reconnect again...etc. etc.
Mark the thread as [solved] so others can find the solution quicker :)