-->
Page 1 of 2

WiFi station ip lease time?

PostPosted: Fri Dec 04, 2015 9:00 am
by Jon Oivind Stenerud
Is there any way to read the IP lease time for the station IP?

I am able to reconnect to the router in just 1.1 s after deep sleep without DHCP, but average 2.4 s with DHCP, so I would like to avoid connecting with DHCP until it is time to renew the lease.

I have not been able to find any information related to this in the official documentation or in this board or others. I am sure the ESP receives the information as part of the ACK from the DHCP server on the router as specified in the RFC.

Re: WiFi station ip lease time?

PostPosted: Sat Dec 05, 2015 5:40 am
by torntrousers
Not answering your question sorry, but as you're looking at static IP connect times with deepSleep and you say you can sometimes connect in about 1 second i wonder if this is effecting your ESP and if you'd try with no SPIFFS to see if you also can get the connect time down to a just couple of hundred milliseconds?

Re: WiFi station ip lease time?

PostPosted: Sun Dec 06, 2015 5:29 am
by Jon Oivind Stenerud
Interesting, but I do not see any change when setting flash size to 512 (no SPIFFs).

I am using a SparkFun ESP8266 Thing. When I change board setting to Generic ESP8266 Module, everything works fine, but like I said - no change.

I am using the AVRISP mkII programmer. Could that affect the result?

Still also very interested in finding an answer to how I can access the IP Lease time as that is what would enable me to use static IP for most wake-ups. I need 12 months battery time and the unit wakes up about 60-80 times a day, so every second counts.

Re: WiFi station ip lease time?

PostPosted: Sun Dec 06, 2015 8:44 am
by martinayotte
Jon Oivind Stenerud wrote:I am using the AVRISP mkII programmer. Could that affect the result?

You are not really using such programmer. With ArduinoIDE for ESP, as soon as Generic ESP is chosen, the Programmer menu is ignore, it is always using esptool under the hood.