# Iguanaworks USB IR Transceiver

## faceman

Anybody got this thing working, and could give a helping hand?  I'd like to do a wiki page on it, if I can get it working.  It's a nice little gadget, but would be better if it did something in Gentoo  :Smile: 

I've contacted support, but received little response thus far.

[Edit] I've got support working with me now, but nothing working as of yet.

----------

## keyson

Hi,

What have you done so far?

Did the driver compile ?

Did it install the udev rule in the right place ?

Have you reloaded the udev (udevtrigger) ?

Have you load it by hand, and check if it is associated with

the IR-dongle (cat /proc/bus/usb/devices  and check the driver line)

Did you follow the wiki

http://iguanaworks.net/projects/IguanaIR/wiki/GettingStarted

----------

## faceman

Thanks.

I've compiled the driver, the udev rule is in the right place, reloaded udev, /proc/bus/usb/devices lists:

```
T:  Bus=01 Lev=02 Prnt=05 Port=02 Cnt=01 Dev#= 11 Spd=1.5 MxCh= 0

D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1

P:  Vendor=1781 ProdID=0938 Rev= 0.00

S:  Manufacturer=IguanaWorks

S:  Product=USB IR Transceiver

C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=100mA

I:* If#= 0 Alt= 0 #EPs= 2 Cls=00(>ifc ) Sub=00 Prot=00 Driver=usbfs

E:  Ad=81(I) Atr=03(Int.) MxPS=   8 Ivl=10ms

E:  Ad=02(O) Atr=03(Int.) MxPS=   8 Ivl=10ms
```

Looks good.  The problem is that I don't get a /dev/iguanaIR directory.  I think the problem is that it can't create a /dev node without that dir.

When I enter

```
igclient --receiver-on
```

I get

```
ERROR: Failed to connect to iguanaIR daemon: No such file or directory
```

The iguanair user I created is part of the usb group, if that matters.

I did get an email from one of the Iguanaworks guys, and he's going to look into it when he gets a chance.

Can you give me the output of

```
ls -l /dev/iguanaIR/
```

Thanks for your help.

----------

## jcat

I may be barking up the wrong tree here as I'm not familiar with this particular product.  But, shouldn't you be using "lircd" with this device?

Cheers,

jcat

----------

## keyson

OK faceman,

Now we getting somewhere. The udev rules that came with the driver

is not going to create the right device.

(it should be placed in /etc/udev/rules.d/ with a number in front. The number is the order it will start up in.) 

iguanaIR.rules

 *Quote:*   

> 
> 
> ##################################
> 
> # As of udev 098:
> ...

 

But if you look in /dev/bus/usb/00x/00x (x is a number) you should find the

node.

You may do a lsusb and it should return something like this.  

Bus 001 Device 001: ID 0000:0000

Bus 002 Device 002: ID 0592:0002 Powerware Corp.

Bus 002 Device 001: ID 0000:0000

Now I see that my ups is at /dev/bus/usb/002/002

#ls -l /dev/bus/usb/002/002

crw-rw-r-- 1 root nut 189, 129  2 mar 11.25 /dev/bus/usb/002/002

But instead of root:nut your device should belong to iguanair:iguanair.

Also the command of /etc/init.d/iguanaIR rescan is not going to be run if you use

the init script for gentoo that's in the tarball. It only have start and stop.

iguanaIR.gentoo.init

 *Quote:*   

> 
> 
> #!/sbin/runscript
> 
> # load the settings
> ...

 

So you need to alter the rules file to make a device nod. and have a look on the init script.

P.S. Hope to see a good Gentoo WIKI how to make this work.

Regards

----------

## faceman

Thanks.

I'm not quite following, however.

I've got the rule making a device node at /dev/iguanaIR_1 - I don't know if it's the appropriate place or not, or if it matters, but I can't find out what it's supposed to be.  I thought it should be at /dev/iguanaIR/something, but I don't know how to dynamically make that node directory.

