Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 1247

Python • Raspberry Pi Scripts stops running after a while.

$
0
0
Hi everyone,

This is 2 issues but they are both connected

Context: I have a raspberry pi (3b+) that measures temperature, pressure and humidity outside ('weatherpi'), inside I have a another raspberry pi (3b+) that reads the latest line of the influxdb of the 'weatherpi' and uploads it to it's own database (influxdb). From there it goes to grafana.

The 2 issues I am having~
- After a random period of time the script will stop running, crontab starts it when the OS boots and at the end of the script, it just sleeps for 30s before taking another measurement. It's favourite time to stop seems to be 1:54am(+- 5mins) so i am asleep not to notice and restart the pi, but it seems to happen at anytime. (The photo attached shows the data gaps over the last 2 days.) It can have runs where it doesn't stop for 10+ days or currently when it stops every night.



- The second issue which means I don't always catch when it stops. The pi seems to disconnect from the wifi after a while and the only way to get it to reconnect is to restart the whole pi. I accept it in bad weather but it can be a very sunny day and it will disconnect.

Last night (about 5pm) it had disconnect but I hadn't paid much attention thinking that it would reconnect, but when I checked this morning, it had fully stopped.

Even if no one has any idea, how could i set up error catching to see why it does or some way of if it stops, it can restart it's self.

Thanks in Advance!
Screenshot 2025-04-09 094720.png

Statistics: Posted by HumanProgrammer10000 — Wed Apr 09, 2025 8:56 am



Viewing all articles
Browse latest Browse all 1247

Trending Articles