I am running OH3 Rev 3.2 and publish sequential message-stamped string-packets to MQTT Mosquitto every 10-seconds. I have recently noticed that the packet transmissions are delayed by 1 packet. IE, when packet number x is published by OH3, packet number x-1 is instantaneously received by MQTT.fx
The OH3 terminal reports:
16:33:40.871 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'OHOB_WM_String' changed from 08/28/21 @ 04:33:20 PM >
MsgStamp:26587;
00:25;
MsgStamp:26587;
EOS< to 08/28/21 @ 04:33:30 PM >
MsgStamp:26588;
00:25;
MsgStamp:26588;
EOS<
The OH3 rule code is:
OHOB_WM_String.postUpdate(OHOB_String + "\nMsgStamp:" + HS5150_Msg_Counter_Now + ";" + "\n" + "EOS<")
var mqttActions = getActions("mqtt","mqtt:broker:hsbroker")
mqttActions.publishMQTT("/WatchMan/OHOB_WM_String", OHOB_WM_String.state.toString)
It appears OH3 is not flushing the packet buffer until the subsequent packet buffer is published.
Here is my config:
binding = network,mqtt,wemo,exec,mail
The .items file:
String OHOB_WM_String "Outbound String[%s]" {channel="mqtt:topic:hsbroker:WatchManThing:HS5150ToWM"} // From OpenHAB to Arduino
The .things:
// MQTT ##########################################################################################################################
// This binding has no configuration options ( .cfg file), all configuration is done at the Thing level.
Bridge mqtt:broker:hsbroker "hsbroker" [ host="10.0.0.9", secure=false ] {
Thing topic WatchManThing "From WatchMan"
{
Channels:
Type string: HS5150ToWM "OpenHAB to Arduino" [commandTopic="/WatchMan/OHOB_WM_String"] // OpenHAB Send to Arduino
Type string: WMReplyToHS5150 "OHC_MsgStamp" [stateTopic="/OHIB/OHM/MsgStamp"] // Arduino Reply to OpenHAB
Mosquitto MQTT is configured with all default parameters. The only lines are:
listener 1883
allow_anonymous true
Any help would be appreciated.
Thanks in advance.