Showing posts with label low power. Show all posts
Showing posts with label low power. Show all posts

Tuesday 23 November 2021

IoT Christmas Tree Tech

In my previous post where I was showing off my IoT Christmas Trees, I described the project and what the trees are intended to do.  This post features the inside track information about how I put the project together.  So the first post is supposed to be non-technical if you will and this post details the info more of interest to those interested in the technical make-up of the project.  Since this is effectively a recipe for how to create one of my IoT Christmas Trees, we'll start with the list of things needed.

Ingredients

For the Tree

Bits you need to make one tree:
  • Wood
  • Paint
  • Arduino ESP32
  • Micro USB Cable
  • Veroboard
  • LED String
  • Buttons

Server and Connection Requirements

These are Internet connected of course so needed here are:
  • An MQTT Broker
  • An HTTP Server
  • WiFi with Internet Connection
  • Another WiFi capable device

Other Useful Bits

Probably staple provisions of any maker's tool box:
  • Glue Gun
  • Soldering Iron and Solder
  • Heat Shrink Tubing
  • Wire (22AWG Solid Core)

 

Putting it all together

 


The wooden bits

You need enough wood in whatever design you prefer.  I made a point of making each of my trees in a different style.  It caused more work that way of course but there's something nice about each tree being unique.  My designs are all between about 25cm and 40cm tall without much thought put into why.  However, this sort of size seems to work well with the light string I chose.  Given the light string is 5 metres long and I used half a string for each tree I needed to hang 2.5m of string around each tree (containing 25 lights per tree).  Therefore, you need to size the wooden structure appropriately for the length of string or number of lights you intend to hang.

Painting

I decided to use spray paint to try and achieve a really smooth and high quality finish.  I selected Montana paints as they provided all the types of paint I wanted to use (primer, metallic top coat, glitter and varnish).  I went with 4 of their colours, Aztec Gold, Avocado Green, Titanium, Red; and glitter effects in Silver and Dusty Gold.  Everything came from Graff City.

A couple of coats of primer were needed followed by a couple of coats of metallic.  The glitter paint goes on as a varnish layer with particles of coloured glitter in it and they recommend a top coat of varnish is used to seal the glitter coat and prevent and loose glitter falling off.  The result is a really nice layered effect where the fairly reflective metallic coating is set off against a subtle glitter effect and everything is finished off with the sheen of varnish.

Electronics

The main driver of the project, electronically, is an ESP32 board.  The board I chose is a knock off of the Lolin D32 simply because it has everything I needed (including having the pins not soldered) and much cheaper than locally available boards in the UK.  While the board was cheaper, I did discover some of the drawbacks in as much as it doesn't have built-in pull up resistors on its GPIO pins and as such I had a lot more soldering to do to work in a 10kΩ resistor into a little veroboard circuit to wire in the buttons I chose.

The string of LED lights looks very cool with some quite presentable wiring between the lights when compared to an LED strip.  They're completely WS2812/NeoPixel compatible so they're easy to programme and there's some nifty libraries out there already available.  They are, however, fairly hellish to solder since the wires are coated with some very thin plastic insulation which is either difficult to remove or otherwise burn through with your solder.

Finally, the whole thing is powered via Micro USB so I ordered a pile 3m long USB-A to Micro-USB cables so the trees can be sited a reasonable distance from a power socket and I didn't have to worry about batteries or charging although battery powering these units would definitely be possible.

Firmware

The firmware is a fairly standard Arduino implementation for the main loop and using WifiManager to configure the ESP32 WiFi to connect to an SSID.  It wont come as any surprise to find the messaging component I'm using is based on MQTT and so I'm using Nick's pubsubclient library on the client side.

One of the more interesting things I've done with the firmware is to attempt to make it as remotely configurable as possible without the need to rely on over-the-air updates for the firmware.  To this end, I'm using the inih library and the firmware downloads its configuration as an ini formatted file from a remote location that allows me to configure as much as possible, currently: mqtt hostname:port, username, password, SSL settings, publish and subscribe topics, device name; and then configurations for the lights for things like which colours to cycle around, how long the "Merry Christmas" setting is maintained before reverting to the previous setting.  The ini file format also allows an easy "global" configuration to apply across each tree while also allowing a per-tree customisation.  Should the WiFi connection not be available or the configuration file not be available then the tree reverts to a sensible set of defaults.

