I have a pi that has been running a script for probably 2 years with minimal issues. The script is using gpiozero to monitor a few switches. When the switches change state, it does a requests.post to a URL that sends a message to my phone and then it does a print of what switch did what. The only times it has failed in the past is when the internet went out and it tried to do a requests.post during that outage. It only happened a few times per year so I did not care too much. A simple reboot got it going again (it had been running on a @reboot cronjob).
Lately I have been getting issues where it stopped with no error message. I knew it had stopped because of the requests.posts were not being done. I disabled the cronjob line in crontab and started the script manually. I started the script in Thonny and verified that the switches were working. Got the messages on my phone and I got the prints in the shell.
But then they stop after a few hours. When I check the shell, there are no error messages. It just stops. Any ideas?
I can't really post the code here yet, as there are a lot of lines with sensitive (API) info. The issue isn't the messages getting out. When the messages fail, I get error messages. I think it is an issue of the switch states not being detected.
Lately I have been getting issues where it stopped with no error message. I knew it had stopped because of the requests.posts were not being done. I disabled the cronjob line in crontab and started the script manually. I started the script in Thonny and verified that the switches were working. Got the messages on my phone and I got the prints in the shell.
But then they stop after a few hours. When I check the shell, there are no error messages. It just stops. Any ideas?
I can't really post the code here yet, as there are a lot of lines with sensitive (API) info. The issue isn't the messages getting out. When the messages fail, I get error messages. I think it is an issue of the switch states not being detected.
Statistics: Posted by duckredbeard — Fri Jan 17, 2025 1:45 am