Essayé de déployer mon nouveau système sur un SonOff, pour l'instant cela fonctionne, mais il y a très peu de RAM :-(
This commit is contained in:
24
SonOff/SonOff_2/0_send_data.lua
Normal file
24
SonOff/SonOff_2/0_send_data.lua
Normal file
@@ -0,0 +1,24 @@
|
||||
-- Petit script pour envoyer les valeurs de température sur un serveur WEB via un HTTP GET
|
||||
|
||||
function send_data()
|
||||
if verbose then print("\n 0_send_data.lua zf200119.1518 \n") end
|
||||
|
||||
if verbose then print("send_data_web: ") end
|
||||
if verbose then print(zurl) end
|
||||
|
||||
http.get(zurl, nil, function(code, data)
|
||||
if (code < 0) then
|
||||
if verbose then print("HTTP request failed") end
|
||||
if verbose then print("zuzu", code, data) end
|
||||
else
|
||||
if verbose then print(code, data) end
|
||||
end
|
||||
zurl=nil
|
||||
end)
|
||||
zurl=nil send_data=nil
|
||||
if verbose then print(node.heap()) end
|
||||
collectgarbage()
|
||||
if verbose then print(node.heap()) end
|
||||
end
|
||||
|
||||
send_data()
|
||||
Reference in New Issue
Block a user