1
USB Infrared Toy / Re: Linux Lirc (usb_irtoy driver) device stops responding
However, in combination with the dwc_otg.speed=1 flag (viewtopic.php?f=29&t=6655#p58854) I don't have issues with my two IRToys and raspberry pi.
Open Source Hardware
This section allows you to view all Messages made by this member. Note that you can only see Messages made in areas you currently have access to.
#include <stdio.h>
#include <fcntl.h>
#include <errno.h>
#include <sys/ioctl.h>
#include <linux/usbdevice_fs.h>
void main(int argc, char **argv)
{
const char *filename;
int fd;
if (argc != 2) return;
filename = argv[1];
fd = open(filename, O_WRONLY);
ioctl(fd, USBDEVFS_RESET, 0);
close(fd);
return;
}
The usage is usbreset /dev/bus/usb/XXX/YYY where XXX is the bus number (nearly always 001 on the Pi) and YYY is the device number (get both of these from lsusb)."
#!/usr/bin/env ruby
usbs = `find /dev/bus/`
usbs.each_line { |usb|
next unless usb.include?("/001/") # Try to disable this line if it does not find it
ls = `lsusb -D #{usb}`
next unless ls.include?("04d8:fd08")
`./reset-usb #{usb}`
}
So is there any reliable way to use this in LINUX ?You can flash it using Linux:
$ echo '$' > /dev/ttyACM0
$ ./fw_update -e -w -v -m all -vid 0x04D8 -pid 0xFD0B
-ix ~/src/dangerous-prototypes-open-hardware/USB_IR_Toy/package/firmware/USBIRToy.v22.hex
Wow, nobody is here. Anyways, the problem seems that the device goes into debug mode after some time of inactivity (or some other reason) and needs a replug to get working again.[s:]The suspend issue is potentially related to https://plus.google.com/116960357493251 ... Zpndv4BCCD as mentioned by https://github.com/crleblanc/PyIrToy/is ... t-23082822[/s:]
git clone git://git.code.sf.net/p/lirc/git lirc-git
cd lirc-git
wget http://sourceforge.net/p/lirc/mailman/attachment/21c85705-1915-414f-87a6-785b61842b30%40devleno/2/ -O 0002-Add-USB-Infrared-Toy-driver-to-setup-system.patch.gz
zcat 0002-Add-USB-Infrared-Toy-driver-to-setup-system.patch.gz | patch -p1
./autogen.sh
./configure --with-driver=usb_irtoy --without-x --with-tty=/dev/ttyACM0
sudo make install
lircd -n -d /dev/ttyACM0 /etc/lirc/lircd.confand then test it (using another terminal):
irsend SEND_ONCE <name-remote-as-in-lircd.conf> <name-key-code>
for example: irsend SEND_ONCE Telenet_DB-AD110 KEY_1
irtoy -d com14 -p -a 0 -f IR-Codes/automan-on-off
-------------------------------------------------------------------------
IR TOY Recorder/Player utility v0.032 (CC-0)
http://dangerousprototypes.com
-------------------------------------------------------------------------
Opening IR Toy on com14 at 115200bps...
Entering IR sample mode ....
Error: IR Toy doesn't have a reply
Done
Opening IR Toy on com14 at 115200bps...
Entering IR sample mode ....
IR Toy Protocol version: S 0 1 ▼ ♫ ♦
♦ ♀ ı ↓ I ↓ I ↓ ↑ ↓ ↨
↓ ↑ ↓ I ↓ ↑ ↓ I ↓ I → ↨ ↓
I ↓ ↑ ↓ ↨ ↓ I ↓ ↑ ↓ ↑ ↑ ♥ ¶ ↓
I ↓ I ↓ ↑ ↓ ↨ ↓ ↨ ↓ I ↓ ↑
↓ I ↓ I ↓ ↑ ↓ I ↓ ↑ ↓ ↑ ↓
I ↓ ↑ ↓ ↨ ↓ ♥ ¶ ↓ I ↓ H ↓ ↑ ↓
↑ ↓ ↑ ↓ I ↓ ↑ ↓ I ↓ I ↓ ↑
↓ I ↓ ↑ ↓ ↨ ↓ I ↓ ↑ ↓ ↨ ↓ ♥
¶ ↓ I ↓ I ↓ ↑ ↓ ↑ ↓ ↨
Recording started.....
Press a button on the remote.
Opening IR Toy on com14 at 115200bps...
Current sample timer Resolution: 21.3333us
Entering Player Mode
-------------------------------------------------------------------------
IR TOY Recorder/Player utility v0.06 (CC-0)
http://dangerousprototypes.com
-------------------------------------------------------------------------
Opening IR Toy on com14 at 115200bps...
Current sample timer Resolution: 21.3333us
Entering IR sample mode .... Done.
Entering IR sample mode .... Done.
Entering IR sample mode .... Done.
Entering IR sample mode .... Done.
Entering IR sample mode .... Done.
Entering IR sample mode .... Done.
Error: IR Toy doesn't have a reply