Stefan Schwarzer <sschwarzer@sschwarzer.net> wrote:
On 2018-07-02 13:07, Michael S. wrote:
habe hier einen ESP8266 mit Micropython am Laufen. Der läuft 24h und sendet zyklisch Daten an einen Webserver. Gelegentlich (Tage bis Wochen) passiert es, das das Python-Script vermutlich mit einer Exception abstürzt. Wenn ich dann mit WebREPL draufschaue sehe ich, dass die Konsole funktional ist. Das bedeutet: 1. Es hat kein Reboot stattgefunden, denn dann wäre das Script über den Autostart neu gestartet worden. 2. Das Script wurde vermutlich durch eine Exception beendet.
Die mir bekannten kritischen Dinge (Netzwerk) habe ich schon mit Try/Except abgefangen. Trotzdem bricht das Skript ab.
Wie bekomme ich raus, was das für eine Exception war? Ich kann schlecht wochenlang ein Notebook mit RS232 durchlaufen lassen, um da mitzuhören.
ich habe keine Erfahrung mit MicroPython, aber sonst ist das übliche Vorgehen, auf der obersten Aufrufebene ein try/except zu verwenden und im Fehlerfall die Exception (evtl. mit weiteren Informationen) zu loggen.
Wobei ich nicht weiss, wohin man im Falle eines Netzwerkfehler noch hin loggen kann. Kann Micropython ins Flash des ESP8266 loggen? -- Dipl.-Inform(FH) Peter Heitzer, peter.heitzer@rz.uni-regensburg.de