I'm trying the following script to test the reliability of shutting down/up the USB HUB on my R-Pi B. Unfortunately, it is hanging the unit and I need to manually reboot it. Any ideas?
while true
do
/etc/init.d/networking stop
echo 0 > /sys/devices/platform/bcm2708_usb/buspower;
echo "Bus power stopping"
sleep 10;
echo 1 > /sys/devices/platform/bcm2708_usb/buspower;
echo "Bus power starting"
sleep 2;
/etc/init.d/networking start
sleep 5;
ping google.com -c 2
sleep 30;
done
Any ideas?
Update 13-May-2015:
I feel that I haven't provided enough details about my environment and the reasoning of this test. So, here we go...
The whole purpose of this reliability test is because the project I'm working on, the R-Pi will be running from a power pack and I need to save as much power as possible. So the idea is to disable the USB HUB while the R-Pi is in idle state and re-enable it whenever the unit has to interact with the user.
The research I have made, indicates that I could save up to 200mA by disabling this hub. So, I wanted to prove if these commands (that I have found in different forums) are reliable enough or not. And in my case they are not.
For this particular test, the unit is connected to an AC power supply (not the battery pack), it has a mouse, keyboard, monitor and wi-fi dongle attached to it. Since I have a 30 seconds sleep in my script, that gives me enough time to see if the unit is alive or not. I also have tried SSH (using Putty) without success.
/etc/rsyslog.conf
); the log directory is/var/log
and on, e.g., Raspbian, a copy of everything should end up in/var/log/syslog
. You have heard of these before right?