I also can't figure out how to make igdaemon know that my device is located at node /dev/iguanaIR_1 - I was thinking this done by code in the binary, but if you know how to do that, I'd be very happy.

--------------------------------

jcat: this device requires a proprietary driver

----------

## jcat

 *faceman wrote:*   

> 
> 
> jcat: this device requires a proprietary driver

 

Hehe, I told you I was barking up the wrong tree!   :Very Happy: 

Cheers,

jcat

----------

## keyson

Hi, it should be something like:

```

SYSFS{manufacturer} == "IguanaWorks", \

NAME="iguanaIR/%k", \ 

OWNER = "iguanair", GROUP = "iguanair", MODE = "0660", \

```

To make a directory.

----------

## faceman

Ok, I've got the rule making the node directory, not sure if it's making the correct node(s) though:

```
basilio facemyer # ls -l /dev/iguanaIR/

total 0

crw-rw-r-- 1 iguanair usb      189,  6 Mar  4 09:01 1-7.3

crw-rw---- 1 iguanair iguanair 189,  6 Mar  4 09:01 usbdev1.7

crw-rw---- 1 iguanair iguanair 253, 15 Mar  4 09:01 usbdev1.7_ep00

crw-rw---- 1 iguanair iguanair 253, 17 Mar  4 09:01 usbdev1.7_ep02

crw-rw---- 1 iguanair iguanair 253, 16 Mar  4 09:01 usbdev1.7_ep81

```

I'm still getting this error:

```
basilio facemyer # igclient --receiver-on

Mar 05 01:46:45 2008 ERROR: Failed to connect to iguanaIR daemon: No such file or directory
```

I have no way of knowing what node the daemon is looking for.

This error is given whether the daemon is running or not.  I'm really at a loss.

----------

## keyson

Hi again,

I don't have this device so it is not easy to see what you have to do.

But the TroubleShooting page

state that the device get a number.

Try

```

SYSFS{manufacturer} == "IguanaWorks", \

NAME="iguanaIR/%n", \

OWNER = "iguanair", GROUP = "iguanair", MODE = "0660", \

```

Instead of %k that gives the kernel name %n gives the kernel number (Like 3 for sda3 as the man page say).

This can be made into a symlink by the daemon as I can see. So you can call it 'fred', but first it have to find it.

----------

## faceman

Ok, I did that, and now it gives me:

```
crw-rw---- 1 root root 253, 17 Mar  5 22:28 00

crw-rw---- 1 root root 253, 19 Mar  5 22:28 02

crw-rw---- 1 root root 189, 13 Mar  5 22:28 14

crw-rw-r-- 1 root usb  189, 13 Mar  5 22:28 3

crw-rw---- 1 root root 253, 18 Mar  5 22:28 81
```

I don't know if it's creating the correct node with the correct device registry - I mean, it probably looks for "0" first, but which one of those four entries is going to be the one it wants for "0"?  And then, how do I make it "0" rather than what it is?

I know that for testing I can create a manual symlink, so I'll try that, but do you have any other ideas?

Thanks

[Edit] I created a symlink for each file, none worked.

----------

## keyson

Yep,

But if you run the igdaemon in a terminal.

```

# igdaemon -n -v -v -v

```

What is the output. Check the trouble shooting page what is expected.

It say that it have to be set with a lable.

```

igclient --set-id fred

```

----------

## faceman

Actually it says it does not need a label:

 *Quote:*   

> Explanation: This isn't actually a problem. When the daemon starts communicating with a device it attempts to read the id so that it can set up a symlink and allow communication under a user-defined name. When we ship our devices they do not have ids and so will only come up as numbered. If you have more than one you might find it useful to set ids for each device.

 

...and it doesn't let me apply a label anyways, I get the same file not found error.

here's the output:

```
basilio facemyer # igdaemon -n -v -v -v

Mar 20 08:33:36 2008 DEBUG: Handling 0 device(s):

```

This was giving me other output (it was handling the device earlier, I just looked in the log), but it's not now.  I changed something that made it stop working even that much  :Neutral: 

----------

## keyson

Hi faceman,

