Better use a 5V supply (a USB charger with >= 1A output for example will do).
Better use a 5V supply (a USB charger with >= 1A output for example will do).
Explore... Chat... Share...
Serial.setDebugOutput(true);
WiFi.mode(WIFI_STA);
#include <ESP8266WiFi.h>
#include <WiFiClient.h>
#include <ESP8266WebServer.h>
#include <ESP8266mDNS.h>
const char* ssid = "@HomeCA72";
const char* password = "";
MDNSResponder mdns;
const int led = 0;
ESP8266WebServer server(80);
void handleRoot() {
digitalWrite(led, 1);
server.send(200, "text/plain", "hello from esp8266!");
digitalWrite(led, 0);
}
void handleNotFound(){
digitalWrite(led, 1);
String message = "File Not Found\n\n";
message += "URI: ";
message += server.uri();
message += "\nMethod: ";
message += (server.method() == HTTP_GET)?"GET":"POST";
message += "\nArguments: ";
message += server.args();
message += "\n";
for (uint8_t i=0; i<server.args(); i++){
message += " " + server.argName(i) + ": " + server.arg(i) + "\n";
}
server.send(404, "text/plain", message);
digitalWrite(led, 0);
}
void setup(void){
pinMode(led, OUTPUT);
digitalWrite(led, 0);
Serial.begin(115200);
Serial.setDebugOutput(true); //burkmurray
WiFi.mode(WIFI_STA);//burkmurray
WiFi.begin(ssid, password);
Serial.println("");
// Wait for connection
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.println("");
Serial.print("Connected to ");
Serial.println(ssid);
Serial.print("IP address: ");
Serial.println(WiFi.localIP());
if (mdns.begin("esp8266", WiFi.localIP())) {
Serial.println("MDNS responder started");
}
server.on("/", handleRoot);
server.on("/inline", [](){
server.send(200, "text/plain", "this works as well");
});
server.onNotFound(handleNotFound);
server.begin();
Serial.println("HTTP server started");
}
void loop(void){
int sec = millis() / 1000;
server.handleClient();
Serial.print("work time [s]= ");
Serial.println(sec);
digitalWrite(led, 1);
delay(200);
digitalWrite(led, 0);
delay(200);
}
r??#?n?$??l`??`rn|??n?????l`?~????#?n?$???nn???l`nn?????r????pp??<??l??p??nn?????;????8rp?n???r?scandone
.scandone
add 0
aid 2
pm open phy_2,type:2 0 0
connected with @HomeCA72, channel 6
dhcp client start...
cnt
..ip:192.168.1.102,mask:255.255.255.0,gw:192.168.1.2
.
Connected to @HomeCA72
IP address: 192.168.1.102
MDNS responder started
HTTP server started
work time [s]=2
work time [s]=2
work time [s]=3
work time [s]=3
work time [s]=3
work time [s]=4
work time [s]=4
work time [s]=5
work time [s]=5
work time [s]=5
work time [s]=6
work time [s]=6
work time [s]=7
work time [s]=7
work time [s]=7
work time [s]=8
work time [s]=8
work time [s]=9
work time [s]=9
work time [s]=9
work time [s]=10
work time [s]=10
work time [s]=11
work time [s]=11
work time [s]=11
work time [s]=12
work time [s]=12
work time [s]=13
work time [s]=13
work time [s]=13
work time [s]=14
work time [s]=14
work time [s]=15
work time [s]=15
work time [s]=15
work time [s]=16
work time [s]=16
work time [s]=17
work time [s]=17
work time [s]=17
work time [s]=18
work time [s]=18
work time [s]=19
work time [s]=19
work time [s]=19
work time [s]=20
work time [s]=20
work time [s]=21
work time [s]=21
work time [s]=21
work time [s]=22
work time [s]=22
work time [s]=23
work time [s]=23
work time [s]=23
work time [s]=24
work time [s]=24
work time [s]=25
work time [s]=25
work time [s]=25
work time [s]=26
work time [s]=26
work time [s]=27
work time [s]=27
work time [s]=27
work time [s]=28
work time [s]=28
work time [s]=29
work time [s]=29
work time [s]=29
work time [s]=30
work time [s]=30
work time [s]=31
work time [s]=31
work time [s]=31
work time [s]=32
Fatal exception (0):
epc1=0x40106f82, epc2=0x00000000, epc3=0x00000000, excvaddr=0x00000000, depc=0x00000000
rm match
pm close 7 0 0/31408242
del if0
usl
sul 0 0
ets Jan 8 2013,rst cause:4, boot mode:(3,7)
wdt reset
load 0x40100000, len 28780, room 16
tail 12
chksum 0x06
ho 0 tail 12 room 4
load 0x3ffe8000, len 1548, room 12
tail 0
chksum 0x6c
load 0x3ffe8610, len 3024, room 8
tail 8
chksum 0x62
csum 0x62
r?scandone
scandone
add 0
aid 2
pm open phy_2,type:2 0 0
connected with @HomeCA72, channel 6
dhcp client start...
cnt
.ip:192.168.1.102,mask:255.255.255.0,gw:192.168.1.2
.
Connected to @HomeCA72
IP address: 192.168.1.102
MDNS responder started
HTTP server started
work time [s]=1
work time [s]=1
work time [s]=2
work time [s]=2
It takes about 20-25 seconds for home assistant c[…]
I tried to upgrade tof my sonoff basic R2 with the[…]
a problem Perhaps you want to define "Probl[…]
Rebooting your router will not give you a faster I[…]
There are no other notifications from esptool.py i[…]
Using the Arduino IDE, you'll learn how to set up […]
In this project, you will post to Twitter using an[…]
In this project, we will build a water level contr[…]
I guess I'm late, but I had the same problem and f[…]
Last night I received my first D1 Minis for a lear[…]
Although I am aware that this is an old post, I fe[…]