@@ -18,12 +18,12 @@ const char* mqttServer = "ip.from.mqtt.server"; // your MQTT Server
18
18
const int mqttPort = 1883 ; // your MQTT Port
19
19
const char * mqttUser = " username" ; // your MQTT Username
20
20
const char * mqttPassword = " userpassword" ; // your MQTT password
21
- const char * espName = " ESP32Cam " ; // your espCam Name
22
- const char * inTopic = " ESP32Cam /door/Browser" ; // your MQTT phath for activate browser 1/on/true aktivate your browser
23
- const char * msgTopic = " ESP32Cam /door/Erkannt" ; // your MQTT phath for facial recognition
24
- const char * wifist = " ESP32Cam /door/wifi" ; // your MQTT phath for facial recognition
21
+ const char * espName = " 1ESP32Cam " ; // your espCam Name
22
+ const char * inTopic = " 1ESP32Cam /door/Browser" ; // your MQTT phath for activate browser 1/on/true aktivate your browser
23
+ const char * msgTopic = " 1ESP32Cam /door/Erkannt" ; // your MQTT phath for facial recognition
24
+ const char * wifist = " 1ESP32Cam /door/wifi" ; // your MQTT phath for facial recognition
25
25
#define relay_pin 2 // pin 12 can also be used. aktivate your Relais on this pin
26
- long interval = 3000 ; // open lock for ... milliseconds
26
+ long interval = 5000 ; // open lock for ... milliseconds
27
27
String rssii;
28
28
//
29
29
//
@@ -416,6 +416,11 @@ void interface_active(WebsocketsClient &client) {
416
416
417
417
while (client.available () && websockets_active) {
418
418
client.poll ();
419
+ while (WiFi.status () != WL_CONNECTED) {
420
+ WiFi.begin (ssid, password);
421
+ delay (2000 );
422
+ websockets_active = false ;
423
+ }
419
424
420
425
// If the MQTT connection inactively, then we try to set it and to publish/subscribe
421
426
if (!mqttClient.connected ()) {
@@ -521,6 +526,11 @@ void interface_inactive(WebsocketsClient &client) {
521
526
out_res.image = image_matrix->item ;
522
527
while (!websockets_active) {
523
528
529
+ while (WiFi.status () != WL_CONNECTED) {
530
+ WiFi.begin (ssid, password);
531
+ delay (2000 );
532
+ websockets_active = false ;
533
+ }
524
534
// If the MQTT connection inactively, then we try to set it and to publish/subscribe
525
535
if (!mqttClient.connected ()) {
526
536
if (mqttClient.connect (espName, mqttUser, mqttPassword)) {
0 commit comments