Adrian
Courrèges

IRKit Setup Guide for Android, iOS, Linux, Mac, Windows

Recently I got my hands on an IRKit device. It’s a pretty neat tool to control several devices remotely by sending IR signals. I use it to control my TV, air-conditioning, light, sound system…

It is fairly cheap compared to the competition (65$ on Amazon Japan), and one strong point is it is completely open-source: you can play with the firmware, customize it any way you want…

What is IRKit exactly?

It’s basically an Arduino board, with a wifi module and some IR receiver and transmitter.
The device is low-consumption and is powered through a micro-USB connection, just like a smartphone.
It’s very tiny and fits anywhere: a 6cm x 6cm square, 1.5cm tall.

It connects to your wifi network and runs its own web-server listening to your commands. All the communication with IRKit is done through HTTP requests, which makes it super-easy to send commands directly from a web-browser.

The official website talks mainly about iOS clients, but don’t worry, any platform supporting a web-browser can be used: Android, Linux, Windows are perfectly fine.

The device also supports control from the cloud: you can send commands from outside your home, they will be relayed through the IRKit servers.

How do I read/send IR signals with IRKit?

You first ask your IRKit to read an IR signal. For example, you point your TV remote at IRKit and press a button, IRKit will automatically pick-up the signal.
Then you can retrieve the IR data by making a simple GET request. For example:

$ curl -i "http://192.168.11.30/messages"
HTTP/1.0 200 OK
Access-Control-Allow-Origin: *
Server: IRKit/__VERSION__
Content-Type: text/plain

{"format":"raw","freq":38,"data":[18031,8755,1190,1037,1190,1037,1190,1037,1190,1037,1190,1037,1190,1037,1190,1037,1190,1037,1190,3228,1232,3228]}

When you want to send a command, you just ask IRKit to replay the IR data.
This is done by sending a POST request, for example:

curl -i "http://192.168.11.30/messages" -d '{"format":"raw","freq":38,"data":[18031,8755,1190,1037,1190,1037,1190,1037,1190,1037,1190,1037,1190,1037,1190,1037,1190,1037,1190,3228,1232,3228]}'
HTTP/1.0 200 OK
Access-Control-Allow-Origin: *
Server: IRKit/__VERSION__
Content-Type: text/plain

The API is very simple and nice to use.
The logic is completely client-side: IRKit is just a “dumb” state-less transmitter. So you could build your own automation system that dispatch commands to automatically turn on some equipment at some time of the day.

How do I initialize it?

When you receive your IRKit, it doesn’t know about your home wifi.
There is first a phase of setup during which the device exposes its own wifi network. By connecting to the device wifi network, you can provide the credential so the device can join your home network. It’s a process a bit complex since it involves getting some API key from the IRKit servers, obtaining a security token for the device, sending your home wifi login details in some serialized format. Quite tedious by hand…

The official way (iOS)

The official website mentions iOS support only: you can download an app from the App-Store, follow the steps and it will setup IRKit for you.

What if I don’t have any iOS device?

I tried a few other alternatives:

  • IRKitJS: it’s browser-based, so multiplatform, unfortunately it failed silently during the last step for me.
  • IRKit Controller Free it actually works pretty well, but it’s only available on the latest Android versions, if you have an old terminal you’re out of luck.

Note that you need an understanding of Japanese to use both of these solutions, there’s no English version.

My solution

In the end, since I wasn’t satisfied with any of the solutions, I came up with my own initialization system: a single HTML page dispatching HTTP requests through Javascript.
It’s a step-by-step interactive guide, telling you what’s happening at each stage. And since it’s web-based it works on any platform.

Try it here:

>> IRKit English Setup Interactive Guide: Android, iOS, Linux, MacOS, Windows <<

Note: my guide is in English, but you’ll still need to get the default password for your device. It is written in Japanese on a small piece of paper included in the IRKit box:

And you don’t have to trust my server: if you have doubt you can save the HTML document and run it locally, the JS code is all available under a MIT license anyway.

What next?

Your device is operational? Great! You can now record all the IR signals you wish.
To organize them, give a try to IRKit Web Remote, a solution I came up with.

Beam Waves Live Wallpaper for Android

Beam Waves is a live wallpaper developed for Android.

Try it on now your phone!

It’s my attempt at designing a 100% procedural wallpaper, lightweight and running at 60 FPS.

Waves of light dance on your scren, drawn at native resolution while using as little battery as possible.

