X-Git-Url: https://git.rvb.name/weathermon.git/blobdiff_plain/7580c60d80239c3a880e124c550c2353f8153d82..5f23c8a7c56799750221a9c2d8e904e154f8c515:/bin/weathermon?ds=inline diff --git a/bin/weathermon b/bin/weathermon index 8da4696..fdf092a 100755 --- a/bin/weathermon +++ b/bin/weathermon @@ -185,7 +185,7 @@ function processJson(str) if not mqtt_client:socket() then mqtt_client:reconnect() end - mqtt_client:publish(mqtt_path,v,0,0) + mqtt_client:publish(mqtt_path,v,0,false) mqtt_client:loop() end end @@ -248,7 +248,10 @@ function processLine(str) return '{'..name..'}' end end) - mqtt_client:publish(mqtt_path,v,0,0) + if not mqtt_client:socket() then + mqtt_client:reconnect() + end + mqtt_client:publish(mqtt_path,v,0,false) mqtt_client:loop() end end @@ -289,7 +292,10 @@ function processLine(str) return '{'..name..'}' end end) - mqtt_client:publish(mqtt_path,msg_body,0,0) + if not mqtt_client:socket() then + mqtt_client:reconnect() + end + mqtt_client:publish(mqtt_path,msg_body,0,false) mqtt_client:loop() end if alarm_exec then