Skip to main content

Messages

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.

Messages - Zillode

3
USB Infrared Toy / Re: Linux Lirc (usb_irtoy driver) device stops responding
I fixed it by resetting the device as mentioned by Joker and MattF (http://www.raspberrypi.org/forums/viewt ... 3&p=388543). This also works for devices that are attached to a powered usb hub.


reset-usb.c:
Code: [Select]
#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;
}

make reset-usb
./reset-usb /dev/bus/usb/001/003

Quote
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)."

I wrote a Ruby script that searches for the IRToy device on my raspberry pi and resets it:
Code: [Select]
#!/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}`
}
4
USB Infrared Toy / Re: Raspberry Pi and IRToy v222
1)
Quote
So is there any reliable way to use this in LINUX ?
You can flash it using Linux:
Code: [Select]
$ 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

2)
Quote
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:]
See viewtopic.php?f=29&t=6480 to resolve the issue on Linux

3) For people looking to use IRToy on their raspberry pi as well, you need to apply an IRToy driver patch to the lirc source tree.
Please update the firmware first to the v22 version (see above). Here is how to build LIRC with IRToy support:
Code: [Select]
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

Update /etc/lirc/hardware.conf to with DRIVER="usb_irtoy" and DEVICE="/dev/ttyACM0"
and put your remote config (found on http://lirc.sourceforge.net/remotes/ or self-made) as /etc/lirc/lircd.conf
To test it you can run lirc as a non daemon like this:
Code: [Select]
lircd -n -d /dev/ttyACM0 /etc/lirc/lircd.conf
and then test it (using another terminal):
Code: [Select]
irsend SEND_ONCE <name-remote-as-in-lircd.conf> <name-key-code>
for example: irsend SEND_ONCE Telenet_DB-AD110 KEY_1

have fun!
6
USB Infrared Toy / Re: IRtoy does not have a reply [IRToyRecPlay]
I just tried but experience the same issue with v3 and v4:

Code: [Select]
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

What I did found was that it works sometimes with v5 while sending IR data with a remote:
Code: [Select]
 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.

Then I changed the code of v6 so it skips the sample mode, and now it works.
But it _only_ works if I first run with v5 while sending IR data with a remote when I (re)connect my usb.

If I don't run v5 first, my v6 hangs on:
Code: [Select]
 Opening IR Toy on com14 at 115200bps...
 Current sample timer Resolution: 21.3333us
 Entering Player Mode

So I guess the serial_write of "S" is important for booting, but somehow the serial_read gets stuck because there is no FF or 00 when my device sends it's number?


PS: I'm using IRToyRecPlay because WinLIRC+IRToy doesn't allow me to send raw IR codes. I always get "Send failed"
7
USB Infrared Toy / IRtoy does not have a reply [IRToyRecPlay]
Hi,

Yesterday, after lots of trying I was finally able to record IR codes using the IRToyRecPlay program. Today (after rebooting?) I get the following output both on Recoder v0.05 and v0.06:
Code: [Select]
-------------------------------------------------------------------------

 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

I'm on firmware v9 for the IRToy itself and tested in on my second IRToy (older firmware) and it gives the same output.

Any advice?

( ! ) Fatal error: Uncaught exception 'Elk_Exception' with message 'Please try again. If you come back to this error screen, report the error to an administrator.' in /var/www/dangerousprototypes/forum/sources/database/Db-mysql.class.php on line 696
( ! ) Elk_Exception: Please try again. If you come back to this error screen, report the error to an administrator. in /var/www/dangerousprototypes/forum/sources/database/Db-mysql.class.php on line 696
Call Stack
#TimeMemoryFunctionLocation
10.01452350256session_write_close ( )...(null):0
20.01482481856ElkArte\sources\subs\SessionHandler\DatabaseHandler->write( )...(null):0
30.01482482632Database_MySQL->query( ).../DatabaseHandler.php:119
40.05672621368Database_MySQL->error( ).../Db-mysql.class.php:273