MCEUSB IR blasting in Libreelec

  • Here's the link to the testbuild:

    LibreELEC-RPi2.arm-8.2-devel-20171130133422-r26229-ga24418465c.tar

    ir-ctl doesn't to any automatic repeat handling, it just transmits each scancode once.

    With the new version you can specify the delay (gap) between signal transmits on the command line. It should be about 25000.

    To send out 3 repeats with 25ms inbetween do this:

    Code
    ir-ctl -g 25000 -S sony12:0x100015 -S sony12:0x100015 -S sony12:0x100015

    You can also store scancodes in a file, like this:

    Code
    LibreELEC:~ # cat sony-power.irctl
    scancode sony12:0x100015
    scancode sony12:0x100015
    scancode sony12:0x100015


    and transmit that with ir-ctl

    Code
    ir-ctl -g 25000 -s sony-power.irctl

    As an alternative you can specify the delay between scancodes in the file

    Code
    scancode sony12:0x100015
    space 25000
    scancode sony12:0x100015
    space 25000
    scancode sony12:0x100015

    In that case the -g option of ir-ctl is not needed

    One thing to keep in mind is that when sending a file all of it will be transmitted in a single call - and you can run into the limit of the lirc device. When using -s or -S multiple times each of the scancodes / files are transmitted in separate calls, so you don't run into the limits that easily.

    so long,

    Hias

  • Victory!!! I installed the patched version, and now I can control the receiver without troubles! Manymany thanks for your ongoing support!

    ir-ctl feels much more stable and controllable than irsend. I will continue using ir-ctl!

  • HiassofT Can I help you with additional validation of the fix in ir-ctl? Send logging or do additional tests?

    I'm really happy with the ir-ctl. Now I try to get my Philips tv on this as well. It works, but I cannot get the same codes I have now. I used 2k10_2k11_RC-codes.pdf. I can switch to HDMI1 with ir-ctl ("ir-ctl -S rc5:0x0304"), but this does not turn on the TV. It only works if the TV is already turned on.

    With my Lirc codes I could send the KEY_INPUT_HDMI1 code and this does turn on the TV and directly switch to HDMI1. It will be difficult (in timing) to send "TV on" first followed by "HDMI1", because my TV starts really slowly and does not respond to IR signals the first 10-20 seconds. Is there a possibility to convert the "KEY_INPUT_*" codes in my lircd.conf to ir-ctl rc5 scancodes?

    I've tried with the hex codes in the lirc.conf file. If I send "ir-ctl -S rc5:0x10c4", I get an error "error: invalid scancode '0x10c4' for protocol 'rc5'". If I send "ir-ctl -S rc5:0x1039" the remote led flashes, but nothing happens.

  • The ir-ctl code 0x0304 looks about right, this is also the same code I'm seeing when testing with your lircd.conf file.

    lirc however sends the signal 2 times (because of min_repeat 1). With ir-ctl you have to use a gap of about 90000 to get identical timing (rc5 has a fixed signal length of about 25ms and repeats every 114ms)

    Code
    ir-ctl -g 90000 -S rc5:0x304 -S rc5:0x304

    Converting between lirc codes and ir-ctl ones is a bit tricky. Lirc uses a raw representation of the received bits and ir-ctl a "logical" one - which means bit positions are shuffled around a bit or, like with the sony protocol, also in reversed order.

    Actually, 0x304 in ir-ctl is the same as 0x10c4 in lirc, except for the toggle bit (which changes on every other button press and IIRC can't currently be changed in ir-ctl)

    so long,

    Hias

  • Hi HiassofT , I tried the doubling with the code you provided, but no luck. I can switch to HDMI1 when the TV is on, both with single code and repeated code, but not when TV is off.

    Isn't it possible to apply the toggled bits to the second scancode, so there are two different hex codes? Or is it not possible to express that in a valid RC5 code?

    Otherwise it might be nice to implement the togglebit functionality in ir-ctl. Don't know how many devices are needing this?

  • I'm not sure if the toggle bit really is the problem here. With min_repeat=1 lirc will transmit 2 identical signals. On the next irsend invocation it'll again transmit 2 identical signals, but with the toggle bit flipped - this is also how normal rc5 IR remotes work.

    You can try with the attached raw files - use "ir-ctl -s hdmi1.raw" or "ir-ctl -s hdmi1-toggle.raw" to send these.

    hdmi1.raw is identical to what you'd get from sending rc5:0x304 twice. hdmi1-toggle.raw has the toggle bit flipped.

    On the first irsend invocation lirc sends a signal identical to hdmi1-toggle.raw, on the second invocation it's identical to hdmi1.raw.

    so long,

    Hias

  • Just tried both raw files. They both do not turn on the TV, and both work to set the TV to HDMI1 when the TV is on. Don't understand why. I will keep fiddling around and see if I can get it to work again the old way. Thanks again for your great support!

  • Very odd. You could play around a bit with the gap between the signals, you can also edit the .raw files and change the "space 90000" in the middle of the files to something else.

    Maybe we missed something with lirc. Could you retest that config and describe exactly which remote signals you transmitted via irsend and/or ir-ctl?

    The way I checked with lirc was this:

    - use the PHILIPS1 lircd.conf from your post #21

    - after boot up / lirc start call "irsend SEND_ONCE PHILIPS1 KEY_INPUT_HDMI1

    No other ir-ctl / irsend calls before, between or after that.

    so long,

    Hias

  • Strange I can't get the "turning on to HDMI1" function working anymore. Maybe my memory was incorrect <X? It has been some time ago that it worked before. Anyhow I'm happy with the way it is working now. Topic resolved. Thnx again!

  • HiassofT

    Sorry for resurrecting this topic

    I have a Philips SRM-5100 / MCE universal remote control

    That was saved for a long time!

    This one works with LibreELEC perfectly.;)

    I do not need to do anything at all.

    Plus the power button does not turn on the box, it just turns off.

    My question, it is possible to edit any key if yes how to proceed.:?:/shrug

    Thank you,:thumbup:

  • What box are you using?

    On PCs power on by USB or CIR usually has to be enabled in the BIOS.

    On AML boxes this is would be handled by u-boot, the vendor u-boot version might be tied to the remote that came with the box, not sure if power on by USB is supported. Not really my area :)

    so long,

    Hias

  • What box are you using?

    On PCs power on by USB or CIR usually has to be enabled in the BIOS.

    On AML boxes this is would be handled by u-boot, the vendor u-boot version might be tied to the remote that came with the box, not sure if power on by USB is supported. Not really my area :)

    so long,

    Hias

    Good friend I'm using KI Pro mecool!

    We did not need the usb, the controller picked up right without accessories

    Well, thank you for clarifying.

  • Hi HiassofT,

    I changed my TV to a Panasonic. From ir-ctl man pages I found that the (native?) Panasonic protocol is not supported. Can you point me in the right direction to turn on my TV with codes like "0x40040100BCBD" (from IR Codes for TV Panasonic TX65FXW784 · arendst/Sonoff-Tasmota Wiki · GitHub) or 0000 0048 0000 0018 00c1 00c1 0030 0030 0030 0030 0030 0030 0030 0030 0030 0030 0030 0030 0030 0030 0030 0030 0030 0030 0030 0030 0030 0090 0030 0091 0030 0090 0030 0090 0030 0091 0030 0090 0030 0090 0030 0091 0030 0090 0030 0090 0030 0091 0030 0030 0030 0840 (from RC: Infrared Hex Code Database: Panasonic CTP-25280S2 (TV) Commands (Page 1))

  • The easiest way to do that with ir-ctl would be to capture the raw signals to a file and then send those. for example:

    record a button to file "tv-power"

    Code
    ir-ctl -1 --receive=tv-power

    transmit the signal:

    Code
    ir-ctl --send=tv-power

    An alternative would be to use lircd if you can find a lircd.conf with the signals/codes for your TV.

    Converting those various "ir codes" you find on the net to a format suitable for ir-ctl or lircd isn't easy as there's no real standard for them.

    so long,

    Hias

  • Hi HiassofT, thnx for your suggestion. I tried to record the power signal (see below), but when I send this code the tv does not respond. Not led flash (only from my IR emitter...). Any suggestion? I use a MCE-USB ir blaster.

  • It could be that you need to transmit the IR code multiple times - my old Panasonic CRT TV only powered up if the power button was held down for about 0.5-1 seconds.

    You could try something like this:

    Code
    ir-ctl -g 75000 --send=button-power--send=button-power--send=button-power--send=button-power--send=button-power

    "-g 75000" sets the gap / pause between IR signals to 75ms - that's about the value I see with my panasonic remote. You can also try other values in the range of (about) 50000 to 100000.

    To add more repeats just add --send... more often - maybe try with 10 instead of 5 if it doesn't work.

    It's a bit odd though that the TV didn't blink when you sent the code (IIRC my old CRT TV blinked shortly, multiple times when powering up).

    It could be that the recorded signals aren't accurate enough - MCEUSB has 50µs resolution and this page Description of the panasonic infrared protocol (REC-80) says the intervals are about 420µs in USA and 450 in europe (not sure if that's correct, different lengths are quite odd).

    so long,

    Hias

  • Hi HiassofT

    Did some trials again, but still without luck. I hooked up a IR receiver module to a logic analyzer and got the following signal:

    It looks similar to the code recorded with ir-ctl. I adjusted the times to multiples of 450 µs (like in the logic analyzer graph, and I'm in Europe) just to try if that might help. No luck. The tv does not blink a led, like it is not receiving anything.

    I'll keep on puzzling:/. If any additional suggestions, please let me know!

    Edited 2 times, last by GuustFlater89 (September 7, 2019 at 9:05 AM).

  • Hi HiassofT I found a lircd.conf file that works on my tv. Any way to transform this to a ir-ctl setup? I use ir-ctl for other devices and I would like to use only one ir blasting solution.

    Another challenge is to use discrete codes for Power_On and Power_Off. I found a document on Panasonic website ( Panasonic FTP ) with discrete Pronto CCF formatted codes. Can these be used in ir-ctl?

    Edited once, last by GuustFlater89 (September 8, 2019 at 9:55 AM).