Page 1 of 1

Speed up boot time after "deep sleep" and reduce WiFi activity

Posted: Fri Mar 13, 2020 9:36 pm
by VladVons
I try to use ESP8266 with independent aku power supply, so mimimizing power consumption is important.
DeepSleep uses 0,2 mA
Wake up and WiFi activity uses 70-150 mA for a 3-6 seconds to connect to a router.
Is it possible to reduce WiFi negotiation time?
I think assign static IP address would be a solution or something else...

Re: Speed up boot time after "deep sleep" and reduce WiFi activity

Posted: Fri Mar 13, 2020 9:40 pm
by tve
This is what I know on the topic: https://blog.voneicken.com/2018/lp-wifi-esp8266-1/

Re: Speed up boot time after "deep sleep" and reduce WiFi activity

Posted: Sat Mar 14, 2020 7:31 am
by VladVons
loading micropython kernel and init own classes
1.7 seconds

WiFi Connection
With no parameters (previous ESP ROM data):
3.5 seconds for connect

With static IP address + 'bssid' parameter:
2.5 seconds for connect

In post above from 'tve' pointed about 0.175 sec with ssid, passwd, channel, bssid, ip, mask, gw, dns
I tried, but Net.connect() 'channel' is wrong keyword for STA_IF mode

Code: Select all

Net = network.WLAN(network.STA_IF)
Net.active(True)
Net.ifconfig(('192.168.2.206', '255.255.255.0', '192.168.2.1', '192.168.2.1'))
Net.connect('MyESSID', '1971xxxx', bssid = b'\xB8\x69\xF4\xBD\x8F\xDC')
while (not Net.isconnected()):
	machine.idle()
	time.sleep(0.25)
# read DHT sensor
# send MQTT data
# deep sleep
As i understand bssid is a MAC address (B8:69:F4:BD:8F:DC) of WiFi interface MikroTik router

https://docs.micropython.org/en/latest/ ... .WLAN.html
https://docs.micropython.org/en/latest/ ... /wlan.html

But, when i connect my notebook to WiFi router with such fixed parameters it takes 0.1 seconds
ESP connects with 2.5 sec.
25 times slower as usual notebook !

Re: Speed up boot time after "deep sleep" and reduce WiFi activity

Posted: Mon Mar 16, 2020 3:59 am
by jimmo
See my reply to your other thread about setting the channel. (Note you'll need to modify the C code to make this work).

Re: Speed up boot time after "deep sleep" and reduce WiFi activity

Posted: Mon Mar 23, 2020 9:36 am
by GryKyo
Does ESPNOW work in uPython environment? As ESP8266 devices cost so little, battery powered devices could use the ESPNOW utility for very rapid boot-tx-sleep cycles where a second device is on the same permanent power supply as the WAP infrastructure. In fact the receiving device could use a serial or serial to USB interface to relay on sensor data or what ever the case may be. This is not quite as versatile as for example LoRa for either range or low power but in an instance where typical WiFi range is acceptable but typical WiFi up-time is a power issue then this is surely a compromise.

Has anybody built a ESPNOW module for micropython?

Garry

Re: Speed up boot time after "deep sleep" and reduce WiFi activity

Posted: Tue Mar 24, 2020 12:19 am
by rcolistete
GryKyo wrote:
Mon Mar 23, 2020 9:36 am
Has anybody built a ESPNOW module for micropython?
M5Stack UIFlow flavor of MicroPython has ESPNow support :
https://github.com/m5stack/UIFlow-Code/ ... ed#esp-now

Re: Speed up boot time after "deep sleep" and reduce WiFi activity

Posted: Fri Oct 08, 2021 9:58 pm
by mathieu
GryKyo wrote:
Mon Mar 23, 2020 9:36 am
Has anybody built a ESPNOW module for micropython?
Are you aware of https://github.com/glenn20/micropython-espnow-images?