Found that there is a ebuild in portage now for iguanaIR

----------

## faceman

Well, I bugged them enough that they fixed it in their latest release of the software.  The only problem it needs to be restarted for me after reboot, since the init script doesn't know to wait until after LIRC starts.  I'll have to figure that out and let them know...

----------

## keyson

Hi, Nice to hear that you got it working.

Check that you have 

```
after lircd
```

in the depend of the startscript for iguanaIR.

Then it starts after it starts the lirc deamon.

But sometimes they check in the start tag of the init script that the

needed services has started before executing the start.

I think you find a way to fix this. Look at the other start/stop scripts.

----------

## faceman

I actually figured this out right after I posted.  Thanks, though, for the info.  (But I have yet to reboot to see if it fixes the issue, though it should.)

I'd like to get the ebuild updated for the newest version.  Keyson, are you familiar with ebuilds?  I've never done one before.  How would I add this line to the init script by an ebuild?

----------

## keyson

OK,

Normaly the start/stop script is located in the files directory of the ebuild.

So if you look in the iguanaIR ebuild directory you have a sudirectory files,

in that directory you have a file called something like iguanaIR.rc6. This is the

start/stop script.

You can move the ebuild to an overlay, and edit the iguanaIR.rc6. In that way

it would not be owerwritten on the next sync.

To get the lates release you copy the ebuild and rename it to the new version.

Example:

cp iguanaIR-1.2.3.ebuild  iguanaIR-1.2.4.ebuild

Because normaly the ebuild fetch and build the package $P and that is the version of the name of the ebuild.

Check the beginning of the ebuild.

Can check this later for you, as I'm not on a Gentoo machine just now.

EDIT: That was different. The source contain a file called iguanaIR.gentoo.init and is installed as /etc/init.d/iguanaIR.

So what you have to do is to download the source and unpack it in two different directory. One that you keep the original 

and one that you apply the patch iguanaIR-0.93-gentoo.diff that is located in the files directory.

Now in the same patched directory apply the change to the start stop script iguanaIR.gentoo.init.

Then create a new diff (iguanaIR-0.93-gentoo.diff) and place this in the files directory.

Now when the ebuild is running it would patch the source with the orginal patch and the changes you have done.

In the top of the iguanaIR-0.93-gentoo.diff you see how this is done.

 *Quote:*   

> 
> 
> diff -Naur iguanaIR-0.93.orig/iguanaIR.gentoo.init iguanaIR-0.93/iguanaIR.gentoo.init
> 
> --- iguanaIR-0.93.orig/iguanaIR.gentoo.init     2008-03-20 15:34:46.000000000 +0100
> ...

 

But you diff the directory recursive. Check the man page for diff and patch.

----------

## keyson

BTW the best would to get the iguana guy's to fix it in the new release.

Then the ebuild don't have to patch the source.

----------

## faceman

Strange, it didn't work with "after" or "need".  I ended up renaming it by putting another letter before the script name and calling it that way, so it starts last.  However, the same problem exists - it acts as if it's not been started after lirc.

HMMMMMMMMMMMMMM.....................

----------

## Audball

I installed this last weekend like so.  I may have forgotten a few steps and I took some extra steps that wasted a lot of my time, but I'm pretty sure that the below steps will lead to success.

I copied the .93 ebuild from normal portage to /usr/local/portage/app-misc/Iguanair

I edited the file to rename any occurrence of .93 to .95

Comment out the line about patching

create manifest

unmask in /etc/portage/package.keywords with ~x86

emerged Iguanair

I then had to manually edit the lirc ebuild to add iguanair to the list of devices as mentioned somewhere else on the forums

emerged lirc

the only quirk is that rc-status says that iguanair deamon is not running when it obviously is because everything works for me.

Those are the only steps I remember taking.  If this steps cause you problems, let me know and I'll try to help you out.  I offer no guarantee that it won't break your system and highly recommend making a stage 4 before you begin (see here http://gentoo-wiki.com/HOWTO_Custom_Stage4).

----------

