In reply to A)
I don’t know if you have resolved your wi-fi issues but I’ve just spent the last 3 days messing with my pi to get it working. I found that you were having the exact same wi-fi problem as me and I had tried all the same things as you. I am using a Ralink RT5370 chipset unnamed wi-fi dongle and it would not power up when I plugged in the power for the Raspberry pi, however rebooting the pi did the trick. Because I’m using it headless it’s impossible to call a reboot unless LAN is plugged in, so here’s what I did.
I modified the /etc/network/interfaces as such:
auto lo
iface lo inet loopback
auto wlan0
allow-hotplug wlan0
iface wlan0 inet dhcp
wpa-ssid "myssid"
wpa-psk "mypassword"
# auto eth0
# iface eth0 inet dhcp
(I commented the last two line once the whole thing was working fine)
Then I found a cron script that was written to periodically check for wi-fi and modified it to reboot the pi if it can’t ping my router:
#!/bin/bash
##################################################################
# NOTE! THIS IS A MODIFIED VERSION OF THE ORIGINAL PROGRAM
# WRITTEN BY KEVIN REED. TO GET THE ORIGINAL PROGRAM SEE
# THE URL BELOW:
#
# A Project of TNET Services, Inc
#
# Title: WiFi_Check
# Author: Kevin Reed (Dweeber)
# dweeber.dweebs@gmail.com
# Project: Raspberry Pi Stuff
#
# Copyright: Copyright (c) 2012 Kevin Reed <kreed@tnet.com>
# https://github.com/dweeber/WiFi_Check
#
# Purpose:
#
# Script checks to see if WiFi has a network IP and if not
# restart WiFi
#
# Uses a lock file which prevents the script from running more
# than one at a time. If lockfile is old, it removes it
#
# Instructions:
#
# o Install where you want to run it from like /usr/local/bin
# o chmod 0755 /usr/local/bin/WiFi_Check.sh
# o Add to crontab
#
# Run Every 5 mins - Seems like ever min is over kill unless
# this is a very common problem. If once a min change */5 to *
# once every 2 mins */5 to */2 ...
#
# */5 * * * * /usr/local/bin/WiFi_Check
#
##################################################################
# Settings
# Where and what you want to call the Lockfile
lockfile='/var/run/WiFi_Check.pid'
# Which Interface do you want to check/fix
wlan='wlan0'
# Which address do you want to ping to see if you can connect
pingip='192.168.1.1'
##################################################################
echo
echo "Starting WiFi check for $wlan"
date
echo
# Check to see if there is a lock file
if [ -e $lockfile ]; then
# A lockfile exists... Lets check to see if it is still valid
pid=`cat $lockfile`
if kill -0 &>1 > /dev/null $pid; then
# Still Valid... lets let it be...
#echo "Process still running, Lockfile valid"
exit 1
else
# Old Lockfile, Remove it
#echo "Old lockfile, Removing Lockfile"
rm $lockfile
fi
fi
# If we get here, set a lock file using our current PID#
#echo "Setting Lockfile"
echo $$ > $lockfile
# We can perform check
echo "Performing Network check for $wlan"
/bin/ping -c 2 -I $wlan $pingip > /dev/null 2> /dev/null
if [ $? -ge 1 ] ; then
echo "Network connection down! Rebooting"
reboot
else
echo "Network is Okay"
fi
# Check is complete, Remove Lock file and exit
#echo "process is complete, removing lockfile"
rm $lockfile
exit 0
##################################################################
# End of Script
I saved it as /usr/local/bin/WiFi_Check.sh
Make sure you do
chmod 0755 /usr/local/bin/WiFi_Check.sh
or else it won’t execute and then you’ll be scratching your head like I did.
Then I found out that despite what everyone said the OS wasn’t overwriting the /etc/rc.local with /var/www/_OS_SETTINGS/etc/rc.local at every boot. I verified with :
sudo nano +1167 /var/www/inc/player_lib.php
And the copy lines where commented out (I’m using VolumioBeta1.2PI).
So I modified the /etc/rc.local file as such:
/var/www/command/player_wdog.sh startup & > /dev/null 2>&1
sleep 20
/usr/local/bin/WiFi_Check.sh
exit 0
And voilà now the pi reboots if there’s no wi-fi connection and it automatically connects to the network after that. Hope this can help you and others with similar problems on this forum.