I’ve got a raspberry pi running headless, playing an audio stream through mplayer over wifi.
Crontab loads mplayer on boot, as well as a couple scripts:
- one that pings the router, and if there is no internet connection, shuts the network interface down and starts it up again.
- one the pgrep's mplayer, and if it isn't running, launches it
It works for a while, usually from 3 or 4 hours up to 3 days, but eventually it becomes unresponsive. the wireless goes down, and doesn’t come back up, It will not take input from the keyboard. It seems to have crashed.
I’m using a wireless usb card with chipset RT5370. I’ve turned wireless power saving off. I’ve tested the current to the rpi with a multimeter. it is 4.9V. I don’t think it’s an issue with the wireless card or power.
I’ve looked at the syslog and the kernel log, but I don’t really know what to look for, and can’t find anything obvious. What might be causing it to become unresponsive?
***Edit, more info:
I've set up hardware watchdog, and also have Crontab set to email me when the system reboots. I now know it has been crashing/hanging when it is unresponsive. I've started systematically eliminating software and hardware, and it's looking like the problem lies in the interaction of Mplayer, the Wipi, and my bad wireless connection
If I disable Mplayer, or use a more reliable internet connection, it doesn't hang or crash. I am putting this together for an on-site installation where I will have no control over the router, so it can't crash just because there is an interruption in connectivity.
Here is what the cronjob for Mplayer looks like:
* * * * * pgrep mplayer > /dev/null || sudo mplayer -loop 0 http://184.108.40.206:8000/airadio.ogg > /dev/null 2>> /var/log/airlog.log
the ~/.mplayer/config file contains:
Any Ideas what I'm doing wrong, or where I should be looking?