Skip to main content
Topic: IR Toy and lirc on Linux (Read 12853 times) previous topic - next topic

Re: IR Toy and lirc on Linux

Reply #15
Has anyone gotten LIRC to work with the sampling mode for the USB IR Toy under Linux?

The WinLirc-plugin works excellent on Windows but..well..it seems the Linux LIRC requires drivers from the source code?



Cheers,
Shadowsoul

Re: IR Toy and lirc on Linux

Reply #16
It will require some custom support to get it working. We just finished a python plugin for event ghost this week. We used the existing UIRT(2?) plugin. There were two major changes, one is a little questionable long-term.

1. We changed the setup to the IR Toy commands, simple enough.
2. UIRT2 and others use an 8bit measurement value at 50us resolution, and the remote decoder in eventghost expects 8bit data. The IR Toy gives 16bit data with 21.3333uS resolution. We adjusted down by multiplying by 21.333 then dividing by 50, and just sending an 8bit value. There are probably going to be some shortcomings in this that will have to be worked out, but it's enough to get started and find out what happens next.

Next I'd like to work on getting support in LIRC. I plan to take the same approach - see if it has UIRT2 support, then hacking that to work with the IR Toy. Just taking a quick look, it seems like there's a few uirt2 related files here:
http://lirc.cvs.sourceforge.net/viewvc/ ... c/daemons/
Got a question? Please ask in the forum for the fastest answers.

Re: IR Toy and lirc on Linux

Reply #17
[quote author="ian"]UIRT2 and others use an 8bit measurement value at 50us resolution, and the remote decoder in eventghost expects 8bit data. The IR Toy gives 16bit data with 21.3333uS resolution. We adjusted down by multiplying by 21.333 then dividing by 50, and just sending an 8bit value. There are probably going to be some shortcomings in this that will have to be worked out, but it's enough to get started and find out what happens next.[/quote]I don't use LIRC or Linux (another Unix instead: OSX), but I assume that you're talking about a plugin (eventghost).  Is there any way the plugin could initialize the connection by changing the IRToy clock rate to a rate that would divide evenly into 50 µs?

Re: IR Toy and lirc on Linux

Reply #18
[quote author="ian"]
It will require some custom support to get it working. We just finished a python plugin for event ghost this week. We used the existing UIRT(2?) plugin. There were two major changes, one is a little questionable long-term.

1. We changed the setup to the IR Toy commands, simple enough.
2. UIRT2 and others use an 8bit measurement value at 50us resolution, and the remote decoder in eventghost expects 8bit data. The IR Toy gives 16bit data with 21.3333uS resolution. We adjusted down by multiplying by 21.333 then dividing by 50, and just sending an 8bit value. There are probably going to be some shortcomings in this that will have to be worked out, but it's enough to get started and find out what happens next.

Next I'd like to work on getting support in LIRC. I plan to take the same approach - see if it has UIRT2 support, then hacking that to work with the IR Toy. Just taking a quick look, it seems like there's a few uirt2 related files here:
http://lirc.cvs.sourceforge.net/viewvc/ ... c/daemons/
[/quote]


Yeah, I've been poking around a bit in the source for LIRC as well, from what I see the interesting part is the "driver" folder, which to my eye corresponds to the plugin-folder for WinLIRC.

However I can't find the source for the WinLIRC-plugin that Dukey wrote so I can't say for sure if it will straight up work if the code is just compiled for Linux. If it works that would be the preferred way I'm sure, as that would mean we get true sampling and can make use of the rather excellent support for figuring out protocols that LIRC already has.

/Shadowsoul


Re: IR Toy and lirc on Linux

Reply #20
Quote
Is there any way the plugin could initialize the connection by changing the IRToy clock rate to a rate that would divide evenly into 50 µs?

I believe I added an adjust command for the sampling prescaler, but it goes to 42.6666, etc. I think there's a table on the wiki.
Got a question? Please ask in the forum for the fastest answers.

Re: IR Toy and lirc on Linux

Reply #21
[quote author="ian"]I believe I added an adjust command for the sampling prescaler, but it goes to 42.6666, etc. I think there's a table on the wiki.[/quote]21.3333 µs is better than 50 µs in general, but something like 25 µs or 12.5 µs might survive the LIRC conversion without so much jitter.

Re: IR Toy and lirc on Linux

Reply #22
Just doing a quick update on the docs now I noticed it actually goes the other way. 21.333 is the max timer we can do. The prescaler makes it less, so the next step is 10.6666, etc. Would could also reduce jitter both in signal measurement and any conversions.
http://dangerousprototypes.com/docs/USB ... .280x05.29

I started off preloading a timer on interrupt and counting each 50us period, but it's kind of a pain and not as 'set and forget'.
Got a question? Please ask in the forum for the fastest answers.

Re: IR Toy and lirc on Linux

Reply #23
Hi everyone. I know this post is old, but I am trying to use USB IR Toy on Ubuntu 20.04, and I can not get it to work.
I tryied every step in lank23's tutorial, but I get hang on step 8 "irrecord -H irman -d /dev/ttyUSB0 RemoteXXX.conf", I get error saying I don't have permisions for that device, or/and to check lirc service, but lirc servise is not running.
In the end I could not get it working, and after a day of fiddling, I ordered myself a Flirc USB IR receiver :-)

Nevertheless, I cold not get sense in this tutorial, and was asking if somebody can explain it to me ?

In steps 1 and 2 we stop the current driver and stop the default driver from loading on plug in / boot up, and after that when I plug IR Toy there is no more /dev/ttyUSB0 , but in step 8 we call irrecord with device path /dev/ttyUSB0 which does not exist anymore ?

Can someone explain this to me ?

 

Re: IR Toy and lirc on Linux

Reply #24
What makes you believe that a ten years old document is still valid and meaningful?

Since many years Lirc officially supports IrToy.