Raspberry Pi B+ and Piaware Stops on Network

I have been using my Pi and Piaware for about a month, It had been working flawlessly, Then it was upgraded to 1.20. Now it stops about every day. Also my password was not changed. Still the old ones.

Ideas? Best way to troubleshoot. I am wireless and headless. Using RDP to access.

Get the flightaware email that my data has stopped. Can’t access web page on device or RDP in to device.

Only solution has been to reboot device.

You don’t know if the Pi stops or the WiFi networking fails

I’m sure I saw something here last week about having a tiny script that rebooted the pi if the networking went down - the script was set to run every 5 minutes.

I use:


#!/bin/bash

while true ; do
   if ifconfig wlan0 | grep -q "inet addr:" ; then
      sleep 60
   else
      echo "Network connection down! Attempting reconnection."
      ifup --force wlan0
      sleep 10
   fi
done

I use this one:

#!/bin/bash
##################################################################

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

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

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’
pingip=‘192.168.0.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! Attempting reconnection.”
/sbin/ifdown $wlan
/bin/sleep 5
/sbin/ifup --force $wlan
else
echo “Network is Okay”
fi

echo
echo “Current Setting:”
/sbin/ifconfig $wlan | grep “inet addr:”
echo

Check is complete, Remove Lock file and exit

#echo “process is complete, removing lockfile”
rm $lockfile
exit 0

##################################################################

End of Script

##################################################################

The Pi’s (and many SBC) have a watchdog timer built-in that can be triggered by any number of things, load, io, pid’s but most importantly a frozen PI.

This is the link from ADA Fruit
blog.ricardoarturocabral.com/201 … ng-on.html

More important here is the man page:
linux.die.net/man/8/watchdog