projects
/
weathermon.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
82c945c
)
Автопереподключение к MQTT и для случая обработки не-JSON (все еще используется на...
author
Roman Bazalevsky
<rvb@rvb.name>
Mon, 18 Feb 2019 10:16:57 +0000
(13:16 +0300)
committer
Roman Bazalevsky
<rvb@rvb.name>
Mon, 18 Feb 2019 10:16:57 +0000
(13:16 +0300)
bin/weathermon
patch
|
blob
|
history
diff --git
a/bin/weathermon
b/bin/weathermon
index ade5bfaa3f4cd80a468daaea58cecd6b3e75558a..fdf092a3406aa0c62a02fdc4954af2a618288e04 100755
(executable)
--- a/
bin/weathermon
+++ b/
bin/weathermon
@@
-248,6
+248,9
@@
function processLine(str)
return '{'..name..'}'
end
end)
return '{'..name..'}'
end
end)
+ if not mqtt_client:socket() then
+ mqtt_client:reconnect()
+ end
mqtt_client:publish(mqtt_path,v,0,false)
mqtt_client:loop()
end
mqtt_client:publish(mqtt_path,v,0,false)
mqtt_client:loop()
end
@@
-289,6
+292,9
@@
function processLine(str)
return '{'..name..'}'
end
end)
return '{'..name..'}'
end
end)
+ if not mqtt_client:socket() then
+ mqtt_client:reconnect()
+ end
mqtt_client:publish(mqtt_path,msg_body,0,false)
mqtt_client:loop()
end
mqtt_client:publish(mqtt_path,msg_body,0,false)
mqtt_client:loop()
end