Added tightvnc for headless GUI.
http://www.penguintutor.com/linux/tightvnc
... Robert
Monday, September 24. 2012
TightVNC For Headless Pi GUI
Backing Up the Raspberry Pi Blog
It would be a shame to lose everything I have put into the Raspberry Pi blog so it's time to put in a backup regime.
Strategy
The Raspberry Pi blog is located both both '/var/www/raspberrypi/' and in the serendipity-db catalog of the local MySQL database. We will need to backup up both to completely cover ourselves.
The strategy for backup will be to make archives of both the filesystem and the mysql database, archive them together and then copy to the network drive under a unique filename. The backup will be run from a script which which will live in the '/var/www' directory and be regularly run from an entry in the '/etc/crontab' file.
During the backup process I will create temporary files on the network drive to avoid wear on the local SD card.
We first setup NFS or SAMBA networking and ensure we have mounted our network storage device at a suitable mount point. I have chosen NFS in this example. To use Windows networking adapt the instructions below accordingly.
1. Install NFS client (checked already installed as part of the Weezy distribution).
2. Make a mount point for backups at '/var/www/backup' and add edit '/etc/rc.local' to mount our external resource on boot by adding the following line 'mount -t nfs -o nolock [IP address or hostname of your NAS server]:/var/local/www /var/www/backup'
Backup Script
Here is my script. Note the use of the file '/var/www/backup/sync_www' to ensure we have mounted the network drive and are not just working with our local mount point.
A brief description pf the steps of the script are as follows
1. Check to see we have mounted the network drive by looking for a file called 'sync-www' which we have alread place on the network drive.
2. Create our target backup directory if it does not already exist.
3. Change to the '/var/www/' as our working directory.
4. Create a dated temporary archive of the files in '/var/www/raspberypi'
5. Create a dated temporary archive of the mysql data dumped from the catalog 'serendipity-db'
6. Create the final backup archive removing the temporary working files.
Handling Erorrs
Note the use of '&& \' after each line ensures that the next line only executes if the previous command was successful otherwise the script exits with error code 1.
Note this script could be further enhanced with email notifications of success or failure as needed.
Scheduling
Finally the following entry in '/etc/crontab' will ensure this script runs daily at 2:30 am.
... Robert
Strategy
The Raspberry Pi blog is located both both '/var/www/raspberrypi/' and in the serendipity-db catalog of the local MySQL database. We will need to backup up both to completely cover ourselves.
The strategy for backup will be to make archives of both the filesystem and the mysql database, archive them together and then copy to the network drive under a unique filename. The backup will be run from a script which which will live in the '/var/www' directory and be regularly run from an entry in the '/etc/crontab' file.
During the backup process I will create temporary files on the network drive to avoid wear on the local SD card.
We first setup NFS or SAMBA networking and ensure we have mounted our network storage device at a suitable mount point. I have chosen NFS in this example. To use Windows networking adapt the instructions below accordingly.
1. Install NFS client (checked already installed as part of the Weezy distribution).
2. Make a mount point for backups at '/var/www/backup' and add edit '/etc/rc.local' to mount our external resource on boot by adding the following line 'mount -t nfs -o nolock [IP address or hostname of your NAS server]:/var/local/www /var/www/backup'
Backup Script
Here is my script. Note the use of the file '/var/www/backup/sync_www' to ensure we have mounted the network drive and are not just working with our local mount point.
#!/bin/sh
if [ -e /var/www/backup/sync_www ]; then
mkdir -p /var/www/backup/raspberrypi/
cd /var/www/
tar --exclude-vcs -czf ./backup/raspberrypi/raspberrypi-www_`date +%y_%m_%d`.gz raspberrypi && \
mysqldump -u YOUR_MYSQL_USERNAME_HERE -pYOUR_MYSQL_PASSWORD_HERE serendipity-db | gzip > ./backup/raspberrypi/raspberrypi-mysqldump_`date +%y_%m_%d`.gz && \
tar --remove -cf ./backup/raspberrypi/raspberrypi-blog_`date +%y_%m_%d`.tar ./backup/raspberrypi/raspberrypi-www_`date +%y_%m_%d`.gz ./backup/raspberrypi/raspberrypi-mysqldump_`date +%y_%m_%d`.gz
exit 0
else
exit 1
fi
A brief description pf the steps of the script are as follows
1. Check to see we have mounted the network drive by looking for a file called 'sync-www' which we have alread place on the network drive.
2. Create our target backup directory if it does not already exist.
3. Change to the '/var/www/' as our working directory.
4. Create a dated temporary archive of the files in '/var/www/raspberypi'
5. Create a dated temporary archive of the mysql data dumped from the catalog 'serendipity-db'
6. Create the final backup archive removing the temporary working files.
Handling Erorrs
Note the use of '&& \' after each line ensures that the next line only executes if the previous command was successful otherwise the script exits with error code 1.
Note this script could be further enhanced with email notifications of success or failure as needed.
Scheduling
Finally the following entry in '/etc/crontab' will ensure this script runs daily at 2:30 am.
'30 2 * root /var/www/backup-www.sh &'
... Robert
Sunday, September 23. 2012
Wi-Fi Pi
Putting the Raspberry Pi into an appliance means that it will not have access to an Ethernet connection and will require USB WiFi.
Which USB Wifi Device?
Adding USB WiFi to a Linux device is generally quite easy however there are limitations which apply to non PC (non x86) applications such as the ARM11 based Raspberry Pi.
The chipset in the WiFi device selected for the Raspberry Pi must be one already supported for the ARM11 device. Simply relying on a chipset vendor to claim Linux support is not enough as this may really mean PC based x86 Linux only. True Linux support means the chipset vendor has made driver source code available to be built for any target CPU.
Two of the best supported chipset vendors are Ralink and Realtek. For my application I have used the 'Netsys Wireless N Model: NET300N' based on the Realtek 8191SU chipset which already as Raspberry Pi driver support using the Realtek r8712u driver.
This USB WiFi device is available from http://dealextreme.com for about $10.
Making It Work
The following two resources provided the general guidelines I used to get the WiFi up and running in my network.
http://mitchtech.net/realtek-wireless-dongle-rt3070-on-the-raspberry-pi/
http://ubuntuforums.org/showthread.php?t=571188
I installed 'lshw' ( apt-get install lshw ) which provides diagnostic information about hardware drivers however as this installation went so smoothly I am not sure this was absolutely necessary.
root@raspberrypi:~# lshw -C network
-network:0
description: Wireless interface
physical id: 1
bus info: usb@1:1.2
logical name: wlan0
serial: 00:0f:11:66:16:d0
capabilities: ethernet physical wireless
configuration: broadcast=yes driver=r8712u multicast=yes wireless=unassociated
-network:1
description: Ethernet interface
physical id: 2
logical name: eth0
serial: b8:27:eb:45:84:2e
size: 100Mbit/s
capacity: 100Mbit/s
capabilities: ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd autonegotiation
configuration: autonegotiation=on broadcast=yes driver=smsc95xx driverversion=22-Aug-2005 duplex=full firmware=smsc95xx USB 2.0 Ethernet ip=192.168.10.31 link=yes multicast=yes port=MII speed=100Mbit/s
After manually confirming the following command lines brought up my network,
ifconfig wlan0 down
dhclient -r wlan0
ifconfig wlan0 up
iwconfig wlan0 essid "MYESSID"
iwconfig wlan0 key MYKEY
iwconfig wlan0 mode Managed
dhclient
I then copied thew into '/etc/rc.local' so that the WiFi network would be brought up on boot. An important point for me was that the web article suggests adding the line 'ifconfig eth0 down' to the '/etc/rc.local' file but this would mean that hardwired ethernet would be shutdown and not available should it be needed in an emergency.
The final changes I need to make were to my DHCP server and router configuration so that the 'Pi' always gets a fixed IP address assigned for correct virtual server port forwarding.
Next Steps
You might notice the nice plastic case (from Element14) in the image which will protect the 'Pi' from and ongoing development accidents!
I will now run this setup for a while and look for general stability as a WiFi based web host.
...Robert
Thursday, September 13. 2012
Raspberry Latte
What do you get if you cross a Raspberry Pi with a Breville 820ES Espresso machine? A Raspberry Latte!
There has been a long standing symbiotic relationship between engineers and coffee!! So it only seems natural that a candidate project for my espresso machine is a Raspberry Pi brain transplant. Of course I'll keep the blog on the coffee machine, it seems appropriate!
I see the project running something like this.
1. Acquire the circuit diagram and study to understand issues such aspower supplies and interfaces.
2. Reverse engineer the control processes currently operating on the espresso machine.
3. Design a suitable interface.
4. Implement WiFi on the Raspberry Pi to avoid running cat5 to the coffee machine.
5. Develop a suitable coffee machine application.
6. Develop a suitable web based interactive application
Some issues I see.
1. Failure mode safety management (circuit design).
2. Electrical isolation between the Raspberry Pi and the high voltage electrical devices.
3. Physical space and form factor.
4. Being without coffee during key development steps, ie keeping the coffee flowing during modifications.
... Robert
BES820XL.pdf
Monday, September 10. 2012
Pi For Dessert
Welcome to my Raspberry Pi!
Last week I ordered a new toy, one little Raspberry Pi and this blog will be dedicated to all the things I do with it.
As can be expected the first thing I did was to put a standard image on an SD card and bring it to life. It gladly obliged with beautiful 1920x1080 hdmi graphics. No surprises so far.
Next I decided that the ideal place for this blog to live is on the Rasberry Pi itself. So after installing and configuring LAMP we are off and running with this little blog being entirely served by the tiny little Raspberry Pi you see in this photo.
Enjoy my Pi, ... Robert Rath
(Page 1 of 1, totaling 5 entries)