Need help understanding Argon One IR control

  • IMO, it would make sense for us to select a remote, as a group, and develop a keymap file. I will throw in and help with whatever the group decides but I suggest either MCE or FLIRC. Personally, I'd select MCE.

    I'm familiar with neither, but I am very in favor of this idea. The Kodi, Harmony, and Raspberry PI 4 with IR sensor newb guide is using a Mecool DVR device, but I don't think we need as many keys if we simply want to use basic on/off, left/right/up/down and volume control commands.

  • You need a special script for Argon One (the version with the installed IR) for usage with LibreElec. V2 of the board allows to power up the RPi4 with IR. Maybe this script helps:

    Code
    # IR config script
    sudo wget https://download.argon40.com/argonone-irconfig.sh -O /usr/bin/argonone-ir --quiet
    sudo chmod 755 /usr/bin/argonone-ir

    the full installation script can be seen in this german article.

  • You need a special script for Argon One (the version with the installed IR) for usage with LibreElec. V2 of the board allows to power up the RPi4 with IR. Maybe this script helps:

    Code
    # IR config script
    sudo wget https://download.argon40.com/argonone-irconfig.sh -O /usr/bin/argonone-ir --quiet
    sudo chmod 755 /usr/bin/argonone-ir

    the full installation script can be seen in this german article.

    I am unsure this script is valid for librelec, as it does not require the sudo command.... I read the article and that code only mentions raspbian and ubuntu.

  • The script is not directly for libreelec, but it has the missing functionality for IR from the LibreElec installation script of the Argon ONE.

    https://download.argon40.com/argonone-setup-libreelec.sh

    Raspbian is the OS if it is not Ubuntu in the script. Maybe you get some hints from the script or LibreElec is compatible with Raspbian in configuration. I looked a little bit into the script and it adds the GPIO for IR into /boot/config.txt, LIRC is used for IR communication. looks not too bad.

  • For anyone else trying to get the power on function in libreelec to work with the argon one v2, this is what worked for me:

    - use the case with a pi running rasberry pi os (I used an extra sd card, raspios lite gave errors with the scripts, so use the full one)

    - use these commands:

    Code
    curl https://download.argon40.com/argon1.sh | bash
    argonone-ir

    - Follow the steps to program the case to use a power button from any remote (needs to be NEC protocol, I used a mecool KIII pro profile on my harmony)

    - use the case with libreelec (the v2 ir module will remember the power command from the remote)

  • If you are interested: Full remote control for LibreElec with Argon One V2 Case - the "not so professional" way!

    I have 1 Argon One M.2, 1 Raspberry Pi 4B and and 2 ONE4ALL URC-6430 (afterwards I need just only one!)

    1. Installed Libreelec (e.g. with balena etcher on a USB-Stick or microSSD)

    2. SSH enabled?

    3. Installed Addon "Script - System Tools"

    4. Connected (ssh) from PC to libreelec box

    5. Edited config.txt

    LibreELEC: ~ # mount -o remount,rw /flash
    LibreELEC: ~ # mcedit /flash/config.txt

    Code: /flash/config.txt
    dtoverlay=gpio-ir,gpio_pin=23

    LibreELEC: ~ # reboot

    6. Found some scan codes

    LibreELEC: ~ # ir-keytable -p nec -t

    Now I had to program my remote. I have two identical "One4All URC 6430" but it should be ok with other learning remotes too. Searching for a PVR or Mulimedia Device to get as much as possible functional keys, the best ones I found, were DVICO (2153) and Digitech (2260) in the code list of my "URC 6430".

    table: ONE4ALL URC 6430 : VIDAC (2153) - Digitech (2260)

    Display Spoiler
    kodi scancodes urc 6430 pvr
    Code 2153
    copy urc 6430 pvr
    code 2260
    KEY_POWER 0x4cb02 POWER OK
    KEY_RED 0x4cb41 RED 1
    KEY_GREEN 0x4cb03 GREEN 2
    KEY_YELLOW 0x4cb42 YELLOW 3
    KEY_BLUE 0x4cb45 BLUE 4
    KEY_EPG 0x73960000 GUIDE
    KEY_HOME 0x6a960000 HOME
    KEY_INFO 0x67960000 INFO
    KEY_CHANNELUP 0x21960000 +
    KEY_CHANNELDOWN 0x19960000 -
    KEY_BACK 0x4cb07 BACK 5
    KEY_VOLUMEDOWN 0x15960000 VOL DOWN
    KEY_VOLUMEUP 0x25960000 VOL UP
    KEY_MUTE 0x5e960000 MUTE
    KEY_BACKSPACE 0x4cb46 RETURN 6
    KEY_CONTEXT_MENU 0x4cb55 LIST 7
    KEY_UP 0x4cb50 UP PLAY
    KEY_RIGHT 0x6f960000 RIGHT
    KEY_DOWN 0x63960000 DOWN
    KEY_LEFT 0x6b960000 LEFT
    KEY_OK 0x6e960000 OK
    KEY_RECORD 0x31960000 REC
    KEY_REWIND 0x1f960000 REWIND
    KEY_PLAY 0x4cb17 PLAY 8
    KEY_FORWARD 0x22960000 FORWARD
    KEY_STOP 0x4cb4c STOP STOP
    KEY_PLAYPAUSE 0x4cb56 PAUSE 9
    KEY_1 0x1b960000 1
    KEY_2 0x27960000 2
    KEY_3 0x2b960000 3
    KEY_4 0x17960000 4
    KEY_5 0x60960000 5
    KEY_6 0x64960000 6
    KEY_7 0x58960000 7
    KEY_8 0x5c960000 8
    KEY_9 0x68960000 9
    KEY_0 0x13960000 0
    KEY_SUBTITLE 0x2f960000 AV
    KEY_TEXT 0x4cb1b TEXT 0

    The best match for me was the DVICO. Some key did not give any scan code. So I used the second remote to find any functional keys. Then copied the keys from the second remote to the functionless keys of my first remote.

    7. Created my /storage/.config/rc_keymaps/custom_remote

    8. Pointed to it

    Code: /storage/.config/rc_maps.cfg
    * * custom_remote

    9. Now tested, if it works:

    I opend two remote terminals (to watch scancode and mapped keys simultaneously)

    No.1 for

    LibreELEC: ~ # ir-keytable -c -w /storage/.config/rc_keymaps/custom_remote

    No.2 for

    LibreELEC: ~ # irw

    10. Rebooted, and ...

    11. I didn't get the powerbutton script working with LibreElec. So i had to flash another USB-Stick with a Raspberry OS Lite to program my power key. If you manage to run the script, you have to do this before starting with this "tutorial". Installing the OS on the Raspberry and configuring the power button is not a big deal.

    I hope this may be usefull for someone and sorry for the bad english, the bad layout and the many errors!


    Usefull links:

    https://wiki.libreelec.tv/configuration/ir-remotes

    http://wagnerstechtalk.com/argonone/#Install_Argon_ONE_Scripts_in_Pi_OS_3264-bit

    Edited 2 times, last by MJever (August 3, 2021 at 9:44 AM).

  • For anyone else trying to get the power on function in libreelec to work with the argon one v2, this is what worked for me:

    - use the case with a pi running rasberry pi os (I used an extra sd card, raspios lite gave errors with the scripts, so use the full one)

    - use these commands:

    Code
    curl https://download.argon40.com/argon1.sh | bash
    argonone-ir

    - Follow the steps to program the case to use a power button from any remote (needs to be NEC protocol, I used a mecool KIII pro profile on my harmony)

    - use the case with libreelec (the v2 ir module will remember the power command from the remote)

    Yes, in fact argonone-ir launches a argonone-irdecoder.py script that scans IR sequence for remote power button and write it in the argon MCU with I2C (command = 0xaa). That's why it persists even if you use another OS.

    I also presume that this MCU intercepts ir sequences to power off/on when it detects the remote power button sequence.

  • I need to do more test but I think we can use an ir remote with a protocol other than nec to power on/off the raspberry.

    The argonone-ir script only handles nec protocol but if we know the powersequence, we can bypass the script and directly write the power button sequence to the MCU with a write_i2c_block_data(0x1a, 0xaa, powersequence) command. powersequence is a 4 bytes value.

    If your remote is in the Index of /remotes database, you can calculate your powersequence : it a concatenation of pre_data and KEY_POWER code.