Friday, December 9, 2016

Persistence for Philips Hue

Two of the lights in our living are Philips Hue lights.
I especially like them for their ability to reach 2000K color temperature (very warm white light), which gives a nice mellow yellowish white light.

We control the lights via normal light switches contained in the light fixture.
Due to the way Philips Hue lights work this implies that whenever we turn on the lights again they go back to the default setting of around 2700K (normal warm white).

In order to fix this once and for all I wrote a little program in rust that does this:

  • poll the state of the lights every 10 seconds (there is no subscribe/notify :( )
  • keep the light state in memory
  • if a light changes from unreachable (usually due to being turned off by the switch) to reachable (turned on by the switch), restore the hue to the last state before it became unreachable
Code is in rust (of course) and can be found at https://github.com/andete/hue_persistence.

Just run it on a local server (I use my shuttle xs36v) and it automatically starts working.
Keep in mind that it can take up to a minute for the Hue system to detect that a light is reachable again.

A short video demoing the system in action:


Friday, December 2, 2016

working console on Shuttle xs36v mini computer with Debian 8 (Jesse)

I recently re-installed this system to use it as a local server.

Installation of Debian 8 went smooth. I choose not to install a graphical environment as I only want to attach a screen in emergency situations.

The system boots fine but then the screen goes into power-safe mode. The system is still reachable remotely.

After some searching on the internet [1] the solution is to blacklist the graphics driver of the system.

Create a file called /etc/modprobe.d/blacklist.conf and add the following to it:

blacklist gma500_gfx
This tells the system not to load the driver. Then do
 sudo update-initramfs -u
this updates the boot RAM disk to reflect the change.

Reboot the system and enjoy a working console.

Picture or it didn't happen: