Raspberry Pi, Fhem and the Philips Hue

While searching for other ways to control a set of Philips Hue lights, I found fhem (a GPL’d perl server for house automation). With fhem I can have a huge amount of flexibility on automation rules and combination of devices working together; but for now I’m interested in a quick way to control the lights from outside of my house without using a 3rd party service.

For the Raspberry Pi OS, I went with Raspbian . Instructions are already pretty detailed on their site so I won’t repeat it.

To install fhem, do the following on your Raspbian:

1. sudo apt-get -f install && sudo apt-get install perl libdevice-serialport-perl && sudo apt-get install libio-socket-ssl-perl && sudo apt-get install libwww-perl

2. sudo wget http://fhem.de/fhem-[latest-version] && sudo dpkg -i [latest-version].deb

3. cd /opt

4. sudo chmod -R a+w fhem && sudo usermod -a -G tty pi && sudo usermod -a -G tty fhem

5. sudo cpan JSON

6. echo -n $Username:$Password | base64 (Save the output of this command!**)

Now go to your fhem web view, at http://ip-of-your-raspbian:8083 . You will probably see an alert:

WEB,WEBphone,WEBtablet has no basicAuth attribute.
telnetPort has no password/globalpassword attribute.

To remove this, edit your config file by going to “Edit files” and then click on “fhem.cfg”. You’ll need to add:

attr telnetPort globalpassword $Password

attr WEB basicAuth **Output_of_step_6_command_above

attr WEBphone basicAuth **Output_of_step_6_command_above

attr WEBtablet basicAuth **Output_of_step_6_command_above

On my example, I used the same username and password combination for the web, mobile and tablet interfaces, which is written on step #6 above. If you wish to use different password and/or usernames just create new base64 hashes.

Going back to fhem’s web interface, you should now see a text input box on the top of the page and on the left a set of menu items. On the text input box type:

define bridge HUEBridge

After that, run really fast to your Hue bridge and press the link button. Go back to fhem, refresh and you should see the Hue Lights now displayed.

Sources:  meintechblog (in German),  Robin’s Blog (in German)

Why do people prefer piracy over FOSS?

A question I seriously ponder quite constantly… why would someone prefer to use pirated copy of softwares instead of using free open source alternatives?

Most of the people I know back home in Brazil have a hacked copy of Windows. Why use it if you won’t pay for it?

I see people all excited about getting their hacked Photoshop just to use it to crop images, resize them, or at most do some basic image editing. Why use it if you would never dream of paying for it?

I switched from Windows to Linux after I changed desktops and couldn’t carry the OS to my new machine. A bit before that, I started using a lot of open source software and basically lost no productivity.

So, I keep wondering, why are people so hesitant to try free and open source software? Sure some proprietary software have more features and functions, but the vast majority (if not all) of the people I know do not use 10% of the resources available in these expensive products.

Open source software is basically free in cost, you can easily have more control on their development roadmap (giving your input, money, or coding skills) and you know it is safer for your machine. So, why not make the switch?

Install and setup Ubuntu Eee 8.04

I’m glad to report back saying the attempt to install the Ubuntu Eee 8.04 was a success. Now my Eee 4G is quite a sexy machine. I’ll detail for you the steps involved in the whole installation and tweaks.

1) Install

Head over to the Ubuntu Eee Download and Install page to get the first part done. The steps listed there are pretty easy to do: download the ISO, place it on a USB drive, boot your Eee, and install. I went for the guided installation that took the full disk.

The installation process took about 30 minutes. Of course, the downloading part will depend on your connection speed.

2) Optimizations

After the complete install was done it was the moment for some tweaks:

  1. Apply automatically fixes for the Ubuntu 8.04;
  2. Reduce swappiness and decrease disk writes to relieve strains to the SSD;

3) Hardware

I was a bit surprised that the webcam and mic weren’t working even after all of these steps. But, eventually I got them to work.

  • Fixing the webcam: I restarted the Eee and went to the BIOS. On the hardware components list, for some reason the webcam was turned off. Switch it on and restart.
  • I haven’t been able to completely fix the microphone issue, but I found this tutorial to give a bit of a fix to use the microphone with Skype.

4) Removing and adding programs

My next task was to see how much space I could eliminate to place my favorite productivity programs in. I used some of the tips found here to remove:

  • all packages related to CDs and DVDs;
  • all games;
  • diveintopython;
  • wodim;
  • thunderbird;
  • and I ran localpurge.

