The image below is a link. Try to click on it.

Recording Air Conditioner remote controls using Irdroid

 

Recording Air conditioner remote controls with Irdroid

Recording Air conditioner remote controls with Irdroid

Recording Air Conditioner (AC) infrared remote controls can be a challenge, when using conventional methods for recording IR remote control codes with LIRC (The Linux Infrared Remote control software package).Recording off-the-shelf TV / STB infrared remote control includes running the irrecord utility that comes with LIRC and recording the physical infrared remote buttons one after another and storing the data into a flat text file. The above procedure is standard for recording home appliance IR remotes, except for Air Conditioner remote controls.

OK, what is different about the AC infrared remote controls ?

Well, the difference is that the AC infrared remote control codes are longer in comparison with any TV, DVD, STB or any other IR controlled equipment. The main difference is the way these infrared remote controls work.

The AC remote control sends all its settings (current state) at once (in one infrared code sequence) . That means when you set for example a temperature, air direction , mode etc these are all send with one IR command which contains all the current settings (current state) with other words all the data in the remote. It means that normally we can’t record remote buttons individually by pressing each button and recording with LIRC, as with every button press we get the remote current state, not a single pressed button.

We can record ON command, OFF command in combination with the current setting/state (mode – heat, current temperature;air direction etc) . We can do that using a patched version of the IR record utility, which is part of the LIRC software package which will allow us to record longer infrared commands.

The LIRC irrecord utility assumes maximum infrared code length of 200 bits, which is a limitation and it is not enought as most of the ACs are using code length > 200bits (some are using code length of ~500 bits) .To change the setting, we need to edit the source file irrecord.c that comes with the version of LIRC , attached to this article.

In particular we have to edit line #109 of irrecord.c

  • #define MAX_SIGNALS 200

this defines the maximum signal length that irrecord shall consider as valid. We shall change that to :

  • #define MAX_SIGNALS 600 (to have some reserve and make sure we cover all ACs with code length over 500 bits)

After changing the file we have to compile LIRC by issuing:

./configure
make
make install

*My configuration for the above procedure was a Laptop running Ubuntu Linux 14.04 LTS
*In Windows the user needs to download WinLIRC, edit the irrecord.c file and recompile the software

After the install process finishes we should be able to use the Irdroid USB IR Transceiver or the Irdroid-Rpi (infrared transceiver for Raspberry Pi) in combination with irrecord to record any AC infrared remote control code in RAW form.

The irrecord syntax:

irrecord -f -d /dev/ttyACMx /etc/lirc/lircd.conf

*depending on your configuration and the number of the serial ACM devices used in your system the ttyACMx can be ttyACM0 or any other number depending on the number of serial ACM devices in enumerated in your system.

the irrecord -f option forces the program to go in a RAW IR record mode (it will not try to decode any of the known IR protocols like RC5, RC6 etc)

Example lircd.conf file with a scanned toshiba Air Conditioner ON command :

begin remote

name Toshiba
flags RAW_CODES
eps 30
aeps 100

gap 1000000

begin raw_codes

name ON
3285 1578 447 405 405 405
426 1173 469 383 426 1173
469 383 426 383 426 383
426 1173 469 1173 469 383
426 383 426 383 426 1173
426 1194 426 405 405 405
405 447 383 447 383 405
405 405 405 405 405 405
405 405 405 405 405 405
405 405 405 405 405 1215
405 405 405 405 405 405
405 405 405 405 405 405
405 405 405 1215 405 405
405 405 405 405 405 405
405 1215 405 405 405 405
405 405 405 405 405 405
405 405 405 1237 405 405
405 1215 405 1215 405 1215
405 1215 405 1215 405 1215
405

end raw_codes

end remote

*The above example represents a ON command, and the current remote state (mode heat,22 degrees celsius, swing mode). You maybe noticed that there are repeating codes like 405, 1215, 1173 , these are the bit representations normally a sequence of zero’s and one’s . these numbers also represent the pusle / space IR signal length in microseconds. The big number in the begining is the so called “lead-in” “informing” the receiver that a infrared command starts.