A few screenshots:

And finally, a live demo of the wallpaper using WebGL:

All the animation is produced by a single fragment shader.
There are several settings available like color presets, FPS cap, FBO render size for performance tuning…
Hope you enjoy it!

Links:
Download from Google Play
Official page on Breaking Byte

Website Makeover

It was high-time to make some change to this website.
I hadn’t touch its design since 2007: back then the web was all about “XHTML 1.0” and “CSS 2”, it was the good old time where you would prefer a GIF over a PNG just to make sure your images with transparency don’t look completely messed up inside Internet Explorer…

When I made the Breaking Byte website, I had a good experience with Jekyll and Octopress.

So I got rid of the old PHP files I had here, moved everything to Octopress, customized the theme and here we are:
an HTML5 website, with CSS3, responsive layout compatible with mobile, blog engine, social media integration and code syntax highlighting.

Oh and transferring the website to a new host was super-easy: no need for PHP anymore, all the pages are pre-generated, you simply need Apache serving static HTML files.

Exp3D for Android and Web-Browser

I have been working on a small space shooter game in my free time.

It took me quite a bit of time, given that I had to take care of most of the tasks by myself:
engine programming, 3D modeling, texturing, effects, scripting, gameplay…

The game is now released on Google Play and there is a Javascript/WebGL port also available.

Head over to the game page on Breaking Byte to try it!
Some more screenshots:

         

5.1 sound with nForce chipset under Feisty

X-530 When I migrated one of my desktops from Windows XP to Ubuntu Feisty (7.04), my 5.1 speakers that were working really great with XP were now only outputting in 2.1 mode. Prejudices about the lack of hardware support by Linux didn’t really encourage me to look into the issue.

Well I was wrong: not only Linux is perfectly able (thanks to ALSA) to handle the 5.1 mode of a nForce chipset, it also allows you to do more tweaking than with XP.

Before we begin, here are some details about my configuration:

A desktop running Feisty, with an Abit NF7 Series motherboard.
This is the integrated chipset of the motherboard that handles 5.1. Here is the result of the lspci command:

$ lspci | grep audio 
00:05.0 Multimedia audio controller: nVidia Corporation nForce Audio Processing Unit (rev a2) 
00:06.0 Multimedia audio controller: nVidia Corporation nForce2 AC97 Audio Controler (MCP) (rev a1)

My 5.1 speakers are Logitech X-530 with three jacks (green, orange, black).

My ALSA configuration file will let you obtain a 5.1 sound from a 5.1 track, and pseudo-5.1 (channel mix) from a stereo track, all automatically.

Configuration

You have to modify the configuration file for ALSA, asound.conf. Open the file:

$ sudo gedit /etc/asound.conf

Copy and paste the whole content of my ALSA configuration file within the editor. Save and close gedit.

Applying changes

In order for ALSA to take into account your modifications, it must be restarted. This can be done by the command:

$ sudo /etc/init.d/alsa-utils restart

It is necessary to input this command after each modification of asound.conf file.

If all went fine, 5.1 mode should be enabled. Before you test, make sure the channels for 5.1 are not muted.
Open the volume controller Alsa-mixer (double-click on the sound applet), then Edition, Preferences and tick the boxes concerning 5.1. These channels should now appear in the window, with their volume bar.

Testing the “Stereo to 5.1” mix

Just playing a simple stereo MP3 file with XMMS or RythmBox should produce sound on all speakers. Stereo channels are duplicated on the front and rear speakers, and mixed for the center speaker and the subwoofer.

Testing the “Real 5.1”

To do so we will use Amarok (because it handles perfectly 5.1 audio files). Install it if you don’t have already, this player is really impressive. In Amarok configuration panel, activate the Surround 5.1 mode:

Amarok configuration

Download the following file for the test, it contains 5 audio tracks:
–> WAV 5.1 sound file

When you play it with Amarok, you should hear:
“Front Left ; Front Right ; Center ; Rear Left ; Rear Right”
Since the sound is 5.1, each speaker should output only once.

If the channels are not correctly mapped with the speakers…

You can hear distinct sounds on each speaker, but the right track is played on the left speaker or the subwoofer is outputting the center channel? Don’t worry, this is very easy to fix, you just need to do a correct mapping of the channels.
My asound.conf file works when the cables are plugged this way:

Plugs

You can see the orange jack is connected to the black output, and the black to the orange. I agree this is not very logical but it is the only way I could make it work with Windows.