swathiharry
Posts: 1
Joined: Thu Dec 06, 2018 5:53 am

Raspberry pi hangs after running for few hours?

Thu Dec 06, 2018 6:04 am

Hi,
I need my raspberrypi to run a python script for hours according to my need where it will be turned off when it is not needed. I see my pi running for few hours (say <24hrs) and it hangs.
since i am begginer i could not find the reason .

I am using a pi3 model .
can anyone help me to find the reason for my pi hangs???

oldjake
Posts: 88
Joined: Fri Aug 03, 2018 12:39 pm

Re: Raspberry pi hangs after running for few hours?

Thu Dec 06, 2018 2:33 pm

Anything in /var/log/syslog around the time that it crashes - or at least just before you see it reboot if you can't identify the time of the crash?

What else are you doing with the Pi?

pcmanbob
Posts: 6222
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

Re: Raspberry pi hangs after running for few hours?

Thu Dec 06, 2018 2:43 pm

Is your python program running when the pi crashes , if so then what's the python program doing ?

might help if you posted the python program.

please use code tags when posting

Add [code] at the top

code goes here

and [/code] at the bottom.
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported

jahboater
Posts: 4437
Joined: Wed Feb 04, 2015 6:38 pm

Re: Raspberry pi hangs after running for few hours?

Thu Dec 06, 2018 2:47 pm

You could just not start the Python program.
If the Pi no longer hangs, you at least know it is the Python program at fault - which is probably easy to resolve.

YanKleber
Posts: 19
Joined: Sun Nov 11, 2018 5:45 pm

Re: Raspberry pi hangs after running for few hours?

Tue Dec 11, 2018 5:37 pm

I was going to say exactly that. When running a specific software and the machine suddenly hangs after a while generally is the PROGRAM that is crashing. In such cases, most probably the issue is located between the keyboard and the chair. LoL! Just kidding!

:lol:

Anyway, I am not a Python coder, but overall mostly of the languages suffer with similar issues. Aren't you forgetting to release an unused big amount of vars, arrays, data, etc? Are you spawning too many concurrents threads? It may just blowing the stack...

:ugeek:

Good luck!

Return to “Troubleshooting”