November 2018
« Oct    


Active supporter of WikiPedia
Support Wikipedia


Profile for uwezi

Hacking IKEA trådfri lighting automation

I recently visited IKEA again and got interested in their affordable line of home automation/LED lighting products called TRÅDFRI (meaing wireless in a play-with-words kind of Swedish). Of course there was already an internet community active in hacking these devices and I joined in.

Getting started

I installed the gateway and after pairing devices to switches and switches to the gateway I finally could get around and experiment. I found quite a good introduction into hacking the gateway by sending your own commands here: PIMORONI: Controlling IKEA Trådfri Lights from your Pi – however after a couple of hours trying I had to notice that something in the description was heavily outdated.

During 2017 IKEA had reacted to some early security issues and introduced a new layer of safety in the user identification scheme. This had in the meantime been fixed in the underlying GIT repository by Harald van der Laan but sincePimoroni had insisted on improving the original code in their own fork, this new change was of course not reflected in their code which I had tested and failed with. In the mean time I have been in contact with Pimoroni and they told me that they are working on an updated version.

Control from a Raspberry

Well I don’t know what the original improvements to the code from Harald van der Laan might have been, but after cloning his repository onto the Raspberry Pi I ad been using for my experiments, everything worked out quite well and only a couple of minutes later I was controlling my first lamps from the commandline in a Putty terminal:

Putty terminal showing the communication with the IKEA TRÅDFRI gateway.

Hardware hacking

It didn’t take me long to disassemble a GU10 LED light with built-in TRÅDFRI remote control in order to extract the Zigbee module according to the description by ehsmaes on Instructables. But it wasn’t before a couple of minutes ago that I actually desoldered the Zigbee board and connected it to an LED on a breadboard for further experiments:

IKEA TRÅDFRI Zigbee module on a breadboard.

PWM internals

Since this is a dimable LED it supports setting brightness values between 0 and 100 using the CoAP interface unlike the other receivers which I have been using so far and which are switched wall socket adapters. But how do these brightness values translate into the corresponding duty cycles of the output pwm-signal of the Zigbee module – and what are the general parameters of this output, anyway?

PWM signal at the output of the Zigbee module.

I don’t feel the need right now to dig deeper into the firmware of the Zigbee module, since it is enough for me to perhaps repurpose some of these modules out of legit GU10 TRÅDFRI lamps (the cheapest item of the series), but if I wanted to, I would start at basilfx GIT repository. The actual layout of the module has been hacked by Mikael Sundin:

The pinout of the TRÅDFRI module -as reverse engineered by Mikael Sundin.

OK, so what are the parameters of the pwm-signal now?

Signal level standard 3.3 V CMOS
PWM frequency 600 Hz
Brightness value
Duty cycle
0 0% (off)
5 5.7%
10 6.6%
15 7.7%
20 9.0%
25 10%
30 12%
35 14%
40 17%
45 19%
50 22%
55 26%
60 30%
65 35%
70 41%
75 47%
80 55%
85 64%
90 75%
95 87%
100 100% (constantly on)

As you can see it is quite a non-linear scale – as expected for a smoothly dimming light source due to the non-linearity of our eyes.

Relation between the set brightness value using CoAP and the PWM duty cycle.

project update: a TTL/CMOS computer

Exactly one month later – our electronics course at Uppsala University just approaches its end – and I got the next shipment for my new project: 1.1 km of equipment wire.

new project: a TTL/CMOS computer

Watching Ben Eater’s youtube series on his breadboard computer based on discrete logic chips inspired me to pursue my own construction. Apart from a lack of time I also needed some more breadboards, which arrived today.

twenty new […]

Continue reading new project: a TTL/CMOS computer

A visitor on the balkony

Top deal of the week?

Today I received a newsletter from the publisher Elektor. I am offered a special deal on a Peltier power generator which can power an LED light from a small candle. And this for an astonishing price of €99.95 instead of the normal price of €119.95.

Great offer from Elektor.

I’ll have to buy […]

Continue reading Top deal of the week?

Troubel with Telia – again

Sorry, this entry is only available in Svenska.

240×320 TFT with touch on an ATmega328

It’s been a while since I purchased some TFT modules on eBay. These modules come in different sizes and two varieties – with and without integrated touch controller XPT2046. The controller in the TFT display itself is an ILI9341 wired up to be controlled by SPI.

240×320 pixel TFT display with integrated resistive […]

Continue reading 240×320 TFT with touch on an ATmega328

Replacing three remotes


You know the problem – with every new gadget comes a new remote control, and while there are programmable and universal remote controls out there, they will never just do what you want.

The three main remotes in my living room.

For controlling my tv, my digital box and one of the […]

Continue reading Replacing three remotes

(Deutsch) Ach Ihr schon wieder

Sorry, this entry is only available in German.

Fakes from China

Inspired by a Youtube video from Bigclive I ordered some Solar Power Rechargeable Flash lights. I knew the risk but I thought it would be a possible way to get hold of some small amorphous silicon solar cell modules for some own projects.

yeah – a bang good solar flash light

Today I […]

Continue reading Fakes from China