DVB-T remote control


Ahoy pirates!

I bought your DVB-T dongle (black one) about a year ago, but couldn’t get it to work, so I left it. Now I’ve had another go and connected it to a proper aerial via an MCX to Coax pigtail and have finally had success at viewing TV channels in LibreELEC/Kodi using TVHeadend. (I guess the supplied aerial hasn’t got enough gain for my area).

Anyway, the DVB-T dongle comes with an Infra-Red remote control. Can you tell me if the dongle has a built-in IR-Receiver that it works with, or do I have to add one to the Pi itself? At the moment it doesn’t seem to do anything. I tried adding “dtoverlay=lirc-rpi” to /flash/config.txt and rebooting, but it still didn’t do anything. Is there any other configuration or Addon I need to use? (I also tried Xbian and OSMC but LibreElec was the only one I managed to get TVHeadEnd working in).


EDIT: I discovered the dongle does have an IR receiver exposed as /dev/lirc0, So now I just have to work out how to use lirc to configure it.


It’s been a loooooonnnng time since I used lirc to configure an IR remote, I’d be keen to know how you get on.

I, too, couldn’t get digital TV channels with any stability in my area- probably the big metal roof on our apartment building. It’s a pretty weedy aerial!


Further research suggests I shouldn’t need lirc as support is built into the kernel/Kodi now. It’s just taken me a while to find the right documentation. Hopefully I will have the remote working soon.


The last dongle I bough had a remote and the receiver was built into it. I never used the remote though. I used that dongle for a software defined radio setup to listen to HF and VHF aircraft coms. Best guess is the dongle sends what amounts to the media key commands of a USB keyboard. Have a look see here, https://learn.pimoroni.com/tutorial/robots/controlling-your-robot-wireless-keyboard I’ve used that procedure to check what codes a remote control sends out. Look for the dongle in the list when you run sudo lsusb


So here is what I did to get the remote working with LibreElec, by ssh’ing into it.

  1. Create a file called pimoroni_remote in /storage/.config/rc_keymaps as follows:

    # table pimoroni_remote, type: nec

    0x4d KEY_PAUSE #onoff
    0x54 KEY_TV #source
    0x16 KEY_MUTE #mute
    0x46 KEY_RECORD #record
    0x05 KEY_CHANNELUP #ch+
    0x0c KEY_ENTER #timehshift
    0x0a KEY_VOLUMEDOWN #vol-
    0x40 KEY_ENTER #fullscreen
    0x1e KEY_VOLUMEUP #vol+
    0x02 KEY_CHANNELDOWN #ch-
    0x1c KEY_ESC #recall
    0x12 KEY_0
    0x09 KEY_1
    0x1d KEY_2
    0x1f KEY_3
    0x0d KEY_4
    0x19 KEY_5
    0x1b KEY_6
    0x11 KEY_7
    0x15 KEY_8
    0x17 KEY_9

The first columm is the scan codes generated by the different buttons. the next column is the Linux key code you want it to generate. I have arbitrarily mapped these at the moment, until I understand better what keys are useful for TV viewing. Change as you want. The comment after the # is just a note of what the remote key is.

  1. Create a file called rc_maps.cfg in /storage/.config as follows:

* * pimoroni_remote

This tells it to load the above remote control key map file for all devices.

  1. Create a file called autostart.sh in /storage/.config/ as follows:

    ir-keytable -a /storage/.config/rc_maps.cfg

This script tells it to autoload whatever keymaps it finds at startup.

For more information, see https://wiki.libreelec.tv/infrared_remotes?s


Nicely done. Insert large thumbs up smiley here. =) Copied and saved for future reference.