I want to "fake" a remote control to do some home automation and turn my tv STB on. This is not about "receiving" but "transmitting" to a receiver.
I figured out the code for the relevant remote control and it kind of works. However, my tv set top box seems to detect the end of a button press (and multiple repeating button presses) by sending the pre data again and then stopping the transmission, without the actual code for the key.
To illustrate this, with mode2 I receive the following series of pulses and spaces, when I press power for two times in a row (but releasing the button in between):
277 682 597 703 256 362 277 362 597 703 256 362 597 362 256 703 597 362 277 682 597 362 277 682 619 16275
256 703 597 703 256 362 277 362 597 682 277 362 597 362 256 703 597 362 256 703 597 362 277 682 597 16275
277 682 597 703 277 362 256 362 619 682 256 362 597 16957
256 703 597 703 256 362 256 362 597 703 256 362 619 362 256 703 597 362 256 703 597 362 256 703 597 16275
256 703 597 703 256 362 256 362 597 703 277 362 597 362 256 703 597 362 256 703 597 362 256 703 597 16275
277 703 597 682 277 362 256 362 597 703 256 362 597 362 277 682 619 362 256 703 597 362 256 703 597 16275
256 703 597 703 256 362 277 362 597 682 277 362 597 16957
Each line is a repetition of the code, with an oscilloscope, I measured the gap to be much larger (around 120ms)
The curious thing about this is: there seems to be no toggle bit, but the transmission seems to end at the 7th pulse, not at the end of the whole word. This is the same for all keys.
As I mentioned, this seems to be relevant, as I cannot turn the TV box on (Press Power twice in a row) or change e.g. to channel 11 or 22.
How can I implement this? Any ideas?
My lirc file looks like this:
begin remote
name leunet
bits 10
flags SHIFT_ENC|CONST_LENGTH
eps 30
aeps 100
header 343 343
one 343 343
zero 343 343
gap 118000
# min_repeat 2
pre_data_bits 8
pre_data 0xbb
begin codes
power 0x092
key_1 0x091
......
end codes
end remote
I tried to experiment with defining "post data" the same way as the pre-data, but this is not working correctly because of the long gap and the "post data" should not be part of any repeats.
I would hate to modify lirc and recompile, as this will always be a fuss with updates, system changes etc., and to be honest, I would like to avoid getting into it so deeply.
Can this be done with scripting without introducing too much latency (e.g. defining a "stop code" remote sending the pre_data, only). The box that "pretends to be the remote" is a rather powerful arm processor with Debian (Allwinner A20 processor). Any help is appreciated