Saturday, November 8, 2025

Example IR Blasting Setup Steps Used With MythTV v35 and Ubuntu 24.04

I used the steps below to set up IR blasting for use with MythTV v35.  I purchased a FTDI USB IR Blaster from www.irblaster.info/usb_blaster.html.  Some information about the device from dmesg is below.  The device is compatible with LIRC when used with Ubuntu 24.04, and compiling LIRC was not needed.  I use IR blasting with the MythTV external recorded method.

Partial output from sudo dmesg | grep usb:

    New USB device strings: Mfr=1, Product=2, SerialNumber=3
    Product: FT230X Basic UART
    Manufacturer: FTDI
    SerialNumber: D30GGNMF
    USB Serial support registered for generic
    registered new interface driver ftdi_sio
    USB Serial support registered for FTDI USB Serial Device
    Detected FT-X
    FTDI USB Serial Device converter now attached to ttyUSB0

Open the Terminal app to install ir-ctl, install lirc, and create a systemd service file:

    sudo apt install v4l-utils
    sudo apt install lirc
    sudo touch /lib/systemd/system/lircd-blaster.service
    sudo nano /lib/systemd/system/lircd-blaster.service

In nano started with the above command, enter the systemd service file content from wiki.mythtv.org/wiki/FTDI_USB_IR_Blaster_/_Transmitter_using_LIRC.  Changing the serial number is required, and changing the output number may be needed.  The serial number can be found using the dmesg command above.  I used output=2.

Use the Terminal app to enable LIRC using the service file:

    sudo systemctl daemon-reload
    sudo systemctl enable lircd-blaster.service

An LIRC configuration file is required.  The file can be obtained from https://lirc-remotes.sourceforge.net/remotes-table.html if one of the preconfigured conf files is compatible the remote that is to be emulated.  In my case, none of the files were compatible.  In order to capture the codes and create a conf file, I used an IR receiver with the remote to be emulated and ir-ctl.  

Use the Terminal app, and use the command below to receive one IR message (one set of codes).  Save the codes in a text file.  Do this for each remote button needed.

    sudo ir-ctl --receive -1

Create and edit a lircd.conf text file using the absolute value of the IR codes saved from above.  

Use the Terminal app for testing.  The command below should send the number 5.  The device name needs to be changed from box_01 in the command below to match that used in the lircd.conf file.

    irsend --device=/var/run/lirc/lircd-blaster SEND_ONCE box_01 5

Use the Terminal app to copy the conf file from the home folder:

    sudo cp ./box_01.lircd.conf /etc/lirc/lircd.conf.d/box_01.lircd.conf

An irblaster script is required to be used when MythTV needs to change the channel, toggle the power, or take another action needed when recording.  The simple irblater script I use is available at https://github.com/heyted/irblaster.  Download the script from Releases, extract it, and place the script in your home folder.

Use the Terminal app to copy the irblaster script:

    sudo cp ./irblaster /usr/local/bin/irblaster

A configuration file is required for MythTV's external recorder.  The configuration file I use is available at the GitHub link above, which calls the irblaster script.

Use the Terminal app to copy the external recorder conf file as shown below.  Change the file name to match the conf file being used.

    cp ./magewell.conf /tmp/magewell.conf
    sudo su mythtv
    cp /tmp/magewell.conf /home/mythtv/magewell.conf
    exit

No comments:

Post a Comment