Hallo zusammen,
ich nutze bei meinen ESP8266 gerne Tasmota oder ESPEasy, aber diesmal ging es nicht, da ich einen digitalen Potentiometer X9C104 ansteuern wollte, der aber als libraray in den beiden genannten Paketen nicht entahlten ist. Außerdem wird auch noch ein Relais geschaltet, was aber keine besondere Herausforderung darstellt.
Ich habe mir aus Versatzstücken den Sketch zusammen gestoppelt, und er läuft auch - so lange er läuft.
Es kommt immer wieder in Abständen von 10 Minuten bis 1.5 Stunden vor, dass anscheinend die Verbindung zum MQTT-Broker verloren geht.
Bei anderen eigenen Sketchen, die auf einem ESP8266 laufen, habe ich diese Schwierigkeiten nicht.
Der Wlan-Empfang ist gut, auch dank der guten Aussattung mit UniFi-Geräten; eine schlechte Wlan-Verbindung schließe ich so gut wie aus; ping funktioniert tadellos.
Meine Frage lautet deshalb, welche Gründe könnte es geben für die Unterbrechung zum MQTT-Broker?
Gibt es Möglichkeiten, dem Fehler auf die Spur zu kommen?
Im Netz habe ich eine Anregung für "void reconnect()" gefunden (hier (https://forum.arduino.cc/index.php?topic=564058.0)), die insofern schon mal hilfreich war, dass die MQTT-Verbindung zügig wieder hergestellt wird. Die Standardbeispiele, die man so findet, haben dazu geführt, dass ein neuer Verbindungsaufbau 10~15 Minuten gedauert hat, bis wieder erkennbar Daten angekommen sind.
Hier ist die Funktion "void reconnect()" und "void loop()". An dem unter dem topic "ZIEL" gesendeten "reconnect" kann ich erkennen, dass die MQTT-Verbindung neu hergestellt wurde.
...
...
...
void reconnect() { // entsprechend dieser Vorgabe: https://forum.arduino.cc/index.php?topic=564058.0 implementiert
if (WiFi.status() != WL_CONNECTED) {
while (WiFi.status() != WL_CONNECTED) {
WiFiManager wifiManager;
uint8_t timeout = 8;
while (timeout && (WiFi.status() != WL_CONNECTED)) {
timeout--;
delay(1000);
}
}
}
if (!client.connected()) {
client.setCallback(callback);
while(!client.connected()) {
client.connect("ESP8266Client", mqttUser, mqttPassword);
uint8_t timeout = 8;
while (timeout && (!client.connected())) {
timeout--;
delay(1000);
}
if (client.connected()) {
client.publish(ZIEL, "reconnect");
client.subscribe(QUELLE);
client.subscribe(WARMWASSER_RELAY_IN);
}
}
}
else {
delay(5000);
}
}
void loop() {
if (!client.connected()) { // wenn MQTT nicht verbunden, dann reconnect
reconnect();
}
delay(10);
client.loop();
delay(10);
WiFiClient espClient = server.available();
if (!espClient) {
return;
}
unsigned long ULTIMEOUT = millis()+250;
while (!espClient.available() && (millis()<ULTIMEOUT)) {
delay(1);
}
if (millis()>ULTIMEOUT) {
return;
}
}
Und hier der gesamte Sketch:
/* Version: 2019-12-08 */
#include <ESP8266WiFi.h>
#include <ESP8266WebServer.h>
#include <WiFiManager.h>
#include <PubSubClient.h>
#include <Ticker.h>
#include <X9C.h>
#define INC 2 // D1 Mini D4 - pulled up in H/W (10k) -> chip pin 1
#define UD 15 // D1 Mini D8 -> chip pin 2
#define CS 16 // D1 Mini D0 - pulled up in H/W (10k) -> chip pin 7
/*
https://forum.arduino.cc/index.php?topic=482581.0
https://github.com/philbowles/Arduino-X9C
"up" and "down" make sense in relation to the wiper pin 5 [VW/RW] and the HIGH end of the pot
i.e. pin 3 [VH/RH], leaving pin 6 [VL/RL] unused (floating). You can easily use pin 6 instead
pin 3, but "min" will actually mean "max" and vice versa. Also, the "setPot" percentage will
set the equivalent of 100-<value>, i.e. setPot(70) will set the resistance between pins 5 and 6
to 30% of the maximum. (Of course in that case,the "unused" resistance between 5 and 3 will be 70%)
Nothing to stop you using it as a full centre-tap potentiometer, the above example giving
pin 3[H] -- 70% -- pin 5[W] -- 30% -- pin 6[L]
*/
X9C pot; // create a pot controller
int value = 20;
const int Relay_PIN = 14; // Relay is connected to GPIO14 D5
/* An das Relais wird der NTC-Temperatursensor des Warmwasserspeichers und ein fester Widerstand wechselseitig angeschlossen.
Der Widerstand ist ca. 3 kOhm groß, so dass nachts die Warmwassertemperatur auf einen Wert von > 55°C gesetzt wird.
Damit wir verhindert, dass das Warmwasser nachts vor Start der Heizung aufgeheizt wird.*/
const char* AccessPoint = "Digitaler Potentiometer"; // Macht einen AP auf, wenn der ESP sich zum ersten Mal in ein Wlan-Netz verbindet
const char* PasswordAP = "configesp";
const char* mqttServer = "192.168.xx.yy";
const int mqttPort = 1883;
const char* mqttUser = "MEINUSER";
const char* mqttPassword = "MEINPASSWORT";
const char* QUELLE = "Heizung/Widerstand/Sollwert";
const char* ZIEL = "Heizung/Widerstand/Istwert";
const char* BATT_OUT = "Heizung/Widerstand/Spannung";
const char* WARMWASSER_RELAY_IN = "Heizung/Widerstand/Warmwasser";
const char* WARMWASSER_RELAY_OUT = "Heizung/Widerstand/Warmwasser_ist";
int time_VOLTAGE = 300; // alive-Intervall für Abfrage der Betriebsspannung in Sekunden
float vccVolt;
char msg[5];
String sollRESISTANCE; // Sollwert Widerstand
String istRESISTANCE; // Istwert Widerstand
const char* ISTRESIST = istRESISTANCE.c_str(); // Umwandlung in char array (wird zum Publishen benötigt)
WiFiServer server(80); // Create an instance of the server, specify the port to listen on as an argument
WiFiClient espClient;
PubSubClient client(espClient);
Ticker tickerVOLTAGE;
void voltage() {
vccVolt = ESP.getVcc()/20000.0; // Spannung ermitteln
dtostrf(vccVolt,5,3,msg);
client.publish(BATT_OUT,msg);
}
void setup() {
Serial.begin(115200);
WiFiManager wifiManager; // Fragt beim 1. Mal nach AP und Passwort
wifiManager.autoConnect(AccessPoint, PasswordAP);
server.begin();
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.println("Connecting to WiFi..");
}
Serial.println("Connected to the WiFi network");
client.setServer(mqttServer, mqttPort);
client.setCallback(callback);
tickerVOLTAGE.attach(time_VOLTAGE, voltage);
while (!client.connected()) {
Serial.println("Connecting to MQTT...");
if (client.connect("ESP8266Client", mqttUser, mqttPassword)) {
Serial.println("connected");
} else {
Serial.print("failed with state ");
Serial.print(client.state());
delay(2000);
}
}
client.subscribe(QUELLE);
pot.begin(CS,INC,UD);
pot.setPot(value,true); // value=20 and true=save, so pot will be about 20% max. value (~ 9°C) after shutdown if you do nothing else...
client.subscribe(WARMWASSER_RELAY_IN);
pinMode(Relay_PIN, OUTPUT); // Relay GPIO14 - initialize the switch as an output and set to HIGH (off)
digitalWrite(Relay_PIN, HIGH);
}
void callback(char* topic, byte* payload, unsigned int length) {
String nachricht = ""; // Variable Nachicht leer machen
Serial.print("Message arrived in topic: ");
Serial.println(topic);
for (int i = 0; i < length; i++) {
nachricht += (char)payload[i];
}
String stringtopic = topic; // anscheinend ist es wichtig die topics in ein String-Format umzuwandeln
String stringQUELLE = QUELLE;
String stringWARMWASSER_RELAY_IN = WARMWASSER_RELAY_IN;
if (stringtopic == stringQUELLE) { // compare current topic with the topic for the resistor input
sollRESISTANCE = nachricht;
Serial.print("Sollwert Widerstand: ");
Serial.println(sollRESISTANCE); // Ausgabe des Sollwertes im seriellen Monitor
Serial.println("--------------------------");
value = sollRESISTANCE.toInt();
if (value >= 3 && value <= 97) { // Sicherheitshalber etwas Abstand von den Rändern des digitalen Potentiometers ...
pot.setPot(value,false);
}
istRESISTANCE = sollRESISTANCE; // Übergabe des IstWertes des Widerstands
ISTRESIST = istRESISTANCE.c_str();
client.publish(ZIEL, ISTRESIST);
Serial.print("Message send to topic: ");
Serial.println(ZIEL);
Serial.print("Istwert Widerstand: ");
Serial.println(ISTRESIST); // Ausgabe des Istwertes im seriellen Monitor im gleichen Datentyp, wie es gepublisht wird (const char*)
Serial.println("--------------------------");
}
else if (stringtopic == stringWARMWASSER_RELAY_IN) { // compare current topic with the topic for the relay
if (payload[0] == '1') {
digitalWrite(Relay_PIN, HIGH); // turn the switch off if the payload is '1' and publish to the MQTT server a confirmation message
client.publish(WARMWASSER_RELAY_OUT, "1");
}
else if (payload[0] == '0') {
digitalWrite(Relay_PIN, LOW); // turn the switch on if the payload is '0' and publish to the MQTT server a confirmation message
client.publish(WARMWASSER_RELAY_OUT, "0");
}
}
}
void reconnect() { // entsprechend dieser Vorgabe: https://forum.arduino.cc/index.php?topic=564058.0 implementiert
if (WiFi.status() != WL_CONNECTED) {
while (WiFi.status() != WL_CONNECTED) {
WiFiManager wifiManager;
uint8_t timeout = 8;
while (timeout && (WiFi.status() != WL_CONNECTED)) {
timeout--;
delay(1000);
}
}
}
if (!client.connected()) {
client.setCallback(callback);
while(!client.connected()) {
client.connect("ESP8266Client", mqttUser, mqttPassword);
uint8_t timeout = 8;
while (timeout && (!client.connected())) {
timeout--;
delay(1000);
}
if (client.connected()) {
client.publish(ZIEL, "reconnect");
client.subscribe(QUELLE);
client.subscribe(WARMWASSER_RELAY_IN);
}
}
}
else {
delay(5000);
}
}
void loop() {
if (!client.connected()) { // wenn MQTT nicht verbunden, dann reconnect
reconnect();
}
delay(10);
client.loop();
delay(10);
WiFiClient espClient = server.available();
if (!espClient) {
return;
}
unsigned long ULTIMEOUT = millis()+250;
while (!espClient.available() && (millis()<ULTIMEOUT)) {
delay(1);
}
if (millis()>ULTIMEOUT) {
return;
}
}
Viele Grüße Gisbert
ZitatMeine Frage lautet deshalb, welche Gründe könnte es geben für die Unterbrechung zum MQTT-Broker?
Ausser Netzwerkproblemen: der MQTT-Server muss die Verbindung unterbrechen, falls ein Client laenger als 1.5-mal der im CONNECT Nachricht angegebenen keepAlive Intervall sich nicht meldet.
Hallo Rudi,
vielen Dank für den Hinweis.
Ich habe versucht mich kundig zu machen, es ist aber weitgehend beim Versuch geblieben.
Was ich verstanden habe, ist dass das keepAlive Intervall durch den Client gesetzt wird (also meinem ESP8266), ist das richtig?
Ich nutze diese library von knolleary: https://github.com/knolleary/pubsubclient/blob/master/src/PubSubClient.h (https://github.com/knolleary/pubsubclient/blob/master/src/PubSubClient.h).
Dort steht:
// MQTT_KEEPALIVE : keepAlive interval in Seconds
#ifndef MQTT_KEEPALIVE
#define MQTT_KEEPALIVE 15
#endif
Heißt das, dass ich probieren könnte, MQTT_KEEPALIVE auf 60 Sekunden zu setzen, und dann sehe, was passiert?
Vorausgesetzt, dass es ein halbwegs sinnvolle Vorgehensweise ist.
Kann ich die Definition
#define MQTT_KEEPALIVE 60
in meinen Sketch einfügen, was für mich einfacher wäre - oder muss ich die library PubSubClient.h editieren?
Viele Grüße Gisbert
ZitatKann ich die Definition [...] in meinen Sketch einfügen, was für mich einfacher wäre - oder muss ich die library PubSubClient.h editieren?
Vermutlich fehlt noch ein "#undef" davor, sonst gibt es gemecker vom Compiler.
Pruefen, ob es geklappt hat, kannst du mit
list .* keepalive
Auf das #undef bin ich mittlerweile auch gestoßen, also so:
#undef MQTT_KEEPALIVE
#define MQTT_KEEPALIVE 60 // Standardwert ist 15 Sekunden
Wo muss/könnte ich denn diese Zeile einfügen?
Zitatlist .* keepalive
Hallo Rudi,
ich habe jetzt in den Arduino-Sketch folgendes eingefügt:
/* Version: 2019-12-08 */
#include <ESP8266WiFi.h>
#include <ESP8266WebServer.h>
#include <WiFiManager.h>
#include <PubSubClient.h>
#include <Ticker.h>
#include <X9C.h>
#define INC 2 // D1 Mini D4 - pulled up in H/W (10k) -> chip pin 1
#define UD 15 // D1 Mini D8 -> chip pin 2
#define CS 16 // D1 Mini D0 - pulled up in H/W (10k) -> chip pin 7
#undef MQTT_KEEPALIVE
#define MQTT_KEEPALIVE 60
/*
MQTT_KEEPALIVE
Standardwert ist 15 Sekunden.
Sets the keepalive interval, in seconds, the client will use.
This is used to maintain the connection when no other packets are being sent or received.
MQTT_SOCKET_TIMEOUT
Standardwert ist 15 Sekunden.
Sets the timeout when reading from the network.
This also applies as the timeout for calls to connect.
MQTT_SOCKET_TIMEOUT is how long the client will wait for data to arrive after the initial CONNECT.
*/
...
Die Kompilierung wurde anstandslos durchgeführt und der ESP8266 läuft ohne weiteres stabil - bis auf die immer noch wiederkehrenden MQTT reconnects.
D.h. die Heraufsetzung der KEEPALIVE-Zeit von 15 auf 60 Sekunden hat zunächst noch nichts bewirkt.
Die MQTT_SOCKET_TIMEOUT-Zeit hatte ich auf 15 Sekunden belassen.
Gibt es noch eine weitere Idee?
Ich versuche jetzt mal mehr Funkverkehr zu erzeugen, was mir aber eigentlich widerstrebt, da alle 5 Minuten ein update mehr als ausreichend ist.
Viele Grüße Gisbert
Aktiviere bitte "attr MQTT2_SERVER verbose 5", und zeig uns die Ausgaben fuer ca 2-3 Minuten vor der reconnect Meldung.
Hallo Rudi,
in Fhem habe ich die Abfrage-Frequenz (in einem DOIF) auf eine Minute gesetzt, aber auch das hat nicht zu einer Reduzierung der reconnects geführt.
Ich nutze nicht MQTT2_SERVER sondern old school das Modul MQTT.
Hier der log-Auszug des Devices <MyBroker> mit verbose 5, um 19:50:13 gab es einen reconnect.
Der hier besprochene Client publisht und subskribiert auf "Heizung/Widerstand/+".
2019.12.13 19:48:50 5: MQTT MyBroker message received: Publish/at-most-once /SonoffBasicVentilatorDach/Ventilator.Spitzboden.Info/Ventilator.Spitzboden.Info
32 33 30 230
2019.12.13 19:48:55 5: MQTT MyBroker message received: Publish/at-most-once /Temp-EG-Kannix/Essen/Essen
31 1
2019.12.13 19:48:55 5: MQTT MyBroker message received: Publish/at-most-once /Temp-EG-Kannix/Wohnen1/Wohnen1
31 1
2019.12.13 19:48:55 5: MQTT MyBroker message received: Publish/at-most-once /Temp-EG-Kannix/Arbeitszimmer/Arbeitszimmer
31 1
2019.12.13 19:48:55 5: MQTT MyBroker message received: Publish/at-most-once /Temp-EG-Kannix/Wohnen2/Wohnen2
31 1
2019.12.13 19:48:55 5: MQTT MyBroker message received: Publish/at-most-once /Temp-EG-Kannix/Kueche/Kueche
31 1
2019.12.13 19:48:55 5: MQTT MyBroker message received: Publish/at-most-once /Temp-EG-Kannix/Diele/Diele
31 1
2019.12.13 19:48:55 5: MQTT MyBroker message received: Publish/at-most-once /Temp-EG-Kannix/WC/WC
31 1
2019.12.13 19:49:00 5: MQTT MyBroker message received: Publish/at-most-once /SonoffBasicVentilatorDach/Ventilator.Spitzboden/Ventilator.Spitzboden
2019.12.13 19:49:01 5: MQTT MyBroker message received: Publish/at-most-once /SonoffBasicVentilatorDach/Ventilator.Spitzboden.Info/Ventilator.Spitzboden.Info
32 33 30 230
2019.12.13 19:49:01 5: MQTT MyBroker message received: Publish/at-most-once /SonoffBasicVentilatorDach/Ventilator.Spitzboden.Wifi/Ventilator.Spitzboden.Wifi
2d 36 39 -69
2019.12.13 19:49:01 5: MQTT MyBroker message received: Publish/at-most-once /SonoffBasicVentilatorDach/Spitzboden/Spitzboden
31 36 2e 34 16.4
2019.12.13 19:49:01 5: MQTT MyBroker message received: Publish/at-most-once /SonoffBasicVentilatorDach/Kondensatbehaelter/Kondensatbehaelter
2019.12.13 19:49:02 5: MQTT MyBroker message received: Publish/at-most-once /Garage/status/LWT
43 6f 6e 6e 65 63 74 65 64 Connected
2019.12.13 19:49:02 5: MQTT MyBroker message received: Publish/at-most-once /Garage/Garage.Info/Garage.System.Info
31 33 35 32 1352
2019.12.13 19:49:02 5: MQTT MyBroker message received: Publish/at-most-once /Garage/Garage.Info/Garage.Wifi
2d 37 38 -78
2019.12.13 19:49:02 5: MQTT MyBroker message received: Publish/at-most-once /Garage/Garage.Info/System.load
31 39 2e 34 19.4
2019.12.13 19:49:02 5: MQTT MyBroker message received: Publish/at-most-once /Garage/Garage.Info/Free.Stack
33 33 34 34 3344
2019.12.13 19:49:03 5: MQTT MyBroker message received: Publish/at-most-once /Garage/DHT12-Sensor/Temperature
31 30 2e 37 10.7
2019.12.13 19:49:04 5: MQTT MyBroker message received: Publish/at-most-once /Garage/DHT12-Sensor/Humidity
38 38 2e 32 88.2
2019.12.13 19:49:04 5: MQTT MyBroker message received: Publish/at-most-once /Garage/Reedsensor/Reedsensor
31 1
2019.12.13 19:49:10 5: MQTT MyBroker message received: Publish/at-most-once /SonoffBasicVentilatorDach/Ventilator.Spitzboden.Info/Ventilator.Spitzboden.Info
32 33 30 230
2019.12.13 19:49:16 5: MQTT MyBroker message received: Publish/at-most-once Heizung/Widerstand/Spannung
33 2e 32 37 37 3.277
2019.12.13 19:49:16 5: MQTT MyBroker message received: Publish/at-most-once /Temp-EG/EG.Flur/EG.Flur
31 38 2e 36 18.6
2019.12.13 19:49:16 5: MQTT MyBroker message received: Publish/at-most-once /Temp-EG/WZ/WZ
31 39 2e 39 19.9
2019.12.13 19:49:16 5: MQTT MyBroker message received: Publish/at-most-once /Temp-EG/Kueche/Kueche
32 31 2e 38 21.8
2019.12.13 19:49:16 5: MQTT MyBroker message received: Publish/at-most-once /Temp-EG/HWR/HWR
31 38 2e 38 18.8
2019.12.13 19:49:16 5: MQTT MyBroker message received: Publish/at-most-once /Temp-EG/Gaeste-WC/Gaeste-WC
32 32 2e 31 22.1
2019.12.13 19:49:16 5: MQTT MyBroker message received: Publish/at-most-once /Temp-EG/EZ/EZ
31 38 2e 39 18.9
2019.12.13 19:49:18 5: MQTT MyBroker message received: Publish/at-most-once tele/Heizung/STATE
7b 22 54 69 6d 65 22 3a 22 31 39 37 30 2d 30 32 {"Time":"1970-02
2d 32 36 54 31 33 3a 31 37 3a 31 31 22 2c 22 55 -26T13:17:11","U
70 74 69 6d 65 22 3a 22 35 36 54 31 33 3a 31 34 ptime":"56T13:14
3a 35 33 22 2c 22 56 63 63 22 3a 33 2e 32 32 35 :53","Vcc":3.225
2c 22 50 4f 57 45 52 31 22 3a 22 4f 46 46 22 2c ,"POWER1":"OFF",
22 50 4f 57 45 52 32 22 3a 22 4f 46 46 22 2c 22 "POWER2":"OFF","
57 69 66 69 22 3a 7b 22 41 50 22 3a 31 2c 22 53 Wifi":{"AP":1,"S
53 49 64 22 3a 22 49 6f 54 53 65 6e 68 61 6d 4f SId":"IoTSenhamO
47 22 2c 22 52 53 53 49 22 3a 35 36 2c 22 41 50 G","RSSI":56,"AP
4d 61 63 22 3a 22 30 45 3a 45 43 3a 44 41 3a 33 Mac":"0E:EC:DA:3
45 3a 41 38 3a 43 34 22 7d 7d E:A8:C4"}}
2019.12.13 19:49:18 5: MQTT MyBroker message received: Publish/at-most-once tele/Heizung/SENSOR
7b 22 54 69 6d 65 22 3a 22 31 39 37 30 2d 30 32 {"Time":"1970-02
2d 32 36 54 31 33 3a 31 37 3a 31 31 22 2c 22 44 -26T13:17:11","D
53 31 38 42 32 30 2d 31 22 3a 7b 22 49 64 22 3a S18B20-1":{"Id":
22 30 30 30 30 30 37 35 38 43 45 39 41 22 2c 22 "00000758CE9A","
54 65 6d 70 65 72 61 74 75 72 65 22 3a 32 31 2e Temperature":21.
36 39 7d 2c 22 44 53 31 38 42 32 30 2d 32 22 3a 69},"DS18B20-2":
7b 22 49 64 22 3a 22 30 32 31 36 30 31 34 38 44 {"Id":"02160148D
36 45 45 22 2c 22 54 65 6d 70 65 72 61 74 75 72 6EE","Temperatur
65 22 3a 35 33 2e 30 36 7d 2c 22 44 53 31 38 42 e":53.06},"DS18B
32 30 2d 33 22 3a 7b 22 49 64 22 3a 22 30 32 31 20-3":{"Id":"021
36 30 31 35 44 43 37 45 45 22 2c 22 54 65 6d 70 6015DC7EE","Temp
65 72 61 74 75 72 65 22 3a 35 37 2e 39 34 7d 2c erature":57.94},
22 44 53 31 38 42 32 30 2d 34 22 3a 7b 22 49 64 "DS18B20-4":{"Id
22 3a 22 30 33 31 36 30 35 30 38 41 31 46 46 22 ":"03160508A1FF"
2c 22 54 65 6d 70 65 72 61 74 75 72 65 22 3a 32 ,"Temperature":2
34 2e 33 37 7d 2c 22 54 65 6d 70 55 6e 69 74 22 4.37},"TempUnit"
3a 22 43 22 7d :"C"}
2019.12.13 19:49:19 5: MQTT MyBroker message received: Publish/at-most-once /Garage/status/LWT
43 6f 6e 6e 65 63 74 69 6f 6e 20 4c 6f 73 74 Connection Lost
2019.12.13 19:49:20 5: MQTT MyBroker message received: Publish/at-most-once /SonoffBasicVentilatorDach/Ventilator.Spitzboden.Info/Ventilator.Spitzboden.Info
32 33 30 230
2019.12.13 19:49:26 5: MQTT MyBroker message sent: PingReq/at-most-once
2019.12.13 19:49:26 5: SW: c000
2019.12.13 19:49:26 5: MQTT MyBroker message received: PingResp/at-most-once
2019.12.13 19:49:30 5: MQTT MyBroker message received: Publish/at-most-once /SonoffBasicVentilatorDach/Ventilator.Spitzboden.Info/Ventilator.Spitzboden.Info
32 33 31 231
2019.12.13 19:49:40 5: MQTT MyBroker message received: Publish/at-most-once /SonoffBasicVentilatorDach/Ventilator.Spitzboden.Info/Ventilator.Spitzboden.Info
32 33 31 231
2019.12.13 19:49:48 5: MQTT MyBroker message received: Publish/at-most-once tele/Heizung/STATE
7b 22 54 69 6d 65 22 3a 22 31 39 37 30 2d 30 32 {"Time":"1970-02
2d 32 36 54 31 33 3a 31 37 3a 34 31 22 2c 22 55 -26T13:17:41","U
70 74 69 6d 65 22 3a 22 35 36 54 31 33 3a 31 35 ptime":"56T13:15
3a 32 33 22 2c 22 56 63 63 22 3a 33 2e 32 32 36 :23","Vcc":3.226
2c 22 50 4f 57 45 52 31 22 3a 22 4f 46 46 22 2c ,"POWER1":"OFF",
22 50 4f 57 45 52 32 22 3a 22 4f 46 46 22 2c 22 "POWER2":"OFF","
57 69 66 69 22 3a 7b 22 41 50 22 3a 31 2c 22 53 Wifi":{"AP":1,"S
53 49 64 22 3a 22 49 6f 54 53 65 6e 68 61 6d 4f SId":"IoTSenhamO
47 22 2c 22 52 53 53 49 22 3a 35 38 2c 22 41 50 G","RSSI":58,"AP
4d 61 63 22 3a 22 30 45 3a 45 43 3a 44 41 3a 33 Mac":"0E:EC:DA:3
45 3a 41 38 3a 43 34 22 7d 7d E:A8:C4"}}
2019.12.13 19:49:48 5: MQTT MyBroker message received: Publish/at-most-once tele/Heizung/SENSOR
7b 22 54 69 6d 65 22 3a 22 31 39 37 30 2d 30 32 {"Time":"1970-02
2d 32 36 54 31 33 3a 31 37 3a 34 31 22 2c 22 44 -26T13:17:41","D
53 31 38 42 32 30 2d 31 22 3a 7b 22 49 64 22 3a S18B20-1":{"Id":
22 30 30 30 30 30 37 35 38 43 45 39 41 22 2c 22 "00000758CE9A","
54 65 6d 70 65 72 61 74 75 72 65 22 3a 32 31 2e Temperature":21.
36 39 7d 2c 22 44 53 31 38 42 32 30 2d 32 22 3a 69},"DS18B20-2":
7b 22 49 64 22 3a 22 30 32 31 36 30 31 34 38 44 {"Id":"02160148D
36 45 45 22 2c 22 54 65 6d 70 65 72 61 74 75 72 6EE","Temperatur
65 22 3a 35 32 2e 39 34 7d 2c 22 44 53 31 38 42 e":52.94},"DS18B
32 30 2d 33 22 3a 7b 22 49 64 22 3a 22 30 32 31 20-3":{"Id":"021
36 30 31 35 44 43 37 45 45 22 2c 22 54 65 6d 70 6015DC7EE","Temp
65 72 61 74 75 72 65 22 3a 35 37 2e 38 38 7d 2c erature":57.88},
22 44 53 31 38 42 32 30 2d 34 22 3a 7b 22 49 64 "DS18B20-4":{"Id
22 3a 22 30 33 31 36 30 35 30 38 41 31 46 46 22 ":"03160508A1FF"
2c 22 54 65 6d 70 65 72 61 74 75 72 65 22 3a 32 ,"Temperature":2
34 2e 33 37 7d 2c 22 54 65 6d 70 55 6e 69 74 22 4.37},"TempUnit"
3a 22 43 22 7d :"C"}
2019.12.13 19:49:50 5: MQTT MyBroker message received: Publish/at-most-once tele/Lux.Ostseite/STATE
7b 22 54 69 6d 65 22 3a 22 31 39 37 30 2d 30 32 {"Time":"1970-02
2d 32 36 54 31 37 3a 35 39 3a 30 36 22 2c 22 55 -26T17:59:06","U
70 74 69 6d 65 22 3a 22 35 36 54 31 35 3a 32 33 ptime":"56T15:23
3a 33 33 22 2c 22 56 63 63 22 3a 33 2e 31 35 36 :33","Vcc":3.156
2c 22 53 6c 65 65 70 4d 6f 64 65 22 3a 22 44 79 ,"SleepMode":"Dy
6e 61 6d 69 63 22 2c 22 53 6c 65 65 70 22 3a 32 namic","Sleep":2
35 30 2c 22 4c 6f 61 64 41 76 67 22 3a 33 2c 22 50,"LoadAvg":3,"
57 69 66 69 22 3a 7b 22 41 50 22 3a 31 2c 22 53 Wifi":{"AP":1,"S
53 49 64 22 3a 22 49 6f 54 53 65 6e 68 61 6d 22 SId":"IoTSenham"
2c 22 42 53 53 49 64 22 3a 22 46 45 3a 45 43 3a ,"BSSId":"FE:EC:
44 41 3a 33 45 3a 41 38 3a 43 34 22 2c 22 43 68 DA:3E:A8:C4","Ch
61 6e 6e 65 6c 22 3a 33 2c 22 52 53 53 49 22 3a annel":3,"RSSI":
34 32 2c 22 4c 69 6e 6b 43 6f 75 6e 74 22 3a 36 42,"LinkCount":6
2c 22 44 6f 77 6e 74 69 6d 65 22 3a 22 30 54 30 ,"Downtime":"0T0
30 3a 30 34 3a 35 35 22 7d 7d 0:04:55"}}
2019.12.13 19:49:50 5: MQTT MyBroker message received: Publish/at-most-once tele/Lux.Ostseite/SENSOR
7b 22 54 69 6d 65 22 3a 22 31 39 37 30 2d 30 32 {"Time":"1970-02
2d 32 36 54 31 37 3a 35 39 3a 30 36 22 2c 22 42 -26T17:59:06","B
48 31 37 35 30 22 3a 7b 22 49 6c 6c 75 6d 69 6e H1750":{"Illumin
61 6e 63 65 22 3a 30 7d 7d ance":0}}
2019.12.13 19:49:50 5: MQTT MyBroker message received: Publish/at-most-once /SonoffBasicVentilatorDach/Ventilator.Spitzboden.Info/Ventilator.Spitzboden.Info
32 33 31 231
2019.12.13 19:50:00 5: MQTT MyBroker message sent: Publish/at-most-once Heizung/Widerstand/Sollwert
32 34 24
2019.12.13 19:50:00 5: SW: 301f001b4865697a756e672f57696465727374616e642f536f6c6c776572743234
2019.12.13 19:50:00 5: MQTT MyBroker message received: Publish/at-most-once Heizung/Widerstand/Sollwert
32 34 24
2019.12.13 19:50:00 5: MQTT MyBroker message received: Publish/at-most-once Heizung/Widerstand/Istwert
32 34 24
2019.12.13 19:50:00 5: MQTT MyBroker message received: Publish/at-most-once /SonoffBasicVentilatorDach/Ventilator.Spitzboden.Info/Ventilator.Spitzboden.Info
32 33 31 231
2019.12.13 19:50:10 5: MQTT MyBroker message received: Publish/at-most-once /SonoffBasicVentilatorDach/Ventilator.Spitzboden.Info/Ventilator.Spitzboden.Info
32 33 31 231
2019.12.13 19:50:13 5: MQTT MyBroker message received: Publish/at-most-once Heizung/Widerstand/Istwert
72 65 63 6f 6e 6e 65 63 74 reconnect
Viele Grüße Gisbert
ZitatIch nutze nicht MQTT2_SERVER sondern old school das Modul MQTT.
Sorry, dann bin ich raus, vielleicht kann jemand mit tieferen mosquitto/etc Kenntnissen helfen.