I had some problems with irtrans and other usb-serial devices (mainly 3g usb modem). Since the 3g modem isn't always attached i had problems to get right devicename on my startup scripts. Sometimes irtrans was /dev/ttyUSB0 and sometimes it was /dev/ttyUSB1.
I deceided to fix that problem with simple udev rules. I made a rule which made a symlink /dev/irtrans0 to point to right ttyUSB device. However i noticed that irserver wasn't working with /dev/irtrans0, so i took a peek at irserver souces and made a small patch.
The quick and dirty patch:
- Code: Select all
diff -w -r -x '*.o' -x irserver -u irserver-vanilla/lowlevel.c irserver20090912/lowlevel.c
--- irserver-vanilla/lowlevel.c 2009-07-24 18:13:19.000000000 +0300
+++ irserver20090912/lowlevel.c 2009-09-12 20:48:57.000000000 +0300
@@ -2549,10 +2549,17 @@
#endif
#ifdef LINUX
//LINUX Autofind USB devices
- if ((!strncmp (st + q,"usb",3) || !strncmp (st + q,"USB",3)) && !autoflag) {
+ if( !strncmp( st, "/dev/irtrans", 12 ) && !autoflag ) {
+ autoflag = 1;
+ res = 0;
+ get_detail_deviceinfo ("",st,IF_USB);
+ }
+ else if ((!strncmp (st + q,"usb",3) || !strncmp (st + q,"USB",3)) && !autoflag) {
autoflag = 1;
res = 0;
for (i=0;i < 16;i++) {
+ sprintf (dst,"/dev/irtrans%d",i);
+ if (get_detail_deviceinfo ("",dst,IF_USB)) {
sprintf (dst,"/dev/ttyUSB%d",i);
if (get_detail_deviceinfo ("",dst,IF_USB)) {
sprintf (dst,"/dev/usb/ttyUSB%d",i);
@@ -2566,6 +2573,7 @@
}
}
}
+ }
else if ((!strncmp (st + q,"/dev/usb/tty",12) || !strncmp (st + q,"/dev/ttyUSB",11) || !strncmp (st + q,"/dev/usb/tts",12) ||
!strncmp (st + q,"/dev/ttyusb",11) || !strncmp (st + q,"/dev/tts/USB",12)) && !autoflag) {
if (st[q + strlen (st+q) - 1] == ']') {
It would be nice to get similar feature to upstream code, since i'm 101% sure i will forget to patch irserver if i never update it

Regards
John