GrooveXT
Posts: 5
Joined: Sun May 05, 2013 6:21 pm

Pi freezes

Sun May 05, 2013 6:46 pm

Hello,
my Pi is used as an Presentationsystem with an TV. Via ssh/scp i randomly upload new video files to the pi which are played by this script:

Code: Select all

# you can normally leave this alone
SERVICE="omxplayer"

# now for our infinite loop!
while true; do
        if ps ax | grep -v grep | grep $SERVICE > /dev/null
        then
        sleep 1;
else
        for entry in $VIDEOPATH/*
        do
                clear
                omxplayer -o hdmi -y  $entry > /dev/null
        done
fi
done
This works fine. But if I disconnect the TV (plug out the HDMI cable) from the pi and reconnect it after about 12 hours, the pi doesn't show a picture. It still can be pinged, but when I try to connect via ssh, it freezes while connecting. There is no timeout or error, it just freezes while connecting and doesn't come back.

I set BLANK_TIME and POWERDOWN_TIME to 0 but it doesn't help.

Any suggestions why the pi isn't accessible?

I've tested it with different pis and when the tv stays connected and is turnt on, their seems not to be any problems.

Thanks

sdjf
Posts: 1395
Joined: Fri Mar 16, 2012 5:20 am
Location: California
Contact: Website

Re: Pi freezes

Sun May 05, 2013 8:25 pm

You might put some debugging statements in your script so that when it freezes, you know where that is in your script.

Or you could start the script with strace (available in repositories) and see what that reveals.

I have seen my Pi think my PDA is still logged in via ssh when it is not, maybe there needs to be something in the script that checks the availability of the TV and has a sleep loop every n seconds until you plug the TV back in.

You also could run the following and see what th4 status is of the script when pi freezes, maybe built it in to your script to run it in one of the loops. It will grow big, but you could just do it when you know the event is likely to be triggered.

ps ax | grep SCRIPTNAME >> /var/log/myscript.log
FORUM TIP: To view someone's posting history, sign in, click on their user name, then on "Search User's Posts." || Running ArchLinuxArm on Model 2B and 512MB Model B

Return to “General discussion”