With that saved space I felt more comfortable to install some of my favorite apps:

  • Gnome Do (much better not to rely so much on the trackpad);
  • Conduit (awesome to sync stuff to the clouds);
  • KeePassX;
  • Gimp;
  • Empathy (I liked the program so I’m willing to try and use it a bit more).

All of that left me now with 1.1GB of storage. I’m still pretty happy as I also have a couple of other USB drives I use (and the clouds).

5) Visual improvements

7 inches of screen real estate has to be planned out well. So, I spent a bit of extra time to get the best setup possible.

I decided to use only 1 Gnome panel to have as much available space as possible. So, I removed the bottom panel and did the following modifications to the top panel:

  • removed the Menu Bar applet to replace it with the Main Menu applet (now I have only 1 icon instead of 3 pull down menus);

  • removed the User Switcher;
  • added the Window Selector applet so that I could access all of the programs opened (or, ALT+Tab shortcut also works);

  • I also added the Trash, Force Quit, System Monitor, and Workspace Switcher applets.

Now the final adjustments were done for Firefox by installing:

For fun”:

Once everything was installed in Firefox, I right-clicked on an open space of the toolbar area and choose “Customize”. I configured everything to sit nicely in a single toolbar row. It seems a bit cramped now, but for me it works.

One day after the switch, everything is working very well and the Eee seems much more powerful.

A tour of Empathy IM client

[Linux – Gnome Only] Listed on the roadmap to Gnome 2.24 is the integration with Empathy, a multi-protocol IM client. This integration could be a sign of a replacement for Pidgin and Ekiga with one single SIP and multi-protocol IM application.

For this article I tested Empathy to see how it works and if it is better or worse then Pidgin (currently my favorite IM client).

Installation:

I searched through Synaptic and was able to find Empathy and Telepathy so I installed from there. But, the version I found was really really outdated (I hate when that happens). So, after searching for some help information, I discovered this nice forum post that mentioned I had to add another Software Source to my Ubuntu:

deb http://ppa.launchpad.net/telepathy/ubuntu hardy main

After this, I was able to get the latest Empathy 2.23.6.

Adding Accounts:

My options are not as vast as Pidgin but I was able to find the main IM protocols like AIM, MSN, GTalk, Yahoo! The added bonus was that I could also add SIP accounts.

After all of the accounts were added, the UI looked very much similar to Pidgin’s:

I ran into some problems connecting to a couple of my accounts. Empathy kept asking to access the Keyring default password, which I had long forgotten. But, after troubleshooting that everything worked well. I’m not sure if this was something I did or some bug in the program.

Features:

Let’s start with what Empathy currently doesn’t have: file transfers, pop-up notifications (like Guifications), API or extensions structure, and a good website with help information. The program feels a bit incomplete, under development.

Now for the good news: with Empathy you can use video and voice! Personally I use IM strictly for text, for audio and/or video I use Skype. But, quite a few people (such as my wife) would really like to use A/V with her MSN contacts. Although the A/V capabilities are awesome, in Empathy it is only working now with GTalk / Jabber protocols (at least for me), and I’m sure with SIP protocols it’ll also work well.

I couldn’t use audio / video since none of my close contacts were online to test, but here is a screenshot from Empathy’s website to demonstrate how it would look:

Personally I’m really glad A/V is being integrated. Hopefully other protocols will be supported soon.

Overall, I liked what I saw and tested. I think Empathy will be a good addition integrated in Gnome, but currently it still needs a bit more work.

Based on the above (and your own experience if you`ve tried it out), would you think Empathy is ready to take over Pidgin?

No more Windows XP, will you go with Vista?

Microsoft being smart again saw that Vista wasn’t being very accepted, decided to force people to have no other option. After July 1st, computers can no longer be sold with Windows XP (there are exceptions to the rules such as computer with low specs).

If you bought a computer today would you get it with Windows Vista like Bill wants you to? By the way, Microsoft is planning to release a new OS next year.

Or, will you go with another OS?

IMHO the operating system has lost its critical importance. Users in general need an Office Suite, a web browser, image, video, and audio managers. At this day and age, most known operating systems will work just fine for everyday needs. MacOS will work very well, so will Linux, and even BSD.

Since the operating system itself isn’t that much important anymore, why keep paying for a new one every couple of years? Do you really need a new operating system or do you need one that works well?

For us, Linux is surely the way to go. It is safe, free, easy to use, with Wine many Windows-only programs can be used, and another huge benefit is that a computer will not age quickly over the years. Check out Vista’s minimum requirements and see if you can run it with a computer that is 3-4 years old.

So, dear readers, where will you go without XP?