I would like to make my Pinnacle PCTV remote command (with its serial receiver) usable under Windows. I failed to make WinLIRC work so I tried lirc with Cygwin. I successfully compiled lirc-0.8.5 on Windows Vista x64 with Cygwin 1.7.
I will explain the steps to make it work, some people may be interested in.
First my installation is: - Windows Vista x64 business (should work on other Windows) - Cygwin 1.7 beta basic install (common install + development tools (gcc 4.3.2, binutils, ...) + python (I don't know if it is used))
Compilation: tar xjvf lirc-0.8.5.tar.bz2 cd lirc-0.8.5
patch -p1 -i ../lirc_cygwin-0.8.5.patch # I'll detail this patch later
CFLAGS="-O2" CXXFLAGS="-O2" ./configure --with-driver=pctv --with-tty=/dev/ttyS0 # I don't need debug info; works also with default flags
# I have a Pinnacle PCTV remote command with its receiver connected to the first serial port.
make make install
mkdir /var/lock # Cygwin does not create this folder
Execution: # -n: No daemon for test (also works without this flag) # -H pinsys: my remote (may be omitted as specified at configure step) # -d /dev/ttyS0: serial port to use (may be omitted as specified at configure step and /dev/lirc -> ttyS0 link created at install) # -l: enable inet socket, WinLIRC works like that # remotes/pinnacle_systems/lircd.conf.pctv is copied as /etc/pctv.conf at install so no config file precified /usr/local/sbin/lircd.exe -n -H pinsys -d /dev/ttyS0 -l
Test: irw.exe 0000000000fe173f 00 Chan+Play PinnacleSysPCTVRemote 0000000000fe7e17 00 channel+ PinnacleSysPCTVRemote 0000000000fe7e17 01 channel+ PinnacleSysPCTVRemote 0000000000fe7e17 02 channel+ PinnacleSysPCTVRemote 0000000000fe7e17 03 channel+ PinnacleSysPCTVRemote 0000000000fe7e17 04 channel+ PinnacleSysPCTVRemote 0000000000fe851b 00 vol+ PinnacleSysPCTVRemote 0000000000feb53c 00 Mute PinnacleSysPCTVRemote 0000000000fe4325 00 Chan_Last PinnacleSysPCTVRemote 0000000000fe4325 00 Chan_Last PinnacleSysPCTVRemote # It uses /dev/lircd
# Output matches key pressed on the remote
# Any application working with WinLIRC can connect to 127.0.0.1:8765. I tried with Media Player Classic Home Cinema
- daemons/irrecord.c: iprintf was conflicting with /usr/include/stdio.h declaration so I renamed it.
- daemons/lircd.c: In CYGWIN, FD_SETSIZE is 64 so with #define MAX_PEERS 100 MAX_CLIENTS would be -42. Thanks to gcc to notify the error! I don't know what is a peer and what is a client (irw is a client?) so may be this value should be tuned. Also ioctl(uinputfd, UI_DEV_DESTROY); cannot be compiled so I put this code for Linux only.
- drivers/lirc.h b/drivers/lirc.h and tools/mode2.c b/tools/mode2.c _IOR used in lirc.h is defined in sys/ioctl.h only if __USE_LINUX_IOCTL_DEFS is defined...
I'll now try to make it work as a service (it should not be hard) and connect applications to it. Thanks for your attention.
P.S.: sorry for my English, I don't use it very often.