Skip to main content
Topic: Linux Lirc (usb_irtoy driver) device stops responding (Read 14464 times) previous topic - next topic

Re: Linux Lirc (usb_irtoy driver) device stops responding

Reply #15
[quote author="Barf"]I tried the GIT Lirc (master branch) and the included IrToy driver for sending. Slammed 100 irsend commands (without delay, with full debugging turned on)  to it -- no problems. Not even being  root was necessary. (Full debugging (--loglevel=10) is  not really resource friendly either...)[/quote]
Thanks for the heads-up and good to hear it's working for you.

I tried a build from the latest sources, but despite using the same conf file as before it doesn't work. I don't get errors, the toy lights up as normal when trying to send a command, but nothing happens with the device that I'm trying to control.
It always worked in the past with the same device and conf file, be it only for 5-6 times of course.

Did you did anything special when building the latest sources or are doing so when running/using lirc in order to make it work with the toy?

Re: Linux Lirc (usb_irtoy driver) device stops responding

Reply #16
It is really hard to remotely diagnose this. There are a number of things that can go wrong.

The command line I used was

./lircd  --driver  irtoy --nodaemon  --listen  --device=/dev/ttyACM0 --loglevel=10

First of all, start with --loglevel=10 and either --nodaemon or a logfile, and look for errors. If that does not give a clue, I would use IrScrutinizer (on a PC, Linux or Windows) to capture known good signals for your device. Capture all (or some) the commands, and try to  transmit them from the Scrutinizer, all using the 'toy. If that works, generate a lirc configuration file agaiin with the Scrutinizer, and try it with your Lirc setup. If that still does not work, file a bug report at http://sourceforge.net/p/lirc/tickets/ giving as many details as possible.

Re: Linux Lirc (usb_irtoy driver) device stops responding

Reply #17
[quote author="Barf"]It is really hard to remotely diagnose this. There are a number of things that can go wrong.

The command line I used was

./lircd  --driver  irtoy --nodaemon  --listen  --device=/dev/ttyACM0 --loglevel=10[/quote]
Playing with the latest lirc sources brings me back to the initial problem. Only a few attempts work, after that the toy is gone.

The lirc debug output gives me the following on the first failing attempt:
Code: [Select]
lircd: Debug registering local client
lircd: Notice accepted new client on /run/lirc/lircd
lircd: Debug irtoy_getversion: Got version V222
lircd: Debug irtoy_reset: Got protocol S01
lircd: Debug Version hw 2, sw 22, protocol 1
lircd: Info irtoy_found on /dev/ttyACM1
lircd: Debug received command: "SEND_ONCE ENTONE_URC-4021ABA1-006-R KEY_POWER"
lircd: Debug Sending once, msg: SEND_ONCE ENTONE_URC-4021ABA1-006-R KEY_POWER
, args: ENTONE_URC-4021ABA1-006-R KEY_POWER, once: 1
lircd: Debug clearing transmit buffer
lircd: Debug adding to transmit buffer: 2564
lircd: Debug adding to transmit buffer: 917
lircd: Debug adding to transmit buffer: 386
lircd: Debug adding to transmit buffer: 472
lircd: Debug adding to transmit buffer: 386
lircd: Debug adding to transmit buffer: 472
lircd: Debug adding to transmit buffer: 386
lircd: Debug adding to transmit buffer: 944
lircd: Debug adding to transmit buffer: 386
lircd: Debug adding to transmit buffer: 944
lircd: Debug adding to transmit buffer: 1158
lircd: Debug adding to transmit buffer: 472
lircd: Debug adding to transmit buffer: 386
lircd: Debug adding to transmit buffer: 472
lircd: Debug adding to transmit buffer: 386
lircd: Debug adding to transmit buffer: 944
lircd: Debug adding to transmit buffer: 386
lircd: Debug adding to transmit buffer: 472
lircd: Debug adding to transmit buffer: 772
lircd: Debug adding to transmit buffer: 472
lircd: Debug adding to transmit buffer: 386
lircd: Debug adding to transmit buffer: 944
lircd: Debug adding to transmit buffer: 386
lircd: Debug adding to transmit buffer: 472
lircd: Debug adding to transmit buffer: 386
lircd: Debug adding to transmit buffer: 472
lircd: Debug adding to transmit buffer: 386
lircd: Debug adding to transmit buffer: 472
lircd: Debug adding to transmit buffer: 386
lircd: Debug adding to transmit buffer: 472
lircd: Debug adding to transmit buffer: 386
lircd: Debug adding to transmit buffer: 472
lircd: Debug adding to transmit buffer: 772
lircd: Debug adding to transmit buffer: 944
lircd: Debug adding to transmit buffer: 386
lircd: Debug adding to transmit buffer: 472
lircd: Debug adding to transmit buffer: 386
lircd: Debug adding to transmit buffer: 472
lircd: Debug adding to transmit buffer: 386
lircd: Debug adding to transmit buffer: 472
lircd: Debug adding to transmit buffer: 386
lircd: Debug adding to transmit buffer: 472
lircd: Debug adding to transmit buffer: 386
lircd: Debug adding to transmit buffer: 472
lircd: Debug adding to transmit buffer: 386
lircd: Debug adding to transmit buffer: 472
lircd: Debug adding to transmit buffer: 772
lircd: Debug adding to transmit buffer: 472
lircd: Debug adding to transmit buffer: 386
lircd: Debug adding to transmit buffer: 472
lircd: Debug adding to transmit buffer: 386
lircd: Debug transmit buffer ready
lircd: Debug irtoy ready for 0 bytes
lircd: Debug irtoy ready for 2 bytes
lircd: Debug irtoy ready for 0 bytes
lircd: Debug irtoy ready for 58 bytes
lircd: Debug irtoy ready for 0 bytes
lircd: Debug irtoy ready for 6 bytes
lircd: Debug irtoy ready for 0 bytes
lircd: Debug irtoy ready for 57 bytes
lircd: Debug irtoy ready for 0 bytes
lircd: Debug  01 EC

