This weekend I have mostly spent installing and configuring my Viglen MPC-L. It turns out the current Viglen distro image has no way of updating using the normal update process. It fails and you get errors. Basically the image that Viglen are currently using uses a really old Feisty version of Xubuntu that has had it’s archive repositories removed. I found that out earlier in the week with a couple of hours of headscratching.
You have to download the right distro and upgrade in the right way. I followed the excellent blog post by Nicholas O’Leary and Andy Stanford-Clark’s Hints and Tips for Ubunu on a Viglen. Both these posts saved me a huge amount of time and give you everything you need to know to get up and running with the Viglen. Albeit it took the best part of a day for everything to upgrade through the different OS releases.
So the Viglen is now running Xubuntu Hardy 8.04.1. I have configured it to be my home automation hub. It is currently running rsmb that is publishing and graphing electricity usage data from my Current Cost meter using rrdtool. I will be adding services and more devices like arduino when I can find time. Pachube is high up on my list as I reckon I know how I can do this, now I have the Viglen, I have the right platform to simply publish data to this service.
I thought it would be a good thing to share the list of commands that I have used, to act if nothing else as a reminder for me.
How to find out the version of ubuntu installed:
lsb_release -a
List the installed packages:
dpkg –get-selections
lsmod – list loaded modules
Dmesg -Â tells you what port connected to
To connect to the serial port:
cu -l /dev/ttyUSB0
Then to set the baud rate:Â cu -l /dev/ttyUSB0 -s 2400
Get the serial port working:
Wget
http://search.cpan.org/CPAN/authors/id/C/CO/COOK/Device-SerialPort-1.002.tar.gz
perl should be already installed. You can get the serial module here: http://search.cpan.org/CPAN/authors/id/C/CO/COOK/Device-SerialPort-1.002.tar.gz
Install it like this:
tar -xzvf Device-SerialPort-1.002.tar.gz
cd Device-SerialPort-1.002
./configure
perl Makefile.PL
make
sudo make install
To change permissions to allow writing on /var/www
sudo chmod o=rwx /var/www -R
then copy your files over and when you are done:
sudo chmod o=x /var/www -R
DHCP Setup
sudo apt-get install dhcp3-server
# Sample /etc/dhcpd.conf
# (add your comments here)
default-lease-time 600;
max-lease-time 7200;
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.1.255;
option routers 192.168.1.254;
option domain-name-servers 192.168.1.1, 192.168.1.2;
option domain-name “mydomain.example”;
subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.10 192.168.1.100;
range 192.168.1.150 192.168.1.200;
}
Cron Tabs:
crontab -e -u ‘me’
Then the crontab itself to run rrdtool:
# USER=name
SHELL=/bin/bash
# HOME=/home/name/
PATH=/sbin:/bin/usr/sbin:/usr/bin:/home/name
0-59 * * * * /home/name/currentcost/bashfilename
Cron Tab Logging
0-59 * * * * /home/name/currentcost/bashfilename > /tmp/cronjob.log 2>&1
Install a lamp server on ubuntu
sudo tasksel install lamp-server
Install RddTool
Apt-get install rddtool
You must have a dev compiler running to be able to run the serial port stuff:
Re: C compiler cannot create executables
You must have libc6-dev-i386 (not just libc6-i386) installed
Also these installed:
apt-get install gcc
apt-get install g++
Shutdown command
sudo shutdown -h now
Set root password:
ssh root@<server-ip-number>
passwd
Install Essential Tools:
sudo apt-get install build-essential man
Time Zone Stuff and install NTP server:
sudo dpkg-reconfigure tzdata
# Check time is correct
date
sudo apt-get install ntp
to see all processes
open a terminal and
~ $ ps -A
To kill a process
sudo kill -9 processid

One Comment
I’ve posted on our blog about installing Ubuntu (8.04, not xubuntu) onto an MPC-L. Runs very slowly, but is an interesting experiment none the less. The video drivers caused the biggest difficulties…
http://blog.jaytag.co.uk/index.php/archives/176
One Trackback
[...] See Chris Dalby’s post, Viglen MPC-L Useful Commands and Tips. [...]