Raspberry Pi Remote Control

Physical Pin #11 (BCM 17) is the receiver

Physical Pin #12 (BCM 18) is the transmitter

Start with Raspian Lite - Buster. If you have an old setup, you can upgrade -- just remember to dpkg --purge lirc.

Hardware

We connect PIN-11 (BCM-17) directly to a TSOP31438 to receive the IR signals, it's powered from the 3.3v (or 5v) rail. Then connect PIN-12 (BCM-18) to a XX&Ohm; resistor to the collector of the NP2222 transistor. The 5v rail is connected to the base and the emitter is connected to ground.

IR Receiver


   3.3V    GND     PIN-12
    ^       ^      BCM-18
    |       |        ^
    |       |        |
    |       |        |
  +-+-------+--------+-+
  |     IR Receiver    |
  |     TSOP31438      |
  +--------------------+

IR Transmitter


   5v   PIN-11                     GND
   +    BCM-12                      +
   |      +                         |
   |      |                         |
   |      |  +------+               |
   |      +--+ R10k +-----+         |
   |         +------+     |         |
   |                      |         |
   |                      |         |
   |   +--------+   +-----E-----+   |
   +-- > IR LED +---C  PNP2222  B+--+
       +--------+   +-----------+


Software

The old way used LIRC, the new way is to use gpio-ir. So, first we'll enable it, then we'll get it configured.

dpkg --purge lirc
apt install v4l-utils

IR Receiver

Update /boot/config.txt to add the gpio-ir.

dtoverlay=gpio-ir,gpio_pin=17

Reboot for these settings to take effect, verify them in dmesg | grep gpio_ir.

[   14.643792] rc rc0: gpio_ir_recv as /devices/platform/ir-receiver@12/rc/rc0
[   14.644203] input: gpio_ir_recv as /devices/platform/ir-receiver@12/rc/rc0/input0
[   14.644625] rc rc0: lirc_dev: driver gpio_ir_recv registered at minor = 0, raw IR receiver, no transmitter

Now, read some IR Inputs

ir-ctl --device=/dev/lirc0 --one-shot --verbose --receive=lg-sp-vol-dn.ircmd

IR Transmitter

Update /boot/config.txt to add the gpio-ir.

dtoverlay=gpio-ir-tx,gpio_pin=18
# OR
dtoverlay=pwm-ir-tx,gpio_pin=18,func=2

Reboot for these settings to take effect, verify them in dmesg | grep gpio_ir.

[   14.643792] rc rc0: gpio_ir_recv as /devices/platform/ir-receiver@12/rc/rc0
[   14.644203] input: gpio_ir_recv as /devices/platform/ir-receiver@12/rc/rc0/input0
[   14.644625] rc rc0: lirc_dev: driver gpio_ir_recv registered at minor = 0, raw IR receiver, no transmitter

Configure udev

$ cat /etc/udev/rules.d/80-gpio-ir.rules
#
# rpirc udev rules
#

ACTION=="add|change", SUBSYSTEM=="lirc*", DRIVERS=="gpio_ir_recv", SYMLINK+="lirc-rx"
ACTION=="add|change", SUBSYSTEM=="lirc*", DRIVERS=="gpio-ir-tx",   SYMLINK+="lirc-tx"
ACTION=="add|change", SUBSYSTEM=="lirc*", DRIVERS=="pwm-ir-tx",    SYMLINK+="lirc-tx"

Testing Remote Commands

Web-Application

This web application runs on the RaspberryPi, and you can view it from any smart-phone/tablet/desktop.

Configuring

Enable HDAVI (aka VIERA Link on Panasonic). This allows the RPi to control things via HDMI.

dtoverlay=gpio-ir,rc-map-name=rc-rc6-mce

See Also

* https://news.ycombinator.com/item?id=17826373

Hardware

Software

https://github.com/raspberrypi/linux/issues/2993 << Updagrade Issues

Fun

https://learn.adafruit.com/tv-b-gone-kit
Misc
https://discourse.osmc.tv/t/remote-double-clicks-following-april-2019-update/79538/29

https://www.msldigital.com/pages/support-for-remote
https://www.msldigital.com/pages/logitech-harmony

https://dronebotworkshop.com/kodi-raspberry-pi/ -- but scroll down

--

Raspberry Pi KVM

PiKVM.org