#include #include #include #include #include DHT dht(4, DHT22); ESP8266WiFiMulti WiFiMulti; void setup() { pinMode(2, OUTPUT); Serial.begin(115200); for(uint8_t t = 4; t > 0; t--) { Serial.printf("ootab %d...\n", t); Serial.flush(); delay(1000); } WiFi.mode(WIFI_STA); WiFiMulti.addAP("TLU", ""); } void loop() { digitalWrite(2, LOW); delay(1000); digitalWrite(2, HIGH); delay(1000); Serial.println(dht.readHumidity()); Serial.println(dht.readTemperature()); Serial.println(); HTTPClient http; String aadress="http://minitorn.tlu.ee/~jaagup/oma/too/18/04/sensor.php?niiskus="; aadress+=String(dht.readHumidity()); aadress+="&temperatuur="; aadress+=String(dht.readTemperature()); http.begin(aadress); int httpCode = http.GET(); String payload = http.getString(); Serial.println(payload); if(payload[0]=='1'){ digitalWrite(2, HIGH); Serial.println("sees"); } else { digitalWrite(2, LOW); Serial.println("valjas"); } delay(9000); }