Archive for the ‘Raspberry Pi’ Category

I’ve been exploring the world of linux containers a bit lately and so I thought I’d write a quick tutorial on how to set up the Raspberry Pi (my go to remote embedded build machine) to build Docker from source. If you don’t know what Docker is then you should do yourself a favour and read up about it from their site. It’s a truly amazing piece of software and I’m hoping to use it for instances of node applications as well as embedded build instances in the future. For now lets just build it. As a forewarning I have built my own 3.12 kernel for this particular Raspberry Pi so if something doesn’t work on the default Raspbian image that could be why.

First up install the userspace tools for linux containers. You could of course install the ‘lxc’ package from the repositories but at this time it is on version 0.8.0-rc1 and as I’m building everything bleeding edge I’m sure you’ll need the latest version.

sudo apt-get install libcap-dev
cd /opt
sudo git clone https://github.com/lxc/lxc.git
cd lxc
sudo ./autogen.sh && sudo ./configure && sudo make && sudo make install
lxc-version
lxc version: 1.0.0.beta1

Next we need to get go. Again we could install the ‘golang’ package but this is the 1.0.2 version and 1.1 version contains many improvements for ARM. So I’ve chosen to get a precompiled version.

cd /opt
sudo wget -c http://dave.cheney.net/paste/go1.2rc1.linux-arm~multiarch-armv6-1.tar.gz
sudo tar -C /usr/local -xzf go1.2rc1.linux-arm~multiarch-armv6-1.tar.gz
Add export PATH=$PATH:/usr/local/go/bin to your ~/.profile or /etc/profile
go version
go version devel +5b367120d592 Thu Sep 19 17:12:00 2013 +1000 linux/arm

Building from source is also pretty easy

curl https://go.googlecode.com/files/go1.2.src.tar.gz | tar xz -C /usr/local
cd /usr/local/go/src
./make.bash
go version go1.2 linux/arm

I have included the AUFS patches from here into my kernel but from docker version 0.7 you do not explicitly need them. Patching is done by compying in the new sources and then running the patches from the root of your kernel source tree.

AUFS-Utils is also useful if you plan on using this feature.

cd /opt
sudo git clone git://git.code.sf.net/p/aufs/aufs-util
cd aufs-util
sudo git checkout aufs3.x-rcN
sudo make && sudo make install

The most difficult part of this whole process is the fact that the docker build system uses docker containers to build itself so you need to have docker to build docker. The guys at resin.io have made things a whole lot easier by publishing a raspberry pi built docker binary. This can be found here, extracted and used.

docker -v
Docker version 0.7.2, build 28b162e-dirty

Building from source can then be completed using the standard installation instructions from the docker website.

Advertisements

I’m not really any further with any projects to speak of but it feels good to get some personal coding done. This weekend I’ve been playing around with the RFu-328 modules with SRF from Ciseco. I’ve been trying to get ChibiOS/RT running on them as I think it’ll be great to have a small footprint RTOS which runs on 8 bit micros. Task switching and sleeping during idle will do great things for my wireless nodes. So far I have the basic RTOS running with a thread for processing serial LLAP activity and then a semaphore to signal another to process the data received if it is all in order. Currently I am trying to move from the nodes sending data periodically to being able to be polled by the master. This will help prevent collisions as well as stop me from having to update the firmware on the nodes if I make changes to the system. So for now I’m trying to implement Pinata so I can control all the pins on an Arduino compatible unit. I’m not quite there yet but it’s a good start for a weekend. Code, as always, available on my github.

To get this going I’ve gone back and updated my EVE-node application with all the things I’ve learnt from doing the raspberry pi application at work. This application is nowhere near ready for everday use but if I keep cracking on it will be really useful very soon.

I was asked recently by our mechanical team at work to help them with a little project that involved building a pneumatic test rig to stress test our product. It was designed to do things like electrical stress tests like powering the device on and off a million times, mechanical tests like plugging and unplugging a USB cable and touching the touch screen. They had me a pneumatic.

The rig is powered by a raspberry pi with a PiFace for the relays and I/O. The interface is written in Node.JS with Angular for the frontend. It was a really great project (simple as it may be) and has been a great excuse to dive into node properly. It’s power continues to astound me and Angular’s bidirectional bindings really makes it easy to give powerful embedded projects a UI. It scales up really well to so you don’t have to worry about changing technologies later. The code is available on my github as usual.

I know this video is not very exciting but I think it’s cool. I’m also working on getting the low level SPI bindings working properly. More on that in a future post but node-gyp is incredible and node-ffi is so incredibly powerful for quick external library bindings.

Over the last week or so I have been playing around with getting Node.js up and running on my Raspberry Pi. I have found it to be a great learning experience and I’m pretty sure I will be using it for all of my embedded UI projects from now on. With the help of frame works like Express getting a static site up and running is really easy and Socket.io makes communications really easy too. As I posted before I have been playing with these SRF modules to get some wireless comms going for home automation and I used python to get up and running fast. Afterwards I decided to use this as a opportunity to get in Node as I’ve wanted to try it out for a while but always need a project to apply myself to. This is still a long way off but have a look at the first working version https://github.com/rosterloh/EVE-node. More as I carry on discovering!

Next steps in my automation project

Posted: November 19, 2012 in Raspberry Pi

I have just seen a great project that will help me out with my future automation projects on Kickstarter.

 

EVE is open hardware. A server for connecting all your wireless devices to a single point, no larger than a box of playing cards.

 

Have a look and back the project if you feel inspired. I have! This will be a great way to play around with a whole host of wireless interfaces and immediately connect to my JeeNodes.