This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// CPU 80MHZ, FLASH 4M/1M | |
/* | |
*** Sample using esp-01, D16 is connected to RST | |
*** If DHT22 is powered by a gpio( VCC of DHT22 is connected to a gpio) and OUTPUT of DHT22 is connected to D2, boot will fail. | |
*** Power off ----> D2 is in LOW( == DHT22 is in LOW) ==> SDIO boot mode. | |
Temperature and humidity values are each read out the results of the last measurement. | |
For real-time data that need continuous read twice, we recommend repeatedly to read sensors, | |
and each read sensor interval is greater than 2 seconds to obtain accuratethe data. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <ESP8266WiFi.h> | |
//this sketch duplicated the flow that WiFIManager or any other connection manager would take | |
//first try to connect, if it fails spin up an AP, get some credentials from user, connect again | |
//then spin everything down | |
void setup() { | |
Serial.begin(115200); | |
Serial.println(); | |
Serial.println(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <FS.h> //this needs to be first, or it all crashes and burns... | |
#include <ESP8266WiFi.h> //https://github.com/esp8266/Arduino | |
//needed for library | |
#include <DNSServer.h> | |
#include <ESP8266WebServer.h> | |
#include <WiFiManager.h> //https://github.com/tzapu/WiFiManager | |
#include <ArduinoJson.h> //https://github.com/bblanchon/ArduinoJson |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <ESP8266WiFi.h> //https://github.com/esp8266/Arduino | |
//needed for library | |
#include <DNSServer.h> | |
#include <ESP8266WebServer.h> | |
#include "WiFiManager.h" //https://github.com/tzapu/WiFiManager | |
std::unique_ptr<ESP8266WebServer> server; | |
void handleRoot() { |
NewerOlder