Ajouté maintenant la boot reason dans Grafana afin de savoir pourquoi il a redémarré

This commit is contained in:
Christian Zufferey
2020-06-07 16:01:52 +02:00
parent e6d7448d77
commit 048174d44a
4 changed files with 19 additions and 9 deletions

View File

@@ -2,7 +2,12 @@
Version pour l'installation solaire qui se trouve sur le toit !
zf200603.2015
zf200607.1211
Profilage de fuites mémoire sur IoT avec Lua
https://docs.google.com/document/d/1H96RfhmMhTz6i1bq8uWTP3cOSOQD-78dgeGNKpzsJRg/edit?usp=sharing
**ATTENTION:<br>
Ce README est parti d'un autre projet similaire, donc pas tout juste pour ce projet**

View File

@@ -1,5 +1,5 @@
# Quelques commandes remote (luatool) à envoyer avec le plugin Atom-IDE-terminal de l'éditeur Atom
# zf200607.1109
# zf200607.1550
Todo à faire pour ce projet !
@@ -88,6 +88,10 @@ export zport="23000"
telnet -rN $zIP $zport
verbose=false
= node.bootreason()
# https://nodemcu.readthedocs.io/en/master/modules/node/#nodebootreason
for k,v in pairs(_G) do print(k,v) end
verbose=true
~.
@@ -95,10 +99,6 @@ verbose=true
./luatool.py --ip $zIP:$zport -f boot.lua
./luatool.py --ip $zIP:$zport -f 0_get_power.lua
./luatool.py --ip $zIP:$zport -f z_index.html
./luatool.py --ip $zIP:$zport -f 0_send_data.lua
./luatool.py --ip $zIP:$zport -f 0_cron.lua
./luatool.py --ip $zIP:$zport -f 0_http_post.lua
./luatool.py --ip $zIP:$zport -f 0_htu21d.lua

View File

@@ -1,6 +1,6 @@
-- Scripts à charger après le boot pour démarrer son projet
print("\n boot.lua zf200606.1312 \n")
print("\n boot.lua zf200607.1549 \n")
-- function ztime_stamp() return tmr.now()/1000000 end
@@ -12,8 +12,12 @@ function boot()
f = "0_http_post.lua" if file.exists(f) then dofile(f) end
collectgarbage() print(node.heap())
http_post(influxdb_url,"energy,memory=boot_"..yellow_id.." ram="..node.heap())
_, boot_reason = node.bootreason()
zarg_boot= "energy,memory=boot_"..yellow_id.." ram="..node.heap().."\n"
zarg_boot=zarg_boot.."energy,boot=boot_reason_"..yellow_id.." err="..boot_reason
http_post(influxdb_url,zarg_boot)
boot_reason = nil
-- f = "0_zdyndns.lua" if file.exists(f) then dofile(f) end
-- print(node.heap()) collectgarbage() print(node.heap())

View File

@@ -0,0 +1 @@
{"url": "https://docs.google.com/open?id=1H96RfhmMhTz6i1bq8uWTP3cOSOQD-78dgeGNKpzsJRg", "doc_id": "1H96RfhmMhTz6i1bq8uWTP3cOSOQD-78dgeGNKpzsJRg", "email": "christian.zufferey@gmail.com"}