In order to understand things, I like to create something useful learning all steps in the process. After connecting a few Alexa-enabled plugs, I wanted to control my TV – at least switch it on and off. So – I started a project. Here’s how it went ..

To control a TV set or other entertainment devices, one usually needs an Infrared (IR) sender. In my case – it needed to be controlled by our home network server, that sits close to the TV. I looked long and hard for a USB connected IR device and finally purchased a USB Infrared Toy from Amazon. It was well documented on the developer’s site and I thought to myself .. how hard can it be?

Well .. harder than expected. The gadget is somewhat “old”. It requires a A-Male to Mini-B cable (the type I didn’t have) and it relies on the “irman” driver for lircd – and that is somehow no longer supported. I downloaded all necessities to do my own compile only to find out that it requires python 3.1 – which is not available for the default CentOS 7 distribution. I found it on Epel and was finally able to compile. But lircd (irrecord) couldn’t be convinced to play nice with the USB Infrared Toy.

Somebody somewhere on the net suggested a software update – and .. well, the instructions were easy. But – guess what –  the update didn’t work.

I finally discovered a trick:

echo "$" > /dev/ttyACM0

switches the USB Infrared Toy into “upgrade mode” and I could finally flash the “new” (it’s from 2011)  software. But I still couldn’t make the USB Infrared Toy work. It wouldn’t learn any codes – the irrecord tool would simply time out or report errors. I dug in, browsed the net, followed suggestions, blacklisted the “cdc_acm” module and tried “usbmodem” modules  .. nothing. Finally I  found a soul who had tackled this problem before – and he had a patched lircd. I downloaded his version, compiled it and – the Freeware Gods are praised – it worked.

I was now able to record the IR sequences to control my TV-set. And I could play the sequences and my TV was happily (I hope) obliging. Cool.

Next step: Create a skill that translates my spoken requests into something that can be used to trigger the IR sequence. I am not going to dive into Alexa skill development – that’s a complete new blog post – but that went without a lot of problems. However – the Alexa endpoint needs to be in the open Internet. And my home server isn’t. Thankfully we are running a number of servers and it was easy to make one of them forward a command from the open Internet endpoint to a little utility on our home server.

After re-configuring selinux to allow this (web-based) utility access to the lircd socket, everything went as planned.

Alexa .. tell rollofone to turn on the TV.

Case closed. Feel free to ask me if you need more details.

 

 

 

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *

Post Navigation