How to turn on the Argon One with a different IR remote?

Hi,

I would like to use a spare IR remote with my Argon One M.2. I already got this working apart from the power button to turn on the device. I know that I have to use

 bus.write_i2c_block_data(address, command, powerdata)

to program the extra Argone One MCU with a fitting powerdata byte sequence. That’s where the problems start. Apparently there are fundamental differences in how lirc and ir-keytable interprete the IR data send by the IR remote. Furthermore irrecord (lirc) seems to not adequately interpret the signals of unknown remotes. At least I have seen fundamental differences between the lircd.conf provided by Argon and what people read with irrecord. So the problem is that I don’t know how the MCU interpretes the IR signals and how this relates to what I can read either using irrecord or ir-keytable. The codes for the power button of my remote are

ir-keytable = [0xbf, 0x0d ]
irrecord = [0x22, 0xFE, 0x01, 0x00, 0x00, 0x00, 0x11, 0x6A]

But none of these seem to work.

Could someone who owns a Argon remote please post what codes ir-keytable and irrecord read for the argon remote power button? Maybe someone has a tip how to construct the correct powerdata sequence?

Best regards,
Stefan

can try 0x00FF39C6 as the IR code for the power button.

Thanks for trying to help. This is the power code for the original Argon remote. Did you read this with ir-keytable or irrecord or did you google it?
What I want to know is the relation between this code and the code that is read by ir-keytable and irrecord because I might then be able to infer which code is needed for my own remote. There is some ambiguity in the interpretation of the raw IR pulses send by an IR remote http://www.righto.com/2010/03/understanding-sony-ir-remote-codes-lirc.html and I basically try to find out how the pulses are interpreted by the MCU that turns on the raspberry pi.

Sorry, my bad. I just found out that the script argonone_ir has an option to learn and program the power button of a different IR remote. I configured it all by myself and never executed the script by now. The script fails with an error though (No module named ‘_client’) but that’s a different story. I will post here, when I resorted this issue.

I got it working now. The lirc fallback in argonone_ir did not work and generated the error above because _client.so was missing in /usr/lib/python3/dist-packages/lirc/ . When you have a fresh install _client.so is there but the first invocation with sudo deletes it (despite my attempts to prevent this with chmod 544 and chattr -i). This has to do with this bug in lirc https://sourceforge.net/p/lirc/tickets/341/. The reason why the fallback was activated in first place was that I had already activated the driver for the IR sensor (dtoverlay in /boot/config.txt). This blocked the GPIO pin and made GPIO.wait_for_edge fail with “Error waiting for edge”. To resolve this, I deactivated the driver, restarted the raspberry, executed argonone_ir and activated the driver again.

Hi Stefan, can you detail the steps you took to get this working?
You post is promising, but it doesn’t say how you did it?
Regards,
Dav

RTFM - this also applies to myself. Because I ran into this myself again - here are the steps:

  1. Make sure dtoverlay=gpio-ir,gpio_pin=XX is not active in your /boot/config.txt
  2. reboot the device if you made changes to the config.txt
  3. Make sure you have python3-dev and python3-rpi.gpio installed via apt
  4. run the curl command from the manual : curl https://download.argon40.com/argon1.sh | bash
  5. run the now installed argon-ir script and follow the instructions
  6. Add dtoverlay=gpio-ir,gpio_pin=XX to /boot/config.txt , replace XX with your GPIO pin (e.g. 23)
  7. reboot the device

If this fails, your remote might not be supported.

I just noticed that the dtoverlay is automatically added to /boot/config.txt . So there is nothing todo except reboot after successful configuration. But you will have to remove the entry manually if you want to repeat the configuration or else you get the error

Traceback (most recent call last):
  File "/usr/bin/argonirdecoder", line 334, in <module>
    pulsedata = getGPIOPulseData()
  File "/usr/bin/argonirdecoder", line 46, in getGPIOPulseData
    channel = GPIO.wait_for_edge(irreceiver_pin, GPIO.FALLING, timeout=PULSETIMEOUTMS);
RuntimeError: Error waiting for edge

To add a new remote you basically need to create a toml file to add to the (linux) system configuration with

sudo ir-keytable -c -w [your remote].toml

The scan codes can be read from

sudo ir-keytable -c -p all -t

The key codes relate to

include/uapi/linux/input-event-codes.h

After you imported the toml file, the remote behaves like an input device firing linux input events. These can be linked to application functionality. For kodi (which is my use case) this can be done in your user home in

.kodi/userdata/keymaps/keyboard.xml