Once running, WiFi connected, MQTT connected and the configuration has been downloaded and applied there's some basic login there to cycle between the different light configurations when the left button on the tree is pressed.  This is all done locally on each tree.  The right button, when pressed, sends a (configurable) message to the other trees that tells them what to do.  So it would be possible for each tree to have its own specific "Merry Christmas" pattern so you could, for example, work out who had sent you the message by the pattern/colour of the light flashes on the receiving tree.

I have also built in a simple command protocol to further take advantage of the MQTT connectivity.  This allows me to send a "ping" to each tree to see which are currently alive, connected and working properly.  The second command I have is a "reload" command that will cause the tree to download and re-apply the configuration from its remote location, noting of course that the configuration could have changed and so I can cause a tree to remotely update its configuration.  Finally, there is a "reconnect" command that will cause the tree to disconnect and connect to its configured MQTT broker.  This is useful in the rare circumstance where the IP address of the broker may have changed in which case I can update the configuration, have the tree read a new configuration, then have the tree disconnect from the current broker and connect to a new broker.

MQTT Broker

The MQTT broker is provided courtesy of my still relatively new Pi4 home server and the rather excellent Mosquitto MQTT broker.  Since I'm running this all myself and not using a cloud based MQTT service I've screwed it all down as far as I can from a security perspective but there's nothing like running your own services to make you feel vulnerable!

IoT Christmas Trees

My latest maker project has been running for a good chunk of the year and has been a really cool thing to do to keep me occupied during lockdown since I'm not really one to binge watch box sets.  I've been making Internet connected Christmas trees as gifts for close family.  They're designed to be ambient ornamental decorative pieces with a funky twist of interactivity.  The video I produced probably explains them best...


As you can see from the video, each tree is deliberately different.  I thought it would be more interesting to have a completely different wooden design for each.  My dad did the woodwork which saved me quite a lot of time and allowed me to concentrate on writing the software and doing the electronics not to mention building and painting each tree.  There's a good few hours work in each of these things.

Operation of the trees is pretty simple with the most complicated bit, like with most of these things, being the initial set up to get them onto your WiFi network.  For that, and to explain the basics of how they work along with a bit of troubleshooting information, I wrote a little user manual to go with them.  After all, it will be our closest family members that receive one of these and so I can always help out remotely (and potentially fix any issues that arise).  The left button on each tree cycles round a set of pre-defined colour schemes.  However, these can be changed on a per tree basis should someone want a different colour or configuration.  Similarly, the trees can be operated remotely but I've yet to write a decent interface to do so.  The right button on each tree is where the fun is, causing all the other trees to change light pattern for some period of time.  Again, this is all configurable per tree but by default they all cause the same green and red frenzied light pattern which should be very noticeable in the corner of your room should it occur.

Finally, big thanks to James Sutton and his original iotree project was in no small amount an inspiration for my work here.  Although, the implementations are different both physically and in software there's still a huge amount of overlap.  James was also responsible for running an IoT hackathon at work (we're colleagues) introducing a lot of the technology I would need in order to perform this build.  Thanks again, James!

I've also written more details on the technical implementation.  But, I'll sign this post off with a closer look at each tree in pictures...








 

Tuesday 28 September 2021

Yet Another New Home Server

This year has seen me doing more in the way of little tech projects at home than I have done for a while, perhaps due to covid lock downs so if that's the case then I'll take this small positive from an otherwise rubbish situation.  Typically for me, these projects have focused around open source projects and some IoT.  More on those in some separate blog posts when I get around to writing them up.  But for now, I wanted to make some notes on my new home server set up.

