May 092013
 

Running OpenZwave on Your Cubieboard

Before running off to play in the unknown (to me) land of the Cubie, I figured it would be a good idea to try out OpenZwave, my Aeon Lab Z-stick and the OpenZwave Socket servers.  So far the Cubieboard is running well with the last compiled version of OpenZwave with Conrad’s Lights Control, OpenZwave Control Panel and my Basic Zwave web interface.  All of the applications run at about the same speed as they do on the Raspberry Pis.

My CubieBoard Setup:

  • Cubieboard 1gb RAM version 2012-09-09
  • This Debian Wheezy image with the device specific bootloader.  (This is a very clean minimal install that is headless only.  You MUST ssh into the Cubieboard.)
  • A 8gb microSD card that came out of a HTC Evo Phone.  The card is slow.
  • Aeon Labs Z-stick 2

OpenZwave Info and Starting the Socket Server

The image below contains exactly the same version of the OpenZwave library, clients and servers as the last Raspberry Pi image.  The host name has changed to cubie-openzwave (cubie-openzwave.local on bonjour).  DHCP is enabled by default and the host name is set to broadcast and announce services on Avahi.  The image contains three applications for playing with Zwave: OpenZwave Control Panel, Lights Control and Basic.  Lights Control and Basic run with nginx with PHP, curl, APC, and sqlite. The OpenZwave Control Panel uses libmicrohttpd and magic.  Start up instructions will come up as the ‘message/motto of the day’ when you ssh into your Cubieboard.  You can also see the instructions on this Rasberry Pi OpenZwave post.  Only one OpenZwave application can run at one time – so make sure to run killOZW before switching between Basic and Lights Control.  I tested with a multilevel switch, binary switch and a thermostat.

The username is ‘root’ and the password is ‘password’.  Type ‘passwd’ to change it.

Download: cubie-openzwave-2013-05-09-4gb.img.7z (240ish mb)

Notes: I used 7zip on Mint and had some issues writing the image on Windows.  The image worked correctly on Debian and Mint.  Please let me know if you have any issues.

If moving the files to your own Linux image – I had problems with the ‘basic-server’ not finding the dynamically linked libraries.  It would give me an error saying that no file or directory existed by the name basic-server (file was there with correct permissions).  The command ‘ldd’ would spit out an error that it was “not a dynamic executable”.  To fix the problem, I had to copy ld-linux.so.3 to its old location of ‘/lib/’ (yeah, I guess I could have  recompiled – always a time crunch) from its new location ‘/lib/arm-linux-gnueabihf/’.  The command is ‘cp /lib/arm-linux-gnueabihf/ld-linux.so.3 /lib’.  From the information I gathered in a couple of minutes of research, this runtime linker location was a big deal last August and probably impacts a lot of other programs running on Debian and Ubuntu.

May 052013
 

CubieBoard vs RaspberryPiThis week has been full of unexpected surprises.  I finally received the Cubieboard I had order several weeks ago.  I think I paid $59 + shipping for the kit which came with a case, cords and a cardboard box similar to the original boxes that Raspberry Pi’s were shipped in.  I didn’t have high expectations for the device to be honest because my only exposure to them has been people having problems compiling openzwave on the Raspbian that was mangled to work on the Cubieboard.

Another area of concern, the documentation online for the Cubieboard is horrible compared to the documentation and community available to Raspberry Pi owners.  The strangest thing for me is I don’t know which is the official forum.  There are two links to two different forums on the main Cubieboard site and most of those posts link to another AllWinner board.

Back to the packaging, it was actually really nice.  It had inner boxes with more inner boxes and nicely custom cut foam.  The only thing it was missing was the “designed in Cupertino” on the side of the box.

When I pulled it out and went searching on the web for the amps needed for the supplied usb power cord, I learned that this bad boy has 4G of NAND memory with Android already loaded on it (yeah, I am an idiot for not knowing that ahead of time).

I know I should have removed the paper.

I know I should have removed the paper.

I was shocked.  In a good way.  I thought I would have to spend a couple hours fighting to get the perfect image on a micro sd card to even get to see the thing in action (something I knew I didn’t have time for today).  Instead all I had to do was plug in power, hdmi, and a hub for the mouse, keyboard, and wireless (super cheap dongle worked immediately).  Best of all, once I had it plugged in it looked like Christmas with bright green and red leds.  Wonderful.

Then surprise two: it didn’t dawn on me that this is just a giant tablet.  It runs almost all tablet apps from the Play store including the most bullshit Comcast app.  The Comcast app does not let you use airplay to extend your content onto a larger screen due to ridiculous DRM standards (and even though the dialog box on Apple even says ‘stream anything you can see on your iPad to your Apple TV’).  It was so glorious to defeat Comcast and watch the shows on the big screen, I left it streaming anything and everything the rest of the day.  Tomorrow, I plan on having Entourage going in the background while I get some work done.

Now I haven’t gotten to the real use of this toy yet.  The evaluation is completely premature but after day one, I have to say this is better and easier  to use than the Raspberry Pi.  People can ease in to making disk images but still have something to play with while they are learning.

