I used to use an old Eee 701, running Windows XP and FreeWXWi, to upload data from my weather station to Weather Underground. The trouble is that it used to keep screwing up, so I had it rebooting every night. That's not particularly clever, so I started running Ubuntu and WView. That ran fine, but it was a bit of a waste of a whole laptop. What I needed was a little tiny, efficient desktop. Enter the Raspberry Pi. Here's how to make it work, for the next time I manage to corrupt everything and have to redo it:

  • You need the 2012-08-16 drop of Wheezy
  • Use win32diskimager to throw that on an SD card
  • Boot the Pi, tell it to expand the root fs, and allow SSH access
  • Reboot the Pi, and plug it into a wired router, so you have interweb access
  • get the Wifi dongle script - wget http://dl.dropbox.com/u/80256631/install-rtl8188cus.sh
  • chmod +x that script, then run it. Follow the instructions to get the Edimax WiFi dongle working
  • add to /etc/apt/sources.list:

deb http://archive.raspbian.org/raspbian wheezy main contrib non-free rpi

deb-src http://archive.raspbian.org/raspbian wheezy main contrib non-free rpi

  • sudo apt-get update
  • get the WView install script - wget http://goo.gl/yiaz0 -O wview-install-raspbian.sh
  • chmod +x that script, then run it.

That should have everything there, so you can now run the web based interface on http://<IP address>/wviewmgmt/login.php and configure it :o)

I later found out that when the WiFi router gets restarted, the Pi never reconnects. I'm wondering if this has anything to do with the final crash that caused me to need to redo everything from scratch. Anyway, I wrote a stupid little script:

#!/bin/bash -x

GATEWAY=192.168.1.1

ping $GATEWAY -c 1

if [ $? -ne 0 ]

then

#

# reboot

echo "Rebooted `date`" >> /var/log/reboot.log

/sbin/reboot >> /var/log/reboot.log 2>&1

fi

exit 0

and set up a crontab (as root) to run it every 5 minutes:

5,10,15,20,25,30,35,40,45,50,55 * * * * ~pi/pingtest > /dev/null 2>&1

Of course, if the router is down for any length of time, it reboots constantly until the router comes back up, but that's not a major stress point for me :o)

I eventually got to the point where I restart just the network, rather than the whole machine:

#

# reboot network

echo "Rebooted network `date`" >> /var/log/reboot.log

#/sbin/reboot >> /var/log/reboot.log 2>&1

/etc/init.d/networking stop

/etc/init.d/networking start