I've had an array of different low powered home servers of the years that I've previously written about, namely the NSLU2, TinyTuxBox, Joggler and for the past many years a simple ReadyNAS box that I specifically bought for the Intel processor as it made compiling different bits and pieces a whole lot easier back in the day.  However, I have recently relegated the ReadyNAS box from home serving duties, keeping it only for its native NAS services because using it for other things has become increasingly difficult without updating the entire base OS (which is possible by I'm reluctant to do) due to down level software libraries like an ancient version of openssl.

In with the new then and I moved away from Intel architecture as it's now so much easier to compile for Arm chips and went with the, wait for it, drum roll, rather obvious choice of a Raspberry Pi 4.  Specifically, a Pi 4 Model B, 4GB.  I've paired it with the official Pi case power supply, micro HDMI cable and shoved in an A2  SanDisk Extreme 64GB SDXC card.

And so to the notes, my initial target for this new box would be as follows:

The Lounge

IRC might be a bit old hat but tons of open source project still use it for their more synchronous communications.  ZNC is the choice of old for staying connected to your IRC channels.  For those not familiar, it acts as a relay to the IRC servers you want to connect to.  Effectively, it connects as your IRC client to the servers and presents your local IRC client with an endpoint through which you can connect.  This allows you never to miss any messages and see the IRC conversation even when you're not actually online.  Matrix seems to be taking some of the old IRC community's attention with various projects setting up bridges between Matrix and IRC.  However, the relative newcomer project called The Lounge shows just how far web technologies and web sockets have come.  It's a darned site (pun intended) easier to install configure and use than ZNC so I'm a massive convert and big fan of the project.

The project is relatively stable in the master branch and doesn't release particularly often so I've open for the run from source approach to take advantage of all the latest development.  Other than that, I've only made 3 changes to the default configuration prior to starting up my The Lounge server:
  1. host: "127.0.0.1"
  2. reverseProxy: true
  3. theme: "morning"
As you can see, these are all pretty simple and somewhat trivial changes.  The host setting binds the listener to the localhost interface, thus making it suitable for use with a reverse proxy and not exposing the service outside of the Pi 4.  The reverseProxy setting tells the server it's expecting to run behind a reverse proxy (the clue is in the name I guess).  Finally, I've switched to using a dark mode theme rather than the default light mode.  That's it, the remainder of the configuration is all about which IRC servers and channels to connect to along with the usual IRC bits of registering your nick and logging into the nick server.

Mosquitto

This is even simpler to get going than The Lounge due to the fact it's bundled with Raspbian so you can just apt-get install it.  I've created a configuration based on the bundled example config file but changing:
  1. pid_file (probably just because I'm old fashioned like that)
  2. user (to drop privileges)
  3. listener (to specify a port number)
  4. certfile and keyfile (for SSL)
  5. log_dest (create a specific log file for the broker)
  6. clientid_prefixes (a bit of added security to only allow certain client IDs to connect to the broker)
  7. allow_anonymous (quite an important one!)
  8. password_file (so that connections are authenticated)
Hopefully, that gives me something secure as well as providing me with the broker functionality that I need.

Node Red

Again, simple to install as it's bundled with Raspbian.  It does like to run under the default "pi" user though, which is a bit of a shame security wise.  All I've done to the configuration is ensure it's listening only on the local interface and enable the adminAuth section such that I'm required to enter a user name and password to access the user interface.

NGINX
 
Another simple install due to using the bundled version that comes with Raspbian.  However, this time around there's a lot more configuration to do since I'm using it to front a reverse proxy onto The Lounge and Node Red.  This gives me a few advantages such as being able to restart NGINX in order to load new SSL certificates without interrupting the underlying services i.e. something like IRC can stay connected even though new certs are loaded.  Both The Lounge and Node Red support SSL in their configuration so this also means I only need to configure certificates in one place and have a single route through which I can access all my home services.  The idea and bulk of the configuration for doing this comes directly from one of the guides available for The Lounge.

server {
    # redirect HTTP traffic to HTTPS
    listen 80 default_server;
    listen [::]:80 default_server;
    server_name _;
    return 301 https://$host$request_uri;
}

server {
    # SSL configuration
    #
    listen 443 ssl default_server;
    listen [::]:443 ssl default_server;
    ssl_certificate /path/to/your/server.crt;
    ssl_certificate_key /path/to/your/server.key;

    server_name your.server.name.com;
 
    # Add this if you want to do web serving as well
    root /var/www/html;
    index index.html index.htm;
 
    location / {
        # First attempt to serve request as file, then
        # as directory, then fall back to displaying a 404.
        try_files $uri $uri/ =404;
    }
 
    # Configure reverse proxy for The Lounge
    location ^~ /YOUR_PREFERRED_IRC_URL_GOES_HERE/ {
        proxy_pass http://127.0.0.1:9000/;
        proxy_http_version 1.1;
        proxy_set_header Connection "upgrade";
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header X-Forwarded-For $remote_addr;
        proxy_set_header X-Forwarded-Proto $scheme;

        # by default nginx times out connections in one minute
        proxy_read_timeout 1d;
    }

    # Configure reverse proxy for Node Red
    location ^~ /YOUR_PREFERRED_NODERED_URL_GOES_HERE/ {
        proxy_pass http://127.0.0.1:1880/;
        proxy_http_version 1.1;
        proxy_set_header Connection "upgrade";
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header X-Forwarded-For $remote_addr;
        proxy_set_header X-Forwarded-Proto $scheme;

        # by default nginx times out connections in one minute
        proxy_read_timeout 1d;
    }
}
 
Let's Encrypt
From Wikipedia: "Let's Encrypt is a non-profit certificate authority run by Internet Security Research Group that provides X.509 certificates for Transport Layer Security encryption at no charge."

The model for using letsencrypt is pretty simple.  They sign your SSL certificates, free of charge, but their signing expires within 90 days.  Hence, they're encouraging a high turnover of certificates by regular renewals.  This means that realistically you need to automate the process of certificate signing.  To do this I'm using the getssl script which makes life extremely easy when coupled with a cron job to kick off the script on a regular basis.  I'm running it every day and the script decides whether to replace my existing certificates.  It all sits there quite nicely running in the background and doesn't get in the way at all, restarting NGINX only when a new certificate is put in place.  Due to the fact that NGINX is decoupled from the services it is proxying the other services aren't interrupted.

Monday 11 April 2011

Another New Home Server

Those of you following this blog over the past couple of years will know I've already had several low power home servers including an NSLU2, tinytuxbox and Joggler.  The NSLU2 and tinytuxbox are both history but we've still got the Joggler at home.  After finding it was grinding to a halt with the stuff I was running on it while trying to use it interactively it became clear we needed something else at home too.  Since I was also running out of storage space on my home PC a NAS solution seemed like the obvious choice so I went for a Netgear ReadyNAS Ultra Plus 2 (RNDP200U).

I opted for the ReadyNAS Ultra series because I run a SqueezeBox Duet for my music and Netgear are the only partner directly supported by Logitech for their music devices.  After spending huge amounts of time hacking the NSLU2, tinytuxbox and Joggler I felt it was about time I had a device that "just worked" so the option of simply downloading and installing stuff and having it work is really quite attractive.  Of course, other NAS devices can run SqueezeCenter but whether the community supported versions work well and are kept up to date is another matter which I didn't investigate thoroughly.  Another good reason for choosing the Ultra series is they're based on x86 hardware so some of the code and plugins I know I want to run which had previously not worked (or been possible) on the slug for example would be fine, a lot of NAS boxes are still running ARM processors.

The Ultra 2 comes in 2 flavours and I went for the more powerful of the two (the Ultra 2 Plus).  They are exactly the same except the Ultra 2 Plus has a dual core processor vs a single core on the Ultra 2.  Given I'm fully intending to run what is probably more than average on the NAS the chance of getting a more powerful processor was well worth the extra few quid it costs.

On the subject of price, the NAS solution is probably one of the more expensive ways to get yourself a home server.  Again though, the "it just works" factor comes heavily in to play here as I'm not responsible for installing the O.S. and setting up a raft of different services on the box, they're all just there, working!  Probably the most competition for a NAS would be the Asus Revo running Linux, possibly with FreeNAS on it too.  The Revo with the same processor as the Ultra 2 Plus I bought is around 60% of the price.  The Revo isn't able to support the amount of storage you can get with a NAS device though, doesn't (easily) support RAID and if I did want to do those things it would have to be with ugly USB attached disks which are hard to spin down when not in use.

It took just a matter of hours to unpack, boot and setup the device in the way I wanted.  The array has been formatted and exports a share to Linux and Windows boxes, all my data has been copied on there with plenty of room for expansion and user management is sorted.  After that, updating SqueezeCenter to the latest version was simple and installing other additional software (whether official or community supported) is also really easy.  So far I've set up transmission (for bit torrents) and enabled ssh access.  Hardware management is all done through a web interface so the option of automatically powering on/off the device on a schedule or setting up disk spin down is merely just a box tick away.

I've got it connected to a 10/100 switch which is fine for streaming music to the SqueezeBox or sharing pictures with the Joggler but for access from my PC and to large amounts of data I figured that throughput wouldn't be enough.  Fortunately, the NAS has 2 Gigabit Ethernet ports so I've used the second one to direct attach it to my PC and enabled Jumbo frames.  The performance over that link has been absolutely fine whether measured simply by the subjective feel of how long it takes to do certain tasks or via a more rigorous iozone test.

With the tasks of device and software management all taken care of the the thing up and running in no time at all, I'm looking forward to having more time on my hands to do some even more interesting hacking with the box instead.

Thursday 20 May 2010

Getting a Joggler, the how and the why?

Buying a Joggler is pretty simple, you can just go to the O2 shop and get one for one hundred of our UK pounds, or fifty if it's on sale.  The reason for putting "the how" in this isn't to teach you how to buy stuff on the net.  No no, more to say you can get it for less than fifty quid if you're careful!  Those of us who work for IBM have been buying them through a money saving web site we have access to as IBMers such that you buy the Joggler and a PAYG Mobile Internet USB dongle (which you're not obliged to use) for a total of £60 and get £25 cashback for doing so.  That's £35 for a Joggler and mobile Internet, bargain!  I would think this sort of offer must be out there in the wider world too if you look carefully enough.

So why do I, or you for that matter, want one?  There's lots of different uses for it.  Even if you look at it as a dumb wireless digital photo frame then it's far cheaper than other wifi frames out there.  The neat thing about it is it runs a version of Linux internally, has a USB port and is also capable of booting from USB.  This means you can run pretty much anything you like on there instead of the default O2 interface.  So, it's the ideal hacking toy and can become a fully fledged computer system disguised as a photo frame if you choose to do so.  The sky is the limit.

For me, I use it as a low power home server running:
  • remote login to home (ssh)
  • music streaming (squeezebox server)
  • internet connected photo frame (gphotoframe)
  • trivial internet browsing (chrome + touchscreen addon)
  • file server (nfs, http, ftp, smb, etc as required)
  • backup server (rsync) 

I've also found it very useful to have a computer connected to my printer for wifi print serving from my laptop in the past.  Currently the Joggler isn't located next to my printer so I'm not doing this but it's definitely an option for the future.  Similarly I may eventually reconnect my current cost meter for home power monitoring, sending daily electricity bill via email, graphing and storing stats.  Another use I could put it to is as a WOL client so wake up other machines in the house remotely so I don't leave them powered on all day (not that I do this anyway), but I haven't configured WOL yet.

Not investigated yet but it seems to me it should be possible to run the OpenPeak apps on Linux too.  These are just flash applications so I should be able to run them on the Linux desktop without any issues which would provide me with the same functionality I would get from the original O2 interface under my own Linux.

You can find a lot more of my information about the Joggler at my Joggler Index post. I also have a list of Joggler Bookmarks.

Wednesday 19 May 2010

Joggler Index

This post will be kept up to date serving as an ordered index to my notes about the O2 Joggler; essentially a glorified digital picture frame with a touch screen.  All posts will use the joggler tag too but these may appear in any order.

The very brief tech spec is:
  • Intel Atom Z520 with GMA 500 chipset
  • 512MB RAM
  • 1GB Internal Storage (to run the O2 operating system and interface)
  • 7 inch touch screen
  • USB port, audio jack, wired Ethernet and wireless network
I have a list of Joggler bookmarks.

    Sunday 18 January 2009

    LED Lighting


    We're having a little bit of work done on the house and as part of that I had to move the outside light by the front door. On further inspection I found the old light wasn't going to cut the mustard in the new location, it wasn't going to be waterproof for one, which is sort of important. So a great excuse as if any were needed to buy something new and funky!

    The obvious choice to me was to look into whether LED lights are available for outside lighting. Imagine my surprise when I found it seems they're actually getting quite commonplace and we were able to nip down to our local DIY store and pick one up. For some reason I was expecting to hunt around Internet sites and order one. The pictures shows what we bought. It's a fairly small chrome effect affair with two plastic panels beyond which are mounted a total of 24 white LEDs, 12 of these are at the front and 12 to the rear.

    It provides plenty of light, not massively bright and offensive like security lighting, but easily enough to see your way up the drive to the doorway. The best part of this, as with all LED lighting, is the power usage. My current cost meter doesn't budge when it's turned on, not even a sniff of a change in power usage. Assuming I've not wired it up to some free electric supply I'm not aware of, or accidentally stolen from our neighbours, I can only conclude all 24 LEDs are using less than one watt of power. It's my first LED installation at home and almost certainly wont be the last.

    I hate to finish on a downer but there are drawbacks of course. The LEDs are not replaceable so if one dies, however unlikely, you have to put up with it looking silly or replace the entire light. The other is the colour of the light, we've all been brought up with tungsten lighting so the colour of LED light does take a little getting used to.

    Friday 19 September 2008

    Turning my house off

    HE-307
    After talking recently about the stand-by power savers I've been messing with at home I've made another small investment in the Home Easy range. We now have a switch I've located downstairs we can use to turn one or more sockets off in the house. It's a small step I know, but this simple device will effectively become the on/off switch for our house. Currently, we're only using it to control one socket to switch off all the electrical gadgets in the living room such as the TV, DVD hard disk recorder, Wii, etc.

    I like the idea of being able to turn your whole house on/off. So this switch has the potential to be extended should I make further investment into Home Easy kit. We could eventually have computer controlled devices all around the house to activate lighting or any electrical device. With one press of this button the whole lot would turn off in order to make power savings as we leave the house or overnight though. As well as saving some cash it gives you a great green feeling of energy saving too, safe in the knowledge that only the essentials are left on at home. For us right now, the essentials are the home server, network router, our fridge-freezer and currently a second freezer to store our surplus vegetables from the allotment. These typically use 130 watts as an average total which goes down from something like 170 watts I think when we turn off the stand-by switch.

    I was hoping for a certain amount of traction and community to build up around the Home Easy range, being the first reasonably complete and affordable range of radio controlled devices in the UK. However, that doesn't seem to be the case. I have loads of little questions I would love to ask Home Easy, mostly about future products and their intentions. So far, it's been difficult to communicate with them or other users of the products. For example, their web site has a forum link with a few registered users on the forums, including some staff from Home Easy. In order to get access though, you have to e-mail one particular guy and wait for him to approve your access which isn't ideal. I e-mailed several months ago and I'm still awaiting my ID. Conclusion, the forum isn't very active and the community I was hoping for doesn't exist, yet.

    Tuesday 22 July 2008

    Current Cost Monitor

    A couple of guys at work have managed to lay their hands on a funky new device called a Current Cost meter. It's pretty simple to understand, it measures your household electricity usage and displays it on the screen (left). To do this it comes in two parts, you hook a plastic loop around the live feed going into your fuse box (mine is in the garage) which is connected to some electrical wizardry I don't understand to measure the current without interfering with the wire, and a wireless transmitter device to send the data to the unit you just plug in somewhere in your house.

    I jumped at the chance to get one of these things and was one of the first batch to get them at work and a little community of current cost users has built up pretty quickly. That said, pretty much everyone else has beaten me to blogging about it with some very cool results. So here's the list (that I know of) right now, in no particular order we have...As an aside, Dale's just joined my department at work (horay), and Roo is leaving IBM (boo and much sobbing).

    There's lots of other people looking into these things too, but those are just the blogs I know about. This type of device isn't exactly new, but what makes this one exciting is the data port and connectivity to a computer. With such a community there's been some cool work done such as graph power usage and send yourself a daily electricity bill. The device itself can't really save you money and definitely doesn't save energy (you have to plug it in) but what it does do a great job of is educating you about exactly what all your household devices like to eat for breakfast.

    I'm just starting out at home having had the screen in the kitchen for a couple of months already with looking at what I can do with it while connected to a computer. I'm now logging all the data to a database so I guess one of the first things I'll be doing is graphing my own data. From that I hope to learn even more about what my house does with its power. For now though, the only graph I have (above) is that produced by sending my data via a Nanobroker to Andy Standford-Clark's server. This should hopefully be another fruitful little project for my new (and now you know why it's low power) home server.

    Sunday 13 July 2008

    Introducing the TinyTuxbox

    My second choice of home media server arrived on my doorstep last week after my unwillingness to maintain the painfully slow and awkward slug. This time around I've plumped for a TinyTuxbox Series 8 which seems to be a UK resold version of the e-Box 4300. It fits the extra requirements I made after parting with the SLUG, that is it's an x86 based machine and has lots more memory. I'm not the only one at work with one of these types of boxes either, James Taylor has the Netvoyager re-badged version of the previous box to my one, the e-Box 2300.

    It is, in fact, a fully functional x86 PC but just a really small one, even smaller than the pretty tiny Fit-PC which I was also seriously considering and probably would have gone for were it not for the excellent pre-sales support of one of the TinyTuxbox staff over e-mail. That said, the excellent pre-sales was balanced with painfully slow delivery. It took 28 days to get it to my door which for a delivery cost of nearly £20 I consider poor. I've been left with a upward feeling though, post-sales support has been promising too as I initially had some problems installing the box, which it turned out were my fault and I solved quickly enough anyway. I'm not going to talk software here though, that's a story for another day. So how does my TinyTuxbox look and spec up....?

    The workhorse of the TinyTuxbox is the 500MHz Via Eden ULV processor which provides a 32-bit x86 processor along with a built-in graphics processor with hardware MPEG decoding. The processor is an impressive bit of kit, it runs all that from just 1 watt of power, see the link for the full specs! Away from the processor we have 512MB RAM (some of which is shared for the video output), on-board Ethernet, 3 USB ports, VGA output, a PS/2 connector (supplied with PS/2 Y-Splitter cable to connect both keyboard and mouse), a compact flash slot, sound in and out, power button, and hard disk and power LEDs. The box is also fitted with an IDE connector and can house a 2½" laptop type hard disk in it. I ordered it without the hard disk and fitted my own as the supplied ones were not good value for money probably due to the services incurred from the fitting itself.

    The TinyTuxbox site advertises the unit as consuming a maximum of 8 watts and I'm pleased to report that was absolutely accurate. According to my current cost meter, it uses 8 watts with the hard disk spinning so once I get it to spin down on idle it should use very little juice. Click the various images for a link to my Flickr page and some more notes.

    Friday 11 July 2008

    Introducing Home Easy

    One of the things I've been giving consideration to while choosing my media server is home automation. I don't want to go crazy about it and have everything in the house hooked up to a computer so curtains open when alarm clocks go off, or alarm clocks go off earlier if it's freezing outside (to give more time to scrape ice), etc. I'm more interested in a few subtle things to help be more green at home, and possibly to help with security, anything I can get that adds convenience is a bonus but not necessary for me.

    The first simple step I've taken along this road is to get some stand-by power savers that are getting ever more popular these days. The one I went for was the introductory pack from the Home Easy range which are manufactured by Byron and retailed exclusively through B&Q.

    The pack gives you three radio controlled sockets into which you can plug your devices at home, and a remote control to turn on/off the sockets. So, by plugging in my TV, DVD, Wii, and other devices to one of these via their 4-way extension lead I can turn off a whole bunch of stand-by with the click of a remote control button anywhere in the house.

    The Home Easy range is relatively complete for a UK home automation solution not based on X10. The kit is reasonably priced too with the 3 sockets and remote costing £20, unlike X10 end points. One of the reasons for choosing Home Easy over another popular standy-by saver is that the range is more complete, but also the protocol is well known so third parties are starting to produce devices compatible with Home Easy too. For example, rfxcom have certified their transceiver to work with Home Easy so it's now possible to computer control Home Easy devices - nice!

    The next tentative steps I'll be looking to take on this road are having a home on/off switch. It's annoying having a single remote control, it's small, you have to find it, and it might be upstairs/downstairs and probably not where you are. I want to take advantage of the home easy grouping facility to have a switch that basically turns my house on or off. We should be able to leave the house (or go to bed) and turn all the stuff we're not using off, and turn back on again when we get home (or wake up).

    Just this one purchase can save me anywhere between 20 and 50 watts in stand-by power. At 10 pence per kilowatt hour (typical rate) I'll get my £20 back with just 6 months usage. So it's green and saves you some dosh too, bonus!

    Saturday 31 May 2008

    SqueezeCenter on the SLUG

    At first glance, installing slimserver (now SqueezeCenter) on the SLUG is very straight forward as it's nicely packaged into an ipkg and made available via Optware. However, as indicated on the slimserver application page on the nslu2-linux wiki, things aren't as simple as they first appear. Unfortunately, something is very broken with slimserver and its dependency chain in Optware as things stand at this moment in time. As a result installing slimserver with a view to upgrading to squeezecenter at a later date becomes much more problematic. I need at least SqueezeCenter version 7.0 to operate with the SqueezeBox Duet.

    My first target was to run slimserver 6.5.4 which is the latest version from the version 6 line and the version packaged for the SLUG in optware. I tracked the problem down to the mysql dependency for slimserver, it seems since the last update of slimserver in optware, mysql has also been updated and since that time slimserver has been reported as broken on the SLUG. Unfortunately, rolling back versions in optware is not trivial since they only make available the latest version with no access to previously packaged programs. My only option was to check out the mysql build environment from SVN at the previous level and compile up the package from source. This is reported to take in the region of 18 hours natively on the SLUG so I set up a cross-compilation environment on my Fedora 8 box at home. MySQL compiled in about 10-15 minutes and I now had a package to install. The reports were correct, slimserver 6.5.4 was now running on my SLUG, excellent!

    The next challenge was to get SqueezeCenter running, and this worked in a similar way to getting slimserver going. There are a few oddities with getting all your ducks in a row while running this stuff on a SLUG, SqueezeCenter is very particular about file permissions, and the newer software introduces a whole bunch of Perl dependencies not present in the earlier slimserver versions. Fortunately, I'm very familiar with Perl as well as Linux (one of the reasons for choosing a squeezebox) and I've managed to compile up the minimum dependencies to get SqueezeCenter going. It seems Slim Devices as a company test against x86 and PPC architectures to the extent they even supply their Perl dependencies for these from CPAN. I'm running on ARM on the SLUG though which introduces a whole world of dependency problems as it seems SqueezeCenter is also pretty sensitive to the version of each Perl module used, it's not just a case of grabbing the latest and greatest from CPAN, a further bind for getting it going nicely. One other thing, CPAN doesn't seem to run at all well on the SLUG, it's far faster to download the tarred packages and compile manually!

    I eventually got SqueezeCenter 7.0.1 running on the SLUG, it consumes at least twice the 32MB RAM available so runs pretty slowly while spending a lot of time paging to the USB disk. I set up an additional swap file on disk as well, thinking about it perhaps I should have used the rest of the 8MB flash as swap too! All in all, running SqueezeCenter on a machine with so little memory and on an architecture not supported by Slim Devices has equated to a slow response time and a maintenance headache.

    In conclusion, it's been a good experience getting a SLUG and setting up SqueezeCenter on it. But I already need a more powerful box so less than 1 week after the SLUG arrived at my house it's time to sell already. Fortunately, I've found a buyer at work who wants something low power for some really trivial services so the SLUG is ideal for them. For me though, it's a case of getting back to scratching my head over which low power home server solution to try next. Whatever I choose will be more expensive than the SLUG, it's possible I could equal its low power usage, and I definitely now know I need more memory and ideally an x86 architecture.

    Thursday 29 May 2008

    Unslinging the SLUG

    Having recently purchased the Linksys NSLU2 (commonly called a SLUG) for use in a hacked form as a low power home server, I've been playing around with it a little to customise it towards my needs. The eventual aim is to run SqueezeCenter on it to power my new SqueezeBox Duet. The most commonly used hacked version of Linux provided by the SLUG hacking community is known as uSLUnG, hence hacking the SLUG with this being called unslinging.

    The process of unslinging is made very simple, thanks to the great instructions developed over the years by the community, and with such a large community the amount of testing on these instructions is pretty complete too. First step is to download the firmware binaries as described on the SLUG Firmware site. I used firware version 6.10 Beta which is considered the latest stable version in spite of having a beta tag. Then simply followed the instructions in this README file and I was done. The whole process takes no more than 10 minutes or so.

    Now I have a nice little low power Linux box sitting on my network raring to run some services for me. Pretty much anything you can think of has been done on the SLUG, Apache, MySQL, etc, etc, etc. So the list and choice of what to do is very complete. For now though, I've just installed a few basic utilities (coreutils), Perl (I know I'll need that later), GCC, and SSH for remote access.

    I'll quickly mention the SLUG specs in passing too. It has a 266Mhz ARM based Intel XScale processor, some of the early models were under clocked at 133Mhz but all the recent editions run at full speed; 8MB flash; 32MB RAM; 2 USB 2.0; 10/100 Ethernet; runs from 5V DC power and measures just 2 x 9 x 13cm. With one USB disk attached my Current Cost meter reads it at about 5 watts power usage which I guess may rise a watt or two under load.

    Wednesday 28 May 2008

    Choosing the media server

    The decision of which media server to go with has easily been the longest and most agonising while putting together new audio solution at home. I'm not the only one at work having recently been looking in this area either, James Taylor has also been looking at home servers with similar requirements in mind to myself. Namely, cheap and low power (low electrical power for always-on as opposed to a slow processor).

    In no particular order, options on the list for me were:
    EDIT (suggestions from comments, with my thanks):END EDIT

    All have clear advantages and weaknesses I wont go into in detail for each box. However, they can roughly be grouped into cheaper solutions as provided by a hacked NAS box, or more expensive PC style systems. Some go straight out of the list on price alone, such as the relatively expensive Mac (I don't understand the Mac fad, single vendor lock-in, haven't we seen that somewhere before?).


    I decided to plump for the cheapest of all the options, the SLUG. I figure that even though it has a slow processor and only 32MB memory it does have a fighting chance of running SqueezeCenter to power the Squeezebox Duet based on the reports of other users running SlimServer on it. If all else fails, there are plenty of people at work looking for low power solutions who may be willing to buy a 2nd hand SLUG should I want to upgrade anyway.

    The SLUG is a very well-known device in the land of hackery. It can easily be modified to run any one of several different versions of Linux that maintain different levels of compatibility with the original Linksys firmware and interface. It's purpose in life when released (back in 2004 I think) was as a cheap NAS box that simply provides a USB to Ethernet interface. The idea being you plug a cheap USB hard disk into it, configure via the simple web interface, and you have storage you can access from anywhere on your home network. Because Linksys made the device cheap, naturally their choice of operating system was a free one, Linux. The Linux license dictates Linksys had to make their source code available, hence it's easy to modify the original software for your own purposes. The rest follows from there really!