Initially the program will try to identify the so-called “IR Gap” , it will ask you to press different buttons from the physical remote control. Even if the Gap is not found you can still continue and record button presses from the target remote and store them in a flat lircd.conf file, which is later used by lircd for reproducing the recorded infrared signals.

*The recorded remote control in the above example was for an old Toshiba Air Conditioner. A friend of mine asked me whether he can use one of the Irdroid modules to control (Turn On and Off) the Air Conditioner at his office. In particular to do that using WinLirc in Windows. I have successfully scanned the physical remote control and tested successfully with the target AC. Later on I find out a nice automation utility for windows which has plugins for LIRC and a Scheduler, giving the option to schedule infrared remote control commands. Convenient , isn’t it?

Downloads:

Hardware:

The image below is a link. Try to click on it.

Infrared task automation in Linux using the Irdroid USB Infrared Transceiver

This is a Blog post with example usage of the Irdroid USB Infrared Transceiver in Linux for Infrared Task Automation. In the past we had a number of project that inluded creating scripts and cron jobs for executing sequences of infrared commands one after another , defined in scripts / macro’s .

In particular we had a client who needed to send a IR command to a number of STBs (IPTV distribution company) to wake them up from “sleep mode” every couple of hours, before the STB goes sleep mode.

The above task is achievable using the Irdroid USB Infrared Transceiver in Linux, or using the Irdroid-Rpi in combination with a Raspberry Pi.

In practice the client’s hardware configuration consisted of a transcoding server, running Ubuntu 14.04 and a LIRC Daemon for sending / receiving infrared commands. In this particular project my task was to set this box to work with the Irdroid USB Infrared Transceiver and issue a “Menu” command for the particular STB every 5 hours (which avoids the unit/s entering “sleep mode”) .

Tools used:

Tasks:

  • Compiling and installing LIRC on the Linux transcoding machine
  • Digitizing the Infared Remote Control used to control these STBs
  • Setting a CRON Job to send a infrared command every 5 hours

 

First I had to download a patched version of LIRC, compatible with the Irdroid USB Infrared Transceiver from the Irdroid.com download section (see the links at the end of this article). To use the patched version of LIRC , I had to compile it using the standard commands in linux:

  1. ./configure
  2. make
  3. make install

After installing LIRC, you will need a lircd.conf file which holds the remote control commands either in RAW form (pulse / space sequences) or a decoded HEX values / depending on the protocol these can be with different length.

For the above project the original remote control was not already available in the LIRC database (http://lirc.sf.net/remotes) , therefore I had to scan and record the remote control using the “irrecord” utility. The Irrecord utility comes with the LIRC package and it is used to record, decode and store the infrared signals from any (almost) infrared remote.

The Irdroid USB Infrared Transceiver enumerates as a standard Serial ACM device and if you dont have other serial ACM devices in the system it should enumerate automatically as ttyACM0 available as /dev/ttyACM0 .

To record the target remote I have used the command “irrecord -d /dev/ttyACM0 /etc/lirc/lircd.conf” . Once that command is issued you will be asked (in console mode) to make random button presses, which allows irrecord to analize and try to decode the target remote control protocol, then you will be asked to push and name every single button and at the end to save the configuration file and exit. Once done you should end up with a lircd.conf file located at /etc/lirc/lircd.conf .

To start LIRC issue “sudo lircd –device=/dev/ttyACM0 –listen=8765” this will instruct LIRC to listen on port 8765 on All interfaces .

Then you should be able to issue commands :

“irsend SEND_ONCE Remote_name Button_name”

Finally I had to set a cron job to run every 5 hours and issuing the “Menu” command in order to avoid the STBs going in “sleep mode”

That is done via Cron :

0 */5 * * * irsend SEND_ONCE Remote_NAME Remote_COMMAND

The above will send our command every 5 hours.

Downloads:

 


Dont have a Irdroid USB Infrared Transceiver?

– You can purchase one from HERE