User Tools

Site Tools


unix:osx:lirc_on_a_mac

Setup of LIRC on a mac with IO USB dongle and Creative Infra serial receiver/remote

Needs update

Etc.

With prolific usb to serial adapter, download Prolific driver for GUC32 prolific usb driver and change /System/Library/Extensions/ProlificUsbSerial.kext/Contents/Info.plist product and vendor ids to 8200 and 1367 respectively. Reload driver via sudo kextload /System/Library/Extensions/ProlificUsbSerial.kext

Download & extract lirc-0.8.2.

Edit setup.sh, change all references to ttyS0 to tty.usbserial. Edit configure and change ac_default_prefix to /opt/local (since this is what macports already uses). Edit configure and change default dev path (variable devdir) for darwin to /opt/local/lirc/dev (with no ending /).

run ./setup.sh choose creative infrablahblah Save and Configure. make make install

if make install fails rm /dev/lirc and ln /dev/lirc /opt/local/lirc/dev/lirc

Make directory /var/lock

Run irw, not lircd yet, and see if you get response on teh remote.

done.

* not sure why, but had a hard time on the powerpc 12“, specifying -d with lircd, THEN running irw works: lircd -d /dev/tty.usbserial;irw set perms on the lircd dev to 666 for normal user access. done.

What a fucking pain… LIRC cannot just send a keystroke to a Mac application (wouldn't expect it to be high on their list of to-do's), so it seems the best way is to write another AppleScript wrapper as I did for the iChat widget… FUN!

An example is like so for 0.scpt:

 tell application "System Events"
	
 	tell application "SlingPlayer" to activate
 	keystroke "0"

 end tell

and in /etc/lircrc file:

 begin
 prog = irexec
 button = 0
 config = osascript /Users/catherinezeidler/src/0.scpt
 end

Need to have either a .scpt file for every possible action, or a wrapper app that takes two args- one the application to send to, and two the key to send. Maybe something like “numbers.scpt” which can send 0-9 to any application.

Now- after a long spell of troubleshooting, I found a work around to an issue where one cannot pass the application name for a “tell” in applescript via a variable- it can be done, but not inside another Tell…

Here's the basic working example of a wrapper:

on run argv
	
	set argv1 to (item 1 of argv)
	set argv2 to (item 2 of argv)
	
	tell application argv1 to activate
	
	tell application "System
                    
                                    
unix/osx/lirc_on_a_mac.txt · Last modified: 2010/02/22 08:11 by ben