Libreelc12 +Argon one m2 +rpi4: khadas ir-remote power on: how to do this?

I own a Argon one m2+rpi4 and an khadas ir-remote and this work wery well and very easy to set, and here how i configure it:

  1. add this line at the bottom of this file: .config/rc_maps.cfg:
  2. gpio_ir_recv * khadas.toml
  3. comment this line : gpio_ir_recv * argon40.toml
  4. reboot.
    After i install the kodi argonone plugin from here: argonone_plugin

The ir remote work well but only one function is missing, the power on. I set the jumper to pin 2-3 to mode 2 (always on)


but the case won’t to power on.
What is the step I missing?

Power on should work with a remote as well, if the power on sequence is one-time programmed to the MCU inside of the Argon ONE case. Requires that your current remote control uses NEC protocol for that - that could be the only restriction. The easiest way to reach that is to boot PiOS from another SD card or USB thumb drive, install argon1.sh and make the needed change (look for argonone-irconfig.sh).
This should work with jumper to pin 1-2.

EDIT:
If you are brave, you can write the values ​​directly to the MCU using the existing LibreELEC installation, without using the argon1.sh script.

  • Stop KODI process
    systemctl stop kodi
  • The following command should change the power-on sequence in the MCU to the Khadas IR remote - KEY_POWER (0x14):
    i2cset -y 1 0x1a 0xaa 0x00 0xff 0x28 0xd7 i
    To reset back to Argon IR default - KEY_POWER (0x9c):
    i2cset -y 1 0x1a 0xaa 0x00 0xff 0x39 0xc6 i
  • Start KODI again
    systemctl start kodi

I had a similar discussion about 2 weeks ago, please check there for more details: Add discrete IR power commands? · Issue #19 · HungerHa/libreelec_addon_argononecontrol · GitHub

Jumper set to 2-3 depends on a power-cycle of the case to trigger the power-on and should work if you are not one of the affected users with bad soldering points. Sometimes a re-assembling of the RPi with the pcbs of cases was also required to ensure all connections on the micro connectors/contacts are working right.

PS: Since about a week, you can install the add-on via “LibreELEC add-ons” as well. :wink:

1 Like

This works wery well. But where do you find this code? I leave the jumper to 2-3 for a first test, but also work with jumper to 1-2. Tanks a lot

Edit: IS there a way to power on with hdmi conneted to my smarttv?

1 Like

The code contains the LIRC compatible interpretation of the OBC (Original Button Code) for the KEY_POWER command. The needed byte sequence for the program command is part of the argon1.sh sub scripts. And the default power-on byte sequence is the same like in the old style argon.lircd.conf.

The first challenge was to me, to find if there some information available about the Khadas IR remote and if this support NEC protocol. I didn’t know these remote before and unfortunately the toml file wasn’t provided with your first post. After some research found a mentioned toml content in a forum and also a OBC list in some code snippets at Khadas Wiki, but these are a better source: https://git.linuxtv.org/v4l-utils.git/tree/utils/keytable/rc_keymaps

The second challenge was to find a way to convert between the OBC values and the LIRC style. I knew that there exist a convert script from lirc2toml, but here the counter part was needed and I was to lazy and to much time consuming to inspect the algorithm. I used IrScrutinizer, imported the old argon.lircd.conf to have a working start. Changed the OBC I knew from the toml files from 0x9c to 0x14 and exported to LIRC format. Voila, afterwards I could find the byte sequence “0x00ff28d7” for the KEY_POWER OBC 0x14 of the Khadas remote in the export file.

The third callenge was to research how I could reduce the script function to a CLI version with i2cset.

  • Select the I2C bus (already known)
    i2cset -y 1
  • Set the I2C slave adress of MCU (already known)
    0x1a
  • Set the target register value for IR byte sequence programming (constant: 0xaa for V2, 0x82 for V3 cases MCU firmware)
    0xaa
  • Payload with the LIRC byte sequence of the OBC 0x14
    0x00 0xff 0x28 0xd7
  • Send message in I2C block write mode, because the payload contains more than 1 byte
    i

That’s it.

It’s up to your use case, whether match that the RPi5 starts automatically after power outage or not.

No, the MCU isn’t involved in the HDMI connection and the RPi bootloader doesn’t support HDMI CEC as a wake-on signal in power off state. But depending on your TV setting you could start the Argon case with LibreELEC via remote control first, usually the CEC will trigger that the TV power on - if you doesn’t made other settings.

1 Like

Tank you a lot for your help. Now my mediacenter is completed.

1 Like