-->
Page 1 of 1

Save energy.Turning off WiFi

PostPosted: Sat May 25, 2019 9:48 pm
by Nikolay
To manage WiFi, you need to change the function name call_user_start in the library libmain.a, for example, to the name call2user_start, correct one byte in two places, and insert the following function into your program:
--------
void call_user_start()
{
volatile uint32 * rtc = ((uint32 *) 0x60000700); rtc [4] = 0; rtc [0] = 0;
// works here with sensors. ESP8266 current 15ma instead of 70ma
call2user_start ();
}

Re: Save energy.Turning off WiFi

PostPosted: Sun May 26, 2019 6:12 pm
by davydnorris
Can't you simply call wifi_set_opmode() to turn off the radio by default? Wrap it in an if statement so that you don't repeatedly write to flash:

Code: Select allif (wifi_get_opmode_default()) {
       wifi_set_opmode(NULL_MODE);
}


You can also use system_phy_set_rfoption(3) to turn off the RF calibration on wake up