Kodi Community Forum

Full Version: USB-UIRT and irsend -> How best to trigger
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

I'm trying to set up my XBMC install to control my A/V Amp which I've just hidden away in a cupboard. I've managed to configure the USB-UIRT so that it sends the commands that I want to use and is able to control the amp using a command in the following syntax:

Code:
irsend SEND_ONCE RM-U306A_VOL MUTING

What I'm having issues with is how to get XBMC to call this command because I use more than one device to control XBMC (I have a harmony remote and also use the XBMC iPhone app). So far as I can see I have the following options:

  1. I can use the System.Exec command to call a batch script and use the keymap.xml to fire this when the right event is triggered.
  2. I can use the LIRC.send command (actually, can I. I can't find any description of what this command does or it's syntax, though it seems logical to assume that it's the irsend ... doesn't it? Huh
  3. I can use the .lircrc and irexec, as described in this post, to detect the remote keypress and forward this on. Unfortunately this won't help me when I'm using the iphone app as I can't see a way to trigger this event.

so, does anyone have any suggestions on the best way to achieve what I'm trying to do?

Cheers,
~Dan

Update:

Apologies if anyone is replying to this as I write but I've just had a moment to think (always a good reason not to rush your post). There is also a 4th option (or an alternative option 2). I'd assumed that LIRC.send would have execute the irsend command. It's also possible that it sends a remote command to LIRC which can then process it as if a remote command has been recieved. If that were the case, then I could use a combination of this and the .lircrc option to have all instances of the keypress (or API event) trigger the .lircrc event which runs an irsend?

Course, i could be barking totally up the wrong tree and I still don't know the syntax of the LIRC.send command :-)
I thought that I would try out the LIRC.Send command to see what happens with that (I was hoping my second assumption was true), unfortunately I seem to get an error when XBMC is loading up Sad

The log file seems to indicate that the LIRC.Send action doesn't exist, contrary to the wiki:

Code:
22:29:31 T:140653516466240 M:3004301312    INFO: Loading special://masterprofile/keymaps/remote-keymap.xml
22:29:31 T:140653516466240 M:3004301312   ERROR: Keymapping error: no such action 'lirc.send(muting rm-u306a_vol)' defined
22:29:31 T:140653516466240 M:3004301312   ERROR: Keymapping error: no such action 'lirc.send(vol+ rm-u306a_vol)' defined
22:29:31 T:140653516466240 M:3004301312   ERROR: Keymapping error: no such action 'lirc.send(vol- rm-u306a_vol)' defined

Will have to drop for the night and pick up again tomorrow. If anyone has any suggestions on how to IR Blast from multiple input sources though I'd be really grateful.

Cheers,
~Dan

Update: I also tried option 1, the System.Exec. Whilst this worked and triggered the irsend command it also did funny things with the display (made it occupy only the top left corner of the screen, I'm guessing minimised?) of XBMC and if a remote key was held down (e.g. turning up the volume) it caused XBMC to crash. I'm guessing that this is not really an option as it seems more to do with running one off bash scripts rather than my intended usage. So back to hoping that someone can explain the LIRC.Send command (and why it's not a recognised action / built-in).
OK, I've made some small degree of progress, unfortunately not in the direction I want.

It looks like the LIRC.Send command was introduced in the commit 28982 and the last time the PPA was updated (prior to the freeze) was 28256 (or so). Guess I'm going to have to wait a little while for that code change to filter through then.

For now I guess that I'll have to use the keymap.xml to blank out those button presses doing anything and use irexec and .lircrc config to perform the irsend.

Oh well, I'll keep and eye on the changes and update this if I make any more progress as it may help others.

Sad