X-Git-Url: https://git.rvb.name/weathermon.git/blobdiff_plain/7580c60d80239c3a880e124c550c2353f8153d82..5a09d3affc63feb942e2453ccfc4143726292501:/bin/weathermon 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