Another nice thing is the fact that the case and cords are included.  Then when you look at speed, RAM, SATA connections 4g NAND,  and the fact that your ethernet that does not compete with your usb devices….. I am really starting to like this.  Let’s see how day two goes.

Forgot to mention – plugged in my cheap wifi dongle and it just worked.  Way to go Android.

Day 2 Update

Still impressed.  I followed a nice tutorial to get a minimal Debian Wheezy install up and running from a micro SD card.  The process is very similar to the Raspberry Pi experience but their are a few extra steps because so many devices share the same distro.  After writing the distro to your SD card, you have to write the device-specific bootloader.  In my case, the /dev/sdX was /dev/mmcblk0.  When you write your images you will see two partitions – just like the Raspberry Pi.  For a quick test, I ran ‘sysbench –test=cpu –cpu-max-prime=20000 run’ on the new install and got an average total time of 656.2975 seconds to complete the test.  I am not sure how that number compares to other Cubieboards / Cubieboard distros.  A lot of forums talk about the need to tweak the cpu to run more like a server and less like a tablet but I have not ventured down that road yet.  As a quick comparison, my GitPi did the same sysbench test in 1320.0708 seconds and 1081.8397 seconds on an OpenZ-wave test Pi.

If you want to install sysbench, you can get it from the repo with ‘sudo apt-get install sysbench’.

Apr 272013
 

 Three Raspberry Pi Projects That I Probably Won’t Finish

I start a lot of stupid projects. There are some winners (favorite GitPi and Christmas Lights) but it is time I cut off the below losers and dedicate my time to something else.

LampLAMP

Raspberry Pi LampLAMP ServerI had a simple idea to gift Ali a new lamp for the corner of her office that she could use for debugging. I think my original thought was that it looked raspberry-ish and it was a lamp that was running a LAMP server and that combination was funny – in an I Love Lamp sort of way. We all make mistakes.

I wanted the Raspberry Pi to be completely encased in the lamp but still have most of the interfaces ‘accessible’ without having to take apart the lamp every time we needed to change something. This desire caused the first pause in what should have been a weekend build. I purchased a version of this SD card extender from China. When it finally arrived three weeks later, I started the build. I pulled an cat 5 cable, micro-usb to usb for power, a mini-usb to usb for a usb hub, several wires so I could access the GPIO and my brand new, straight from China SD extension cable. It would blink for a few seconds and then cut off. Awesome… The one interface I didn’t try to extend, the video, I would now need. I refused to believe it was my new SD extender so before taking it apart, I spent about 30 minutes trying out different SD cards. It took all of 2 minutes to figure out what the problem was after I hooked up a monitor. All i/o errors when using the extension cable. At this point I was pretty much done.

Raspberry Pi Watch Winder

One complaint I have about watches with mechanical innards is you actually have to move about 8 hours a day to keep them on the right time. Being a programmer, it almost never happens and I have to manually wind my watch. So somewhere in my mind I thought it would be a good idea for my GItPI to also be a watch winder fashioned from what ever crap was around during the 30 minutes I was testing it. Previously, I had purchased a small stepper motor for testing purposes and figured it was the best place to start. So I strapped the motor onto an old harddrive with electrical tape, made a small program to spin the motor, and after shoving the top of a water bottle onto the motor (forget about the time needed to figure out gears) I was spinning a watch. The problem was with the weight of the watch the ‘spinning’ portion was hanging down against the desk and acting more like a wheel with a watch in it than a watch winder. With better planning this would have worked well, I think. No time to wait for bearings or materials to hold the rotating mechanism in place, someone else could fabricate something much better.

Code for winder.

LAMP Stoplight

LED Stop LightReally this was more of Apache2 stoplight. I bought some arcade buttons with led in them from ebay (of course in red, yellow, green) and connected it to a 9v power supply, and SainSmart Relay (btw, I think they left me comment spam last night – I sort of feel honored that I made it on their radar). I wrote a little bash script using wiringPI GPIO controls and set up three conditions. The first, the red light, means that Apache is not responding and the server is most likely down. The second, the yellow light, indicates that more requests are being made than the random threshold I picked. Green means Go or G2G.

Code for project – and code to make it switch like a stoplight. Very incomplete.

It was fun to watch it switch around for a while, but the clicking from the relays drove me nuts so I just broke down and downloaded the Zenoss VM on my desktop. Any ideas as to what to do with it next?

Watch it in all its glory.

Apr 132013
 

Dimmer switch control for Basic OpenZwave Socket ServerFor anyone using the latest Raspberry Pi OpenZwave Image, the support for multiswitch outlets is limited.  I have not had much of a chance to work on it but I have a quick update to the Basic OpenZwave Socket server that will allow easy control over the switches.  To install, download the zip and copy the files into the appropriate web directory by typing ‘OZW’ then ‘cd basic’.

Again, this is a quick fix not a final solution.  If you are not using dimmer switches, you probably don’t want to do the update.

Download: basic-server-client-update.zip