You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, does anyone have an example code with wprking status url? I really don't know how to do this. All I wanna do is turn on and off the built in led of my WeMos D1 and also have the status.
The text was updated successfully, but these errors were encountered:
When homebridge-http is sending the reqest to switch on or off something, you must not only get that reqest, but you must answer on it with 200 code. Here is the part of my code, that helped me to solve this problem:
server.on("/ON", light_on);
void light_on(){ server.send(200, "text/plain"); digitalWrite(green_led, 1); Serial.println("LED ON"); }
In the server.send(200, "text/plain"); I'm not sending nothing exept code 200.
Answering on status request: if(digitalRead(green_led)) server.send(200, "text/plain", "1"); else server.send(200, "text/plain", "0");
Hello, does anyone have an example code with wprking status url? I really don't know how to do this. All I wanna do is turn on and off the built in led of my WeMos D1 and also have the status.
The text was updated successfully, but these errors were encountered: