RTOS SDK 2.1 : Switch OFF the wifi without enter in sleep mode
RTOS SDK 2.1 : Switch OFF the wifi without enter in sleep mode
Postby ThierryC49 » Tue Jun 11, 2019 5:14 pm
Hello,
I would like to switch OFF WiFi but still active the main MCU for survey process on some input and send alert by WiFi, is there any way to switch OFF the WiFi alone without entered in deepsleep mode
Thanks
Thierry,
I would like to switch OFF WiFi but still active the main MCU for survey process on some input and send alert by WiFi, is there any way to switch OFF the WiFi alone without entered in deepsleep mode
Thanks
Thierry,
Re: RTOS SDK 2.1 : Switch OFF the wifi without enter in sleep mode
Postby ThierryC49 » Wed Jun 12, 2019 11:57 pm
I post my self reply for other user (I found this information on espressif document 20a-esp8266_rtos_sdk_programming_guide_en.pdf page 28 :
to switch OFF the RF part
To switch ON the RF PART
Please comment this post if you see any limitation or miss understanding from myself
Thierry,
to switch OFF the RF part
Code: Select all
wifi_station_disconnect();
wifi_set_opmode(NULL_MODE);
wifi_set_sleep_type(MODEM_SLEEP_T);
wifi_fpm_open();
wifi_fpm_do_sleep(5*60*1000); //sleep for 1min
To switch ON the RF PART
Code: Select all
wifi_set_opmode(STATIONAP_MODE);
wifi_station_connect(); // connect to AP
Please comment this post if you see any limitation or miss understanding from myself
Thierry,
Re: RTOS SDK 2.1 : Switch OFF the wifi without enter in sleep mode
Postby Her Mary » Wed Jun 26, 2019 11:24 am
Maybe you can try force modem sleep, modem sleep is only switch off the RF afaik.
Code: Select all
void fpm_wakup_cb_func1(void)
{
wifi_fpm_close();
wifi_set_opmode(STATION_MODE);
wifi_station_connect();
}
void user_func()
{
wifi_station_disconnect();
wifi_set_opmode(NULL_MODE);
wifi_fpm_set_sleep_type(MODEM_SLEEP_T);
wifi_fpm_open();
// wakeup automatically when timeout.
wifi_fpm_set_wakeup_cb(fpm_wakup_cb_func1); // Set wakeup callback
wifi_fpm_do_sleep(50*1000);
#endif
}
Who is online
Users browsing this forum: No registered users and 180 guests
Login
Newbies Start Here
Are you new to ESP8266?
Unsure what to do?
Dunno where to start?
Start right here!
Latest SDK
Documentation
Complete listing of the official ESP8266 related documentation release by ESPRESSIF!
Must read here!
- All times are UTC+08:00
- Top
- Delete all board cookies
About Us
Espressif Systems is a fabless semiconductor company providing cutting-edge low power WiFi SoCs and wireless solutions for wireless communications and Internet of Things applications. We are the manufacturer of ESP8266EX.