irplus-remote / irplus-codes.github.io

Code updates for irplus
72 stars 45 forks source link

LIRC code translation #656

Open vatonek opened 5 months ago

vatonek commented 5 months ago

I translated LIRC config code for SHARP TV GA538WJSA.lircd.conf to irplus configuration file, but this config file does not work. The code is space-coded, no header, 15 data bits, long gap, then repeated data, but just first 5 bits are the same, last 10 bits are inverted.

This is testing LIRC config file reduced to just 1 button:

#brand: Sharp
#model no. of remote control: GA538WJSA
#devices being controlled by this remote: LCD TV LC-42XD1E
begin remote
  name Sharp_GA538WJSA
  bits 15
  flags SPACE_ENC|CONST_LENGTH
  eps 30
  aeps 100
  one  320 1650
  zero 320 650
  ptrail 320
  gap 64240
  toggle_bit_mask 0x3FF
  min_repeat 1

  begin codes
    KEY_POWER  0x41A2
  end codes
end remote

File translates to:


<irplus>
    <device manufacturer="MANUFACTURER" model="MODEL" columns="12" format="WINLIRC_SPACEENC"
          bits="15" pre-bits="15" toggle-bit-pos="1023" gap-pulse="320" gap-space="64240"
           one-pulse="320" one-space="1650" zero-pulse="320" zero-space="650" repeat="2">

        <button label="&#xf011;" alt="POWER" span="4">0x41A2</button>
    </device>
</irplus>

Unfortunately, the pulse/space sequence generated by the IRplus app is quite different from that generated by the LIRC. IRplus app generates two 15-bit sequences with specified gap between (as expected), but the second sequence is EQUAL to the first, while the correct action should be: INVERT last 10 bits of the second sequence (1023 decimal = 3FF hex mask).

May be it is possible to force irplus to generate proper output, but there is no detailed list of available configuration parameters and description of their function. So, my question is:

Where can one find the detailed irplus configuration manual, describing what mean expressions like pre-bits="15", toggle-bit-pos="1023", repeat="2" and possible other functions?

I know what mean such expressions in the LIRC, but I can not find any usable description for irplus, to be able to write the correct config file manually.

vatonek commented 5 months ago

Damn, I checked my old issue (#423) conversation from 2019 and found that this 5-year old modification is working -- the repeat mask function is implemented, just the parameter name is not repeat-mask as I expected, but repeatmask. After edited the config file, IRplus generates correct output.

So sorry for bothering by this isue, but one thing is true - terribly missing manual for writing/troubleshooting irplus configuration file. Something like this for LIRC: https://www.lirc.org/html/configure.html

OK, so we need just correctly working translator. I fixed javascript and placed updated version here:

new.lirc.to.irplus.convertor.html.txt

As GitHub does not accept html files, I added .txt at the end. So just rename file to new.lirc.to.irplus.convertor.html, try it out and use as needed.

It correctly translates: repeat_mask 0xNNN --> repeatmask="0xNNN" name NNNNN --> model="NNNNN" toggle_bit_mask 0xNNN --> togglemask="0xNNN"

In addition, the toggle-bit-pos is suppressed if togglemask exists. Not sure if IRplus understands togglemask, but old version translated toggle_bit_mask as toggle_bit_pos, what is unwanted feature. Note that in LIRC, the toggle_bit_mask obsoleted the toggle_bit_pos, so it will be wise implement toggle_bit_mask also in IRplus apps.

vatonek commented 4 months ago

Found another translator bug. Translator generates always the pre-data-bit parameter. If pre_data not specified, this parameter is meanigless, so should be suppressed. Fortunately this bug has no impact. Here is updated translator version:

new_lirc.to.irplus.convertor_2024-01-31.html.txt

Adding also description, but just like proposal. It has to be checked and corrected ....

LIRC to IRplus parameters translation.txt

irplus-remote commented 4 months ago

Hi Thank you so much for your contribution, i will check it and update accordingly :)