Type your search keyword, and press enter

New projects: Pi’s and Arduinos

Your ads will be inserted here by

Easy Plugin for AdSense.

Please go to the plugin admin page to
Paste your ad code OR
Suppress this ad slot.

Recently I’ve been working on several new projects, all of which use either a Raspberry Pi or an Arduino.

Site-To-Site VPN

A friend of mine recently opened a new satellite office, and as part of his day to day work had a requirement to connect the two together so resources on either side could see each other. Site-to-site VPN I thought, and what better kit for the task than a couple of Raspberry Pi’s. Nice and small so they can be kept along side the routers. Each site had a simple ADSL broadband link, with a couple of PC’s connecting up.

I’ll run through the complete setup in a seperate post as a Howto/tutorial, but the process was so simple to get them setup literally flash raspbian to a couple of SD cards, go through the motions to get a working console. I removed any unneeded packages, then installed and setup OpenVPN. After a bit of broadband/user error at one of the sites, simply opening the ports on the routers firewalls it all connected up beautifully. Fileshares and network based resources were all available wherever they wanted.

Home Automation
For a long time now I’ve been wanting to implement some kind of home automation system. After looking at X10 i was a little disappointed, as the technology was very dated and slow but also very expensive. Any other newer technologies were a little out of my price range, and also a very closed shop. So after about 12 months of it being on the edge of a project, a lot of research has been done and I think I am now in a position to put something in place. I’ll be using a mixture of Arduinos (or shrimps if I can), Raspberry Pi’s and other tech.

The idea is now coming to fruition due to a decision to transform all the lights in the house to 12v from 240v. This will make working with lighting a lot easier and safer, and cheaper due to not having to employ a spark to do all the connecting for me. The rough plan of attack will be to combine arduinos and mosfet transistors as switching mechanisms. Also implemented on these arduinos will be ethernet shields in order to connect the circuits up and have them centrally managable.

Essentially taking a traditional, feed -> switch -> bulb circuit and turning it into feed -> transformer -> arduino -> “switch” -> bulb. the switch component will be defined by the use of the light and could comprise of a push button SPST, an android app, a PIR or a combination of those. I plan to use a combination or software technologies for running all this, MQTT, python, PHP etc.

I plan to replace any fluorescent lights with LED strips, and have been toying with the idea of RGB here too which will bring a whole new depth to the lights. Many things to consider and a lot of exciting tech to play with, that is accessible, cheap and using open standards.

Exciting times.

GlusterFS Quickstart Howto on Fedora

Your ads will be inserted here by

Easy Plugin for AdSense.

Please go to the plugin admin page to
Paste your ad code OR
Suppress this ad slot.

GlusterHere’s a (very) quick howto showing how to get GlusterFS up and running on Fedora. Its probably better situated on a distro like CentOS/RHEL, Ubuntu Server LTS or Debian stable but where’s the fun in knowing it won’t break? Most of these commands are transferrable to other distros though, its Fedora centric due to the use of yum, selinux and systemd (systemctl).

2x (or more) servers running Fedora, I used 18 in this example but i’m sure it shouldn’t change a great deal for newer releases. If it does I’ll try update this doc. The idea behind this setup is to use 2 servers as hypervisors (KVM) and have local storage but reslience, I won’t be covering the virtualisation side, purely storage so VM’s will be adequate for this setup.

So at this point we should have 2 clean installs of Fedora on 2 servers fully updated.
For arguments sake we’ll all them host1 and host2. with IP addresses of and respectively.
(you will need to add hostnames and IPs to /etc/hosts if you don’t use DNS)

Lets disable selinux and iptables for now to make this process easier:
sed -i s/SELINUX=enforcing/SELINUX=disabled/g /etc/selinux/config
setenforce 0
systemctl stop firewalld.service
systemctl disable firewalld.service

yum install nfs-utils glusterfs-server
systemctl start glusterd.service
systemctl start rpcbind.service

OK so now we’re installed we’re ready to start setting up Gluster, lets create a directory on both servers

root@host1 ~ # mkdir /gluster
root@host2 ~ # mkdir /gluster

Now lets get a volume created:
Do this on only 1 host.

root@host1 ~ # gluster peer probe host2
root@host1 ~ # gluster volume create vol1 replica 2 host1:/gluster host2:/gluster

These commands told the 2 hosts to become “friends” then created a glusterfs volume called vol1 with 2 replicas (hosts), you will need to change this to the number of hosts you run, and the paths to the volume on each host.

When you run the last command above it will tell you that your volume creation has been successful and that it needs to be started to access data. Lets do this:

root@host1 ~ # gluster volume start vol1

So now we have a functioning gluster cluster we need to mount it somewhere.

root@host1 ~ # yum install glusterfs-fuse glusterfs

Installs the relevant software to allow us to mount the volume, lets create directories and mount:

root@host1 ~ # mkdir /store
root@host2 ~ # mkdir /store

root@host1 ~ # mount -t glusterfs host1:/vol1 /store
root@host2 ~ # mount -t glusterfs host2:/vol1 /store

You should now be able to create files in /store on host1 and them be visible to host2 /store. Notice how we mounted the volume on the same machine it is hosted, this way we are always writing to local storage and syncing out.

Update: the same instructions will work on CentOS/RHEL/Scientific Linux, you will just need to install the EPEL yum repositories first – http://fedoraproject.org/wiki/EPEL