Im using a Wemos D1 Mini pro powered by a 3.7 volt battery charged by a solar panel. Because of saving the battery i like to use the ESP DeepSleep so the battery will be longer for use than a few days.
After programming the DeepSleep im getting a weird baudrate after the first cycle and thats it.
Output:
closing connection
Force deepsleep 15min!
rll⸮⸮|⸮l⸮|⸮l⸮b|⸮⸮⸮⸮r⸮bl⸮b⸮⸮nn⸮lnn⸮⸮⸮bp⸮⸮lrlrl⸮r⸮n⸮b⸮nbp⸮
What im doing wrong.
Ive connected the D0 to the RST pin.
My project look like this:
#include "config.h"
//WiFi
#include <ESP8266WiFi.h>
#include <WiFiClient.h>
#include <Wire.h>
#include <ESP8266HTTPClient.h>
// MQTT configuration
//
#include <PubSubClient.h>
WiFiClient wclient;
PubSubClient MQTTclient(wclient, mqttBroker);// < =YOUR broker address
//- #include <SPI.h> //only if you'd want to use the SPI of the BMP
#include <Adafruit_Sensor.h>
#include <Adafruit_BMP280.h>
//- #include "DHT.h"
#define SLEEPPIN D0 //aanbrengen pull up
// D1 en D2, (GPIO5 and GPIO4) are SCL resp SDA and used by the BMP280
#define FORCE_DEEPSLEEP //comment when you like to use battery level dependent sleep
// Sensor configuration
//
#include <WiFiUdp.h>
#include <ArduinoOTA.h>
#include <BH1750.h>
HTTPClient http;
const char* host = HOST;
// function prototypes required by Arduino IDE 1.6.7
void setupOTA(void);
void createUrlTmp(void);
Adafruit_BMP280 bmp280;
BH1750 lightMeter(0x23);
unsigned int batt;
double battV;
byte count = 0;
void setup(void) {
Serial.begin(115200);
Serial.println("Setup Sketch...");
//- dht.begin();
Wire.begin();
if (!bmp280.begin(0x76)) {
Serial.println("no BMP detected");
delay(1000);
}
lightMeter.begin();
setupWiFi();
setupOTA();
}
void loop() {
ArduinoOTA.handle();
batt = analogRead(A0);
battV = batt * (4.2 / 1023);
Serial.print(battV);
//- float h = dht.readHumidity();
//- float t = dht.readTemperature();
delay(30000);
createUrlTemp();
createUrlPa();
createUrlAlt();
createUrlLux();
createUrlBattery();
Serial.println("Force deepsleep 15min!");
//ESP.deepSleep(15 * 60 * 1000000);
ESP.deepSleep(15 * 1000000); // for test
delay(100);
}