I've bought an Energenie Pi-Mote IR control board for controlling my TV from a raspberry pi 4b and I'm struggling to get it to work. The manufacturer supplied user guide (https://energenie4u.co.uk/res/pdfs/ENER314-IR_User_guide_V3.pdf) is very old and is pre-systemd, half the lirc files have changed locations, the module names have changed and who knows what else is different now.
I've found a couple of links which seem to be a bit more up to date about getting IR to work (though not specifically the Energenie module)...
- Raspberry Pi 3 not lirc not running/working
- https://gist.github.com/justinyoo/34e3470ced2641221c69ebeab6e034f7
But I can't seem to get it working correctly.
I decided to start with receiving IR signals from a remote control and be sure that was working before I worked my way up to blasting IR commands. Here's what I've done so far...
Connect the Energenie Pi-Mote IR control board to the Raspbery Pi GPIO so that pins 1 and 2 are at the GPIO pins furthest from the ethernet port (so it looks like the picture in the above linked user guide).
Make sure everything is up to date and install lirc...
apt-get update && apt-get upgrade
sudo apt-get install lirc
- Modify boot config
Add an extra line on the end of /boot/firmware/config.txt into the
[all]section so that it looks like...
[all]
dtoverlay=gpio-ir,gpio_pin=18
- Change /etc/lirc/lirc_options.conf
- Change "driver" from "devinput" to "default"
- Change "device" from "auto" to "/dev/lirc0"
So the top of the file looks like...
[lircd]
nodaemon = False
driver = default
device = /dev/lirc0
output = /var/run/lirc/lircd
- Rebooted the raspberry pi
When it boots back up I can see /dev/lirc0 and lsmod lists gpio_ir_recv.
I then tried to test it by running...
sudo systemctl stop lircd.service lircd.socket
sudo mode2 --driver default --device /dev/lirc0
But before I can press any buttons on my remote control it non-stop prints out pulse and space lines like...
xxxx@pi:~ $ sudo mode2 --driver default --device /dev/lirc0
Using driver default on device /dev/lirc0
Trying device: /dev/lirc0
Using device: /dev/lirc0
Running as regular user xxxx
pulse 147
space 21927
pulse 49
space 782
pulse 109
timeout 130753
pulse 86
space 16884
pulse 89
Whilst I have a lot of kit in my office I don't believe I have anything that is chucking out tons of IR constantly, but just to be sure I have put the PI in a cardboard box, sealed it as much as possible and left the mode2 command running for a couple of minutes and it just never stops printing output.
Can anyone see what I am doing wrong?