Lirc Raw versus Hex values in LIRC.conf

Everything related to protocols and IR codes
Post Reply
ofonseca
Posts: 3
Joined: Wed Jun 15, 2016 2:26 pm

Lirc Raw versus Hex values in LIRC.conf

Post by ofonseca »

Hi there,

Maybe I'm posting this question in the wrong forum but allow me to ask the following based in your experience:
I have a RPi working with LIRC without a problem (using AnalysIR to decode the IR signals). I managed to read the signals from my ZH/LT-01 AC remote control that uses CHIGO96AC protocol.
I was able to create a lirc.conf file using the "batch export --> LIRC RAW" option for some of the pressed keys from my remote.
Using irsend command, I tested some of the functions from lirc.conf and worked ok, I managed to power on, power off, change temperatures. So far so good!

My question is:
Is there a problem to use RAW commands in my lirc.conf? the only issue so far (not a real issue, more a personal issue): the file is so big with many lines and to review all the defined names I have to parse the file.
How can I convert LIRC RAW to HEX? I tried to use the HEX value listed in the Reverse Engineering Tool but did not work.
How can I take advantage from AnalysIR to create a "cleaner" lirc.conf configuration file?

Any idea or comments are more than welcome. Thanks in advance.

Osvaldo
User avatar
AnalysIR
Site Admin
Posts: 776
Joined: Sat Aug 31, 2013 3:51 pm
Location: Dublin, Ireland
Contact:

Re: Lirc Raw versus Hex values in LIRC.conf

Post by AnalysIR »

Hi Osvalso

Is there a problem to use RAW commands in my lirc.conf? the only issue so far (not a real issue, more a personal issue): the file is so big with many lines and to review all the defined names I have to parse the file.

No. Not a big task for a Linux/Rpi system to process.


How can I convert LIRC RAW to HEX? I tried to use the HEX value listed in the Reverse Engineering Tool but did not work.
Just use the Lirc RAW to send RAW singals from LIRC.
You should be able to import LIRC RAW in AnalysIR to generate the HEX code. Menu->File->Import

How can I take advantage from AnalysIR to create a "cleaner" lirc.conf configuration file?
I am not sure what 'cleaner' would be.?
AnalysIR supports creating a LIRC RAW output file from captures signals. Menu->File->Export
However, you can 'clean' the signals if recognised by AnalysIR via the power tools menu. This should improve performance and range.

To send the signals from the Hex value on an RPi with Lirc - you would have to write a custom script to do that in something like python. (just copy the layout format produced by AnalysIR)
ofonseca
Posts: 3
Joined: Wed Jun 15, 2016 2:26 pm

Re: Lirc Raw versus Hex values in LIRC.conf

Post by ofonseca »

Thank you so much for you reply, it is very helpful.

lirc.conf was generated using AnalysIR software and works very well. it contains only LIRC Raw commands

My last question is:
- If I understood correctly from your previous answer, I can see the HEX code (see attached image) for a command using Reverse Engineering tool, If I copy that HEX code and put it into a lirc.conf will work?

Thanks! AnalysIR is a very good tool. I'm using version 1.16.100.8105
You do not have the required permissions to view the files attached to this post.
User avatar
AnalysIR
Site Admin
Posts: 776
Joined: Sat Aug 31, 2013 3:51 pm
Location: Dublin, Ireland
Contact:

Re: Lirc Raw versus Hex values in LIRC.conf

Post by AnalysIR »

My last question is:
- If I understood correctly from your previous answer, I can see the HEX code (see attached image) for a command using Reverse Engineering tool, If I copy that HEX code and put it into a lirc.conf will work?

These hex codes are the same as in History, in the main window and usually in LSB8 instead of MSB format.

You cannot simple put the hex code into LIRC. However, if is you set up the values for header, one and zero you may be able to use a standard (non-RAW) LIRC conf file.
If you are running RPi is is hardly worth the effort as the overhead is minimal for RPi.


The following is a lirc.cinf file for NEC. So you could adjust for this AC protocol by changing the values for frequency, header, one, zero, ptrail & bits. You would also need to use MSB format in power tools before using the HEX value from history.
However, I am not sure of the maximum number of bits supported by LIRC (it may only be 32)

Code: Select all

#
# generic NEC config file
#

begin remote

  name  NEC
  bits           16
  flags SPACE_ENC|CONST_LENGTH
  eps            30
  aeps          100

  header        9000 4500
  one           563  1687
  zero          563   562
  ptrail        563
  pre_data_bits 16
# just a guess
  gap          108000

  frequency    38000
  duty_cycle   33

      begin codes
      end codes

end remote

So in summary, I would stick with RAW format. but if you get it working post an example .conf file and we may be able to add suppport in AnalysIR.
ofonseca
Posts: 3
Joined: Wed Jun 15, 2016 2:26 pm

Re: Lirc Raw versus Hex values in LIRC.conf

Post by ofonseca »

Thanks! That answer my question.
Post Reply