Only having an issue wiht the image. I just get a blue square. Is that correct?
And one question: How to genereate the code for an image?
Explore... Chat... Share...
Moderator: igrr
taoyanren wrote:on WIFI_AP_STA mode, I can only access the station ip webserver but can not open AP ip webserver( http://192.168.4.1/) at the same time. Why?
#include <ESP8266WiFi.h>
#include <ESP8266WebServer.h>
String form = "<form action='led'><input type='radio' name='state' value='1' checked>On<input type='radio' name='state' value='0'>Off<input type='submit' value='Submit'></form>";
ESP8266WebServer server(80);
const int led = 13;
void handle_led() {
int state = server.arg("state").toInt();
digitalWrite(led, state);
server.send(200, "text/plain", String("LED is now ") + ((state)?"on":"off"));
}
void setup(void) {
Serial.begin(115200);
Serial.println("");
pinMode(led, OUTPUT);
WiFi.mode(WIFI_STA);
WiFi.disconnect();
delay(100);
WiFi.softAP("ESP_WiFiSwitch");
Serial.println(WiFi.softAPIP());
server.on("/", [](){
server.send(200, "text/html", form);
});
server.on("/led", handle_led);
server.begin();
Serial.println("HTTP server started");
}
void loop(void) {
server.handleClient();
}
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[…]