mirror of
https://github.com/tzapu/WiFiManager.git
synced 2026-04-27 09:05:56 +03:00
[GH-ISSUE #1715] Esp8266 and deep sleep mode #1455
Labels
No labels
📶 WiFi
🕸️ HTTP
Branch
DEV Help Wanted
Discussion
Documentation
ESP32
Example
Good First Issue
Hotfix
In Progress
Incomplete
Needs Feeback
Priority
QA
Question
Task
Upstream/Dependancy
bug
duplicate
enhancement
invalid
pull-request
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/WiFiManager#1455
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @manudax on GitHub (Feb 21, 2024).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/1715
Hi,
I try to set the deep sleep mode with wifimanager and I cannot get the full deep sleep mode.
Without wifimanager I get 0.25µA in deep sleep mode but with my code even if I bypass the init in the setup I get 15mA of consuming.
Is there any solution for this issue ?
`
#include <WiFiManager.h>
#include <ESP8266WiFi.h>
#include <OneWire.h>
#include <DallasTemperature.h>
#include <RH_ASK.h>
bool SerialPrt = true; // Si on veux la sortie série
long Time2Sleep = 30e6; // Temps du Deep Sleep en secondes
String Message = "";
int CapteurTemp = 13;
int TXRF = 12;
int RXRF = 0;
int Bpy = 5; // si passé à 0 alors on bypass
RH_ASK driver(2000, RXRF, TXRF, 0);
OneWire oneWire(CapteurTemp);
DallasTemperature sensors(&oneWire);
DeviceAddress sensorDeviceAddress;
void Transmit(String ToTransmit) {
byte DataLength = ToTransmit.length() + 1;
char Data2Send[DataLength];
ToTransmit.toCharArray(Data2Send, DataLength); // Converted String to char.
driver.send((uint8_t*)Data2Send, strlen(Data2Send));
driver.waitPacketSent();
}
float GetTempDS18() {
float NewTemp = 20.5;
return NewTemp;
}
float GetVoltage() {
float Tension = 5.00;
return Tension;
}
void setup() {
pinMode(CapteurTemp, INPUT_PULLUP);
pinMode(Bpy, INPUT_PULLUP);
if (SerialPrt) {
Serial.begin(115200);
Serial.println(" ");
Serial.print("Bpy : ");
Serial.println(digitalRead(Bpy));
}
if (digitalRead(Bpy) == false) {
//********* WiFiManager *********
WiFiManager wifiManager;
WiFi.mode(WIFI_STA); // explicitly set mode, esp defaults to STA+AP
wifiManager.setConfigPortalTimeout(180);
wifiManager.autoConnect("xxx", "xxx");
//********* WiFiManager *********
} else {
// wifi_status_led_uninstall();
// WiFiMode(WIFI_STA);
WiFi.disconnect();
WiFi.mode(WIFI_OFF);
WiFi.forceSleepBegin();
delay(1);
}
}
void loop() {
delay(250);
}
`