Your new topic does not fit any of the above??? Check first. Then post here. Thanks.

Moderator: igrr

User avatar
By Stoney
#25188
willfly wrote:
Stoney wrote:bump !

added a wifi_station_set_auto_connect(0); to my sketch just to make doubly sure that no wifi was happening that I can think of..

still no dice, 64mA no matter what sleep option selected.
also updated to the latest arduino build..

any thoughts people ?


Code: Select allESP.deepSleep(SLEEPTIME * SECONDS, WAKE_RF_DISABLED);
should be 15 mA constant. Are you sure your measurement is correct. Can you log on to your router and verify that ESP is indeed not connected.


I am sure the current is correct, the esp is booting and running happily regardless of mode so I don't think I have a supply issue.
I am using an el cheapo multimeter on current mode with a chunky rectifier across it in case any current spikes cannot be handled by the shunt properly.

my notes ..

monitored on shitty multimeter
current ranges
200uA 1k ohm
2000uA 115 ohm
20mA 22 ohm
200mA 10.3 ohm

rectifier across meter in case of spike currents. it will not always boot in 200uA mode but I can switch it down to that range while in deep sleep.

unmodified ESP01, power led still enabled

current sketch is ..
Code: Select all
extern "C" {
  #include "user_interface.h"
  uint16 readvdd33(void);
  bool wifi_set_sleep_type(enum sleep_type type);
  enum sleep_type wifi_get_sleep_type(void);
}

#define SLEEPTIME 5
#define SECONDS 1000000

#include <ESP8266WiFi.h>

const char* ssid = "TP-LINK_blah";
const char* password = "abcdefgh";


void setup() {
  Serial.begin(115200);
  Serial.println();
  Serial.println("Booting");
  delay(5000);

 
//  Serial.print("Connecting to ");
//  Serial.println(ssid);
//  WiFi.begin(ssid, password);
//  while (WiFi.status() != WL_CONNECTED) delay(500);
//  WiFi.mode(WIFI_STA);
//  Serial.println("WiFi connected");
  Serial.print("IP address: ");
  Serial.println(WiFi.localIP());

  WiFi.disconnect();
//  client.stop();

wifi_station_set_auto_connect(0);

 delay(5000);

#define RTCSTORE 64
  uint32_t rtcpersistent , rtcnow;

  rtcnow = system_get_rtc_time();
  system_rtc_mem_read(RTCSTORE,&rtcpersistent,4);
  rtcpersistent += rtcnow;
  //system_rtc_mem_write(RTCSTORE,&rtcpersistent,4);
 
  Serial.print("wifi Sleep type = ");
  Serial.println(wifi_get_sleep_type());

  Serial.print("RTC per = ");
  Serial.println(rtcpersistent);

  Serial.print("Auto connect = ");
  Serial.println(wifi_station_get_auto_connect());
 
//method 1 .. everything is 60mA at wake up..
 
//  ESP.deepSleep(SLEEPTIME * SECONDS, WAKE_RF_DEFAULT);
//  ESP.deepSleep(SLEEPTIME * SECONDS, WAKE_RFCAL);
//  ESP.deepSleep(SLEEPTIME * SECONDS, WAKE_NO_RFCAL);
  ESP.deepSleep(SLEEPTIME * SECONDS, WAKE_RF_DISABLED);
//  ESP.deepSleep(SLEEPTIME * SECONDS);
  delay(1000);

//method 2 .. everything is 60mA at wake up..

//  wifi_set_sleep_type(NONE_SLEEP_T);  //displays sleep type 0, wakes at 62.4mA
//wifi_set_sleep_type(LIGHT_SLEEP_T);   //displays sleep type 1, wakes at 62.4mA
//  wifi_set_sleep_type(MODEM_SLEEP_T);     //displays sleep type 2, wakes at 62.4mA
//  system_deep_sleep_set_option(4);  // 0 rfcal depends on 108,1 rfcal ,2 no rfcal ,4 rf disabled

 // system_deep_sleep(5 * SECONDS); // time in uS or 0 for never wake
 
 // delay(1000);

 Serial.println("never print this");
 
}

void loop() {
}


current sits on and around 60mA until it hits sleep.
and this outputs ..

Booting
IP address: 0.0.0.0
wifi Sleep type = 2
RTC per = 1746174
Auto connect = 0
User avatar
By Stoney
#25190
Lance Henderson wrote:I have noticed this also. I had the code working on a previous build of the Arduino Package. I then updated the package (due to an NTP bug in the previous one) and I found that the micro would no longer wake into RF disabled mode.

I have been using the identical sketch code between the two.


Ok, missed this as it was on a new page :)
At least I am not going mad. Thanks.

.. ok, I recompile with the older release I still have installed, and I am now getting 14.1mA in RF_DISABLED mode.

My bad, I should have checked that it was not a staging package issue first, it was the same in the last staging package I had installed though.