ESP8266 Developer Zone The Official ESP8266 Forum 2016-11-19T16:41:11+08:00 https://bbs.espressif.com:443/feed.php?f=65&t=2276 2016-11-19T16:41:11+08:00 2016-11-19T16:41:11+08:00 https://bbs.espressif.com:443/viewtopic.php?t=2276&p=10588#p10588 <![CDATA[Re: Need help for Light sleep mode[Done]]]> We hope that Espressss' enginner can give us suggestion.

Statistics: Posted by roc2 — Sat Nov 19, 2016 4:41 pm


]]>
2016-11-08T19:16:47+08:00 2016-11-08T19:16:47+08:00 https://bbs.espressif.com:443/viewtopic.php?t=2276&p=10453#p10453 <![CDATA[Re: Need help for Light sleep mode[Done]]]> I manage to get the forced light sleep following the code provided here.
Two questions :
- you use fpm APIs, is the automatic way to enter light sleep still valid under RTOS SDK ?
- you disconnect the station before forcing the sleep state, light sleep is made to avoid this, i mean, i want let Espressif sleeps WITHOUT loosing the connection to the router ( another espressif acting as TCP Server through AT Binaries), or without the need to reconnect to the router ( it takes time..)

Did I miss something ?

I use the last SDK 1.4.2 ( patched )

Auto - Solved : Using the right API : wifi_set_sleep_type().
This way i see what expected, low current between beacons if no other task are running.

Statistics: Posted by Mdb — Tue Nov 08, 2016 7:16 pm


]]>
2016-06-15T10:05:51+08:00 2016-06-15T10:05:51+08:00 https://bbs.espressif.com:443/viewtopic.php?t=2276&p=7335#p7335 <![CDATA[Re: Need help for Light sleep mode]]>

Code:

struct softap_config {
    uint8 ssid[32];
    uint8 password[64];
    uint8 ssid_len;   // Note: Recommend to set it according to your ssid
    uint8 channel;   // Note: support 1 ~ 13
    AUTH_MODE authmode;   // Note: Don't support AUTH_WEP in softAP mode.
    uint8 ssid_hidden;   // Note: default 0
    uint8 max_connection;   // Note: default 4, max 4
    uint16 beacon_interval;   // Note: support 100 ~ 60000 ms, default 100
};

bool wifi_softap_set_config(struct softap_config *config);


Thanks for your interest in ESP8266 !

Statistics: Posted by ESP_Faye — Wed Jun 15, 2016 10:05 am


]]>
2016-06-14T17:22:04+08:00 2016-06-14T17:22:04+08:00 https://bbs.espressif.com:443/viewtopic.php?t=2276&p=7328#p7328 <![CDATA[Re: Need help for Light sleep mode]]>
one more query:
can you let me know is there any API to modify the Beacon interval & DTIM interval?

thanks,
Rupak

Statistics: Posted by rupak426 — Tue Jun 14, 2016 5:22 pm


]]>
2016-06-14T17:03:12+08:00 2016-06-14T17:03:12+08:00 https://bbs.espressif.com:443/viewtopic.php?t=2276&p=7323#p7323 <![CDATA[Re: Need help for Light sleep mode]]>
timer will prevent the chip from entering light sleep, please do NOT use timer for light sleep.
Sorry for the inconvenience, we will add it in the documentation.
You can use it as the sample code below.

Code:

#define FPM_SLEEP_MAX_TIME  0xFFFFFFF

void fpm_wakup_cb_func1(void)
{
   wifi_fpm_close();      // disable force sleep function
   wifi_set_opmode(STATION_MODE);         // set station mode
   wifi_station_connect();            // connect to AP
}

#ifndef SLEEP_MAX
// Wakeup till time out.
void user_func(...)

   wifi_station_disconnect();
   wifi_set_opmode(NULL_MODE);         // set WiFi mode to null mode.
   wifi_fpm_set_sleep_type(LIGHT_SLEEP_T); // light sleep
   wifi_fpm_open();               // enable force sleep
   wifi_fpm_set_wakeup_cb(fpm_wakup_cb_func1); // Set wakeup callback
   wifi_fpm_do_sleep(50*1000);     
}
#else

// Or wake up by GPIO
void user_func(...)

   wifi_station_disconnect();
   wifi_set_opmode(NULL_MODE); // set WiFi mode to null mode.
   wifi_fpm_set_sleep_type(LIGHT_SLEEP_T);    // light sleep
   wifi_fpm_open();               // enable force sleep

   PIN_FUNC_SELECT(PERIPHS_IO_MUX_MTCK_U,3);
   gpio_pin_wakeup_enable(13, GPIO_PIN_INTR_LOLEVEL);

   wifi_fpm_set_wakeup_cb(fpm_wakup_cb_func1);   // Set wakeup callback
   wifi_fpm_do_sleep(FPM_SLEEP_MAX_TIME);       
   ...
}
#endif

Statistics: Posted by ESP_Faye — Tue Jun 14, 2016 5:03 pm


]]>
2016-06-14T16:34:53+08:00 2016-06-14T16:34:53+08:00 https://bbs.espressif.com:443/viewtopic.php?t=2276&p=7321#p7321 <![CDATA[Re: Need help for Light sleep mode]]>
I am using SDK version as ESP8266_NONOS_SDK_V1.5.4_16_05_20.

thanks,
Rupak

Statistics: Posted by rupak426 — Tue Jun 14, 2016 4:34 pm


]]>
2016-06-14T09:49:40+08:00 2016-06-14T09:49:40+08:00 https://bbs.espressif.com:443/viewtopic.php?t=2276&p=7298#p7298 <![CDATA[Re: Need help for Light sleep mode]]>
What is the version of your SDK ?

Please have a try with the ESP8266_NONOS_SDK_V1.5.4, we solved the problem about light sleep.

Statistics: Posted by ESP_Faye — Tue Jun 14, 2016 9:49 am


]]>
2016-06-14T01:38:06+08:00 2016-06-14T01:38:06+08:00 https://bbs.espressif.com:443/viewtopic.php?t=2276&p=7297#p7297 <![CDATA[Need help for Light sleep mode[Done]]]>
I am trying to make use of light sleep for my ESP-8266-01 with the help of below code:

Serial.println("Wifi_off_timerfunc called to disable wifi");
wifi_station_disconnect();
wifi_set_opmode(NULL_MODE);
wifi_fpm_set_sleep_type(LIGHT_SLEEP_T);
Serial.println("set the sleep as LIGHT SLEEP");
wifi_fpm_open();
os_timer_disarm(&on_timer);
os_timer_setfn(&on_timer, (os_timer_func_t *)fpm_wakup_cb_func1, NULL);

In the normal mode, I measured the current and its showing 70~80mA.
But when I am measuring the current output after " LIGHT SLEEP (5th line from top)", still the measure current is 70~80mA.
can you let me know if I am missing something while invoking the "LIGHT sleep".
Also can you let me know is there any API to modify the Beacon interval & DTIM interval.

thanks,
Rupak

Statistics: Posted by rupak426 — Tue Jun 14, 2016 1:38 am


]]>