View Full Version : USB-UIRT and Linux

November 8th, 2015, 11:46 AM

Is the USB-UIRT usable with the Linux/RPi versions of Girder 6 ?
I only found old threads saying it was not implemented because the linux driver was missing.
Is it still true ?



November 9th, 2015, 06:51 PM
Still true unfortunately. No library available as far as I know.

November 10th, 2015, 02:42 AM

Its a major blocking point for me, as I intend to migrate my "core logic" to a linux server running 24/7.

I believe USB-UIRT is supported with LIRC under Linux.
I'll try interfacing LIRC with the Girder event/action system (running the command line irsend tool to send codes through Girder, and calling csevent from LIRC when receiving known IR commands). It's not as good as direct support, but this should work...


November 10th, 2015, 12:33 PM
Worth a try yes.

December 14th, 2015, 09:14 AM
I confirm this is working.

I am able to send IR commands from Girder by calling the irsend utility with System/Execute.

I am also able to get IR input from the WinLIRC plugin.

Do you know why sending commands is not supported with the WinLIRC plugin (only receiving) ? Is this because the Windows daemon only implements the receiving/broadcast part and not the full LIRC communication protocol ?

A LIRC plugin with full sending/receiving enabled (and support for lua scripting) would be a good solution to support a whole range of IR transceivers without requiring binary drivers.


December 23rd, 2015, 04:11 PM
Even better : as the LIRC socket protocol is a simple TCP server with text-based commands, I was able to replace both the System/Execute action and the WinLIRC plugin for incoming commands, with a "Simple Transport" instance connected to the lirc tcp daemon.

I can send IR commands (either predefined or custom) through the "Simple Transport" actions in the action tree or through a LUA script.
With a simple regexp based parser defined in the Transport config window, I can trigger girder events from the incoming IR commands.

It's less comfortable than an actual USB-UIRT plugin in Girder would be because I have to record all my IR commands in the LIRC config, outside of Girder, but it's still working perfectly.


December 23rd, 2015, 04:34 PM
That is awesome. Would you like to contribute your code?

December 23rd, 2015, 06:41 PM
Of course.

This is a quick & dirty parser as a proof of concept.

Other events could be triggered when an error occurs when sending an IR command...

The LIRC deamon should be running on the Linux box, with the "-l" option to create a TCP socket.
Your remote(s) should be properly configured. Check that your LIRC configuration is OK by using the irsend command before configuring the Girder part.

1. In Girder, enable the "Simple Transport" plugin.
2. In the plugin config screen, add a new connection (I named it "LIRC daemon")
Choose a TCP connection, and select correct host & port (port TCP 8765 by default).
Choose "Terminated" as the message type, with 0A as the terminator value (LF)
3. Add the data parser code

-- Device ID for triggered events
local LIRC_DEVICE = "16000000"

-- Pattern for incoming commands (hexcode iteration keyame remotename)
local re = "(%x+) (%d+) (%S+) (%S+)"

-- capture incoming commands.
-- currently, other data is ignored (feedback from outgoing commands, error messages...)
local code, iter, key, rc = string.match(data,re)

if key then
if iter == "00" then -- capture only first occurence. Remove this test to trigger a new event for each occurence.
-- event string is IR + remote name + key name
local es = "IR-" .. rc .. "-" .. key
local pld = { rc, key, code }
gir.triggerEvent(es, LIRC_DEVICE, Promixis.Event.EVENT_MOD_ON, pld)

4. You can add predefined commands, with the DATA field set to

SEND_ONCE remotename keyname
The remotename and keyname should match the values from your LIRC configuration files.

Every incoming IR command properly configured in your LIRC configuration will now trigger a new event with an event string equals to IR-remotename-keyname.

To send commands, you can :
- use the Simple Transport / Send Predefined Action to send one of your predefined actions
- use the Simple Transport / Send Action to send a custom action (SEND_ONCE command, or any command supported by the LIRC socket protocol)
- use a LUA script : you must get the Transport ID (at the bottom of the "Edit Transport" dialog) and the Predefined command ID (from the Predefined command dialog) and use the following code :

local lircDevice = "{5fd9dd19-792f-4ada-a3a0-080fb179f320}"
local myCommand = "{acd704a2-3599-4e08-bf31-0e3d808d2fd3}"

simpleTransport.sendData(lircDevice, "SEND_ONCE LGTV POWER")
simpleTransport.sendPredefined(lircDevice, myCommand)