Skip to content

Commit 01afca1

Browse files
authored
Update PersonErkennung_esp32_cam.ino
1 parent 7efced5 commit 01afca1

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

libraries/ESP32/examples/Camera/PersonErkennung_esp32_cam/PersonErkennung_esp32_cam.ino

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ String relaise;
195195
// !!!ALIGN DATA / DATEN ANGLEICHEN !!!
196196
const char* ssid = "WlanName"; // your network SSID (name) / Wlan- Name
197197
const char* password = "WlanPassword"; // your network password / Wlan Passwort
198-
const char* mqttServer = "ip.from.mqtt.server"; // your MQTT Server / MQTT Server IP
198+
const char* mqttServer = "ip_from_mqtt_server"; // your MQTT Server / MQTT Server IP
199199
const int mqttPort = 1883; // your MQTT Port / MQTT PORT (z.B.1883)
200200
const char* mqttUser = "username"; // your MQTT Username / MQTT Benutzername
201201
const char* mqttPassword = "userpassword"; // your MQTT password / MQTT Passwort
@@ -417,12 +417,9 @@ void setup() {
417417
mqttClient.publish(wifist.c_str(), rssii.c_str()); //MQTT Server ESP32 wifi strength
418418
mqttClient.publish(wifiip.c_str(), WiFi.localIP().toString().c_str()); //MQTT Server ESP32 IP Number
419419
mqttClient.publish(inTopic.c_str(), "false");
420-
mqttClient.subscribe(inTopic.c_str());
421420
mqttClient.publish(foto.c_str(), "false");
422-
mqttClient.subscribe(foto.c_str());
423421
mqttClient.publish(relaise.c_str(), "false");
424422
mqttClient.publish(opener.c_str(), "false");
425-
mqttClient.subscribe(opener.c_str());
426423
reconnect(); //inaktive Modus
427424

428425
brightness = 0;
@@ -817,7 +814,7 @@ void interface_inactive(WebsocketsClient &client) {
817814
if (millis() - interval > door_opened_millis) { // current time - face recognised time > 5 secs
818815
digitalWrite(relay_pin, LOW); //close relay
819816
mqttClient.publish(relaise.c_str(), "false");
820-
mqttClient.publish(opener.c_str(), "false");
817+
mqttClient.publish(opener.c_str(), "false");
821818
}
822819
}
823820
ring(); //Klingel
@@ -884,16 +881,14 @@ void callback(char * topic, byte * payload, unsigned int length) {
884881
if (strTopic == inTopic) {
885882
if (strPayload == "on" || strPayload == "1" || strPayload == "true"){
886883
take_send_photo();
887-
mqttClient.publish(inTopic.c_str(), "false");
888-
mqttClient.subscribe(inTopic.c_str());
884+
mqttClient.publish(inTopic.c_str(), "false");
889885
}
890886
}
891887
else
892888
if (strTopic == foto) {
893889
if (strPayload == "on" || strPayload == "1" || strPayload == "true"){
894890
take_send_photo();
895-
mqttClient.publish(foto.c_str(), "false");
896-
mqttClient.subscribe(foto.c_str());
891+
mqttClient.publish(foto.c_str(), "false");
897892
}
898893
}
899894
else
@@ -996,8 +991,7 @@ void ring() {
996991
mqttClient.connect(espName.c_str(), mqttUser, mqttPassword); //MQTT Server ESP32 Name
997992
}
998993
mqttClient.loop();
999-
mqttClient.publish(inTopic.c_str(), "true");
1000-
mqttClient.subscribe(inTopic.c_str());
994+
mqttClient.publish(inTopic.c_str(), "true");
1001995
delay(2000);
1002996
}
1003997
}

0 commit comments

Comments
 (0)