2013/09/03

deathstar 0.2

When you give a young child a hammer, regardless of upbringing, culture, safety instructions, ... it'll start whacking everything with it. A hammer seems to be one of those universal tools that everybody can figure out.

When you give an IT professional NetKernel, regardless of upbringing, culture, safety instructions, ... he'll (not being sexist here, chances are - sadly enough - better than even that it'll be a he) start whacking every problem with it. NetKernel seems to be one of those universal tools that ... ok, the simile does break down a bit here ...

So I happen to know that several NetKernel gurus also use it for their home monitoring systems. These contraptions are called DeathStars.


This is an inside Resource Oriented Computing joke. After studying the capabilities of the DeathStar in Star Wars closely, Tony Butterfield concluded that it was impossible. The amount of computing power required that is. Unless they had ROC, right Tony ?

Recently I've been introduced to very small computers. Most people in the industry know about the Raspberry Pi and at some point it was demonstrated that NetKernel could run on a plug computer. More recently however, the market is being flooded with TV-sticks, usually running Android. Only, besides from plugging into the HDMI port of any modern screen or tv, these sticks come with dual and now even quad core ARM processors ! Surely we can think of something better than watching tv with that, no ?
That's José Jalapeño on a Stick. If you don't know who that is ... get a life !

So when RikoMagic listened to the masses and brought a stick on the market that natively runs Linux (Picuntu to be exact), I jumped and snapped up a couple (the MK802 III LE). They come pre-installed with a lot of packages, Java being one of them. How easy can you make it ?

Very easy. In fact, since this is my blog I can shamelessly put in some plugs. Andrew Kirby does the support for RikoMagic in the UK and if something (see further down for some examples) wasn't already worked out in detail, he worked it out for me. Immediately. There are many stick-providers out there, but RikoMagic has seriously gotten ahead in my book and I'm already drooling over the quad core LE (soon he tells me, soon ...).

Installing NetKernel ... booting NetKernel ... updating NetKernel ... piece of cake. I removed a couple of the bigger packages I didn't need (apache, mysql), but there's plenty of room on the stick really.

Couple of the downsides. The ARM Java doesn't give me a very high performance score (even though I have two cores). Also, the SD cards used are very sensitive to power interrupts, so make sure you've got a backup image (and know how to put one back).

No, I wouldn't start a Bitcoin mining operation with a box of these, but as a data collector and forwarder unit (aka DeathStar) it's perfect. Now, I'm not Joe/Harriet the Handyman/woman. My knowledge of home monitoring stuff is very limited. However, this blogpost about external temperature monitoring with Linux seemed like a good starting point.

I ordered the LinkUSBi and a couple of TSense sensors and waited for a couple of days for them to arrive. During those I read up on digitemp and I also installed a tool called owfs on my stick.

When ordering all this stuff, order as-locally-as-possible. Otherwise you're up for a surprise as you'll have to pay the customs fee too.

I connected the LinkUSBi to the stick, a TSense to the LinkUSBi. I check dmesg and lo and behold, the device shows up there. I look for the /dev/ttyUSB* device that should get created ... but it's not there. Damn. Let me spare you the frustration and the weeding out of outdated (or plain wrong) references on the internet. What I'm missing is ftdi_sio in the Linux kernel. Pretty standard in most kernels, but it's not on the stick.

Andrew (Andy) Kirby comes to my rescue. Note (plug again) that he doesn't have to, there's nothing wrong with the stick, works as designed. He puts a complete MK802 III LE kernel kit online for me with detailed instructions on how to build it. All I have to do is change one line in the kernel configuration and activate CONFIG_USB_SERIAL_FTDI_SIO. Next I flash it to the stick (again, detailed instructions provided by Andy).

With a simple command I can now see the external temperature. With a simple NetKernel module I execute that command every minute. A simple NKP connection forwards that information to an instance in the cloud. An instance that can receive temperature (and other of course) information from - potentially - thousands of such sticks.


Yes, I know, this is nothing world shaking. Deathstar 0.2 as I call this exercise is pretty useless in itself. That is however not the point. The point is that for very little money (they practically throw these TV-sticks at your head already and prices are still dropping, the sensors were likewise very cheap) you can put in place a complete botnet of collect-and-forward units. Can you think of an application ?