From 4304e9128bfb0a1d6d4bd8218d4f12335270168c Mon Sep 17 00:00:00 2001 From: hans-jurgen Date: Tue, 17 Sep 2024 15:20:26 +0200 Subject: [PATCH] 2024-09-1701 --- platformio.ini | 4 ++-- src/main.cpp | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/platformio.ini b/platformio.ini index 119237a..4e7d2d5 100644 --- a/platformio.ini +++ b/platformio.ini @@ -29,8 +29,8 @@ build_flags = ${env.build_flags} -DGATEWAY=\"192.168.127.1\" -DDNS=\"192.168.127.1\" -DKMYIP=\"192.168.127.42\" - -Dmqtt_server=\"hjkmqtt.dedyn.io\" - -Dmqtt_port=61883 + -Dmqtt_server=\"192.168.127.193\" + -Dmqtt_port=1883 diff --git a/src/main.cpp b/src/main.cpp index 23d4661..f6a6390 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -19,7 +19,7 @@ WiFiClient espClient; PubSubClient client(espClient); -#define mqtt_port 61883 +#define mqtt_port 1883 //cf:d7:ab:1f:24:2c String Adresse = "96:33:bb:bf:ff:ab"; // Bluetooth Adresse die zu Anwesenheitserkennung überwacht wird ET585 @@ -110,7 +110,7 @@ static void setup_wifi() { } Serial.println(" WiFi connected"); client.setServer(mqtt_server, mqtt_port); - //client.setCallback(callback); + client.setCallback(callback); Serial.print("IP address: \t"); Serial.println(WiFi.localIP()); } @@ -165,6 +165,7 @@ void setup() digitalWrite (RelaisPin, LOW); Serial.begin(115200); Serial.println(""); + setup_wifi(); Serial.println("Starte BLE Scanner"); pServerAddress = new BLEAddress(Adresse.c_str()); BLEDevice::init("");