lircd: Error irtoy_send: invalid byte count indicator received: 0F
lircd: Debug Sending error
lircd: Error error processing command: SEND_ONCE ENTONE_URC-4021ABA1-006-R KEY_POWER
lircd: Error transmission failed
lircd: Debug irtoy_raw_rec
lircd: Debug new signal after large space
lircd: Debug readdata 0 1000000
lircd: Debug c1000000
lircd: Debug trying "ENTONE_URC-4021ABA1-006-R" remote
lircd: Debug decode: enter
lircd: Debug <s1000000
lircd: Debug sync
lircd: Debug read_raw 0aff
lircd: Debug read_raw 60053
lircd: Debug readdata 1 60053
lircd: Debug +p60053
lircd: Debug failed on header
lircd: Debug decode: 0
lircd: Debug failed "ENTONE_URC-4021ABA1-006-R" remote
lircd: Debug decoding failed for all remotes
lircd: Info removed client
Judged by the number of issues reported in the forum and the different work-arounds provided (increase process priority, using a USB reset tool, etc.) I personally think it all comes down to either a hardware design flawed or unstable USB firmware. Too bad both don't get any attention any more.

Re: Linux Lirc (usb_irtoy driver) device stops responding

Reply #18
Quote
lircd: Debug irtoy ready for 0 bytes

This does not look sane.

As an experiment to isolate the problem. let me suggest that you try it out with IrScrutinizer (version 1.1.1).  It has a completely different driver. You can import your Lirc configuration, and send it through the 'Toy, for example, 100 times in a row.

You may also try it with AnalysisIR.

 

Re: Linux Lirc (usb_irtoy driver) device stops responding

Reply #19
I had the same errors where connection to usb device fails after number of sent IR signals. I use IrDroid USB stick which is based on irtoy. Nothing worked for me in Raspberry Pi 3. But I finally fixed it, the solution is not trivial and was found here: https://gist.github.com/bullshit/918d74 ... nt-1815751

Basically I took the lircd sources 0.9.4d and updated manually plugins/irtoy.c file, the deal was to increase timeouts:

Code: [Select]
#define IRTOY_TIMEOUT_READYFORDATA 2000000
#define IRTOY_TIMEOUT_FLUSH 20000
#define IRTOY_TIMEOUT_SMODE_ENTER 1000000
#define IRTOY_TIMEOUT_VERSION 1500000

After recompiling and installing lircd everything works great.