Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use QoS=2 when clearing set-topics #2430

Merged
merged 1 commit into from Oct 5, 2022

Conversation

yankee42
Copy link
Contributor

@yankee42 yankee42 commented Oct 5, 2022

Siehe auch im Forum diverse Beiträge im Berechnung+Manuell Support-Thread, insbesondere meine "Diskussion" mit zut ab hier bis Seite 16 und dort insbesondere die gefundene Ursache ab hier (auf Seite 15).

Die Web-UI sendet Befehle an die openWB mit QoS=2:

message.qos = 2;

Das ist auch sinnvoll, denn der Befehl soll auch jeden Fall ausgeführt werden, also qos>=1 und er soll nicht mehrmals ausgeführt werden, also QoS=2.

Die OpenWB cleared das Topic aber mit QoS=0:

client.publish(msg.topic, "", qos=0, retain=True)

Dadurch ist die Reihenfolge in der die Nachrichten kommen nicht garantiert. Wie in dem entsprechenden Thread im Forum zu sehen ist, ist das Problem nicht nur theoretisch, sondern zumindest in Verbindung mit der openWB-Cloud real: Manchmal kommt die "clear"-Nachricht in der Cloud vor dem "set" an. Damit verliert das "clear" seine Wirkung und wenn die Verbindung zwischen openWB und Cloud unterbrochen und erneut aufgebaut wird, ist noch eine alte Nachricht mit "retain" in der Cloud und führt dazu, dass ungewollte Befehle ausgeführt werden.

Dieser PR behebt das Problem, indem auch das "clear" mit QoS=2 gesendet wird.

…b-UI use the same QoS and otherwise the order of messages is not guaranteed
@benderl benderl merged commit 7bd299e into snaptec:master Oct 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants