4

I am using a USB IR Toy v2 and using this excellent https://github.com/crleblanc/PyIrToy python library to get it working after failing to get things going with LIRC. However, while it works once, repeated usage results in failure because of some sort of "buffer underrun" as detailed by the developer here https://github.com/crleblanc/PyIrToy/issues/2. Since the only solution seems is to perform a replug, can't we use a dirty hack of programatically reset (equivalent to manual unplugging and replugging) the /dev/ttyACM0 device.

2 Answers 2

5

I had an error with a printer doing this occationally. I found an answer back then on an Ubuntu (also Debian basded) forum.

$ cc usbreset.c -o usbreset
$ lsusb
Bus 002 Device 003: ID 0fe9:9010 DVICO
$ chmod +x usbreset
$ sudo ./usbreset /dev/bus/usb/002/003
4
  • 2
    where did you get usbreset.c from?
    – lenik
    Commented Jul 15, 2013 at 21:40
  • I already tried that but it errors : ./usbreset /sys/bus/usb/devices/1-1.3/ Error opening output file: Is a directory Or ` ./usbreset /dev/ttyACM0 Resetting USB device /dev/ttyACM0 Error in ioctl: Invalid argument `
    – EnjoyThePi
    Commented Jul 16, 2013 at 2:43
  • 1
    @lenik you can get usbreset from - marc.info/?l=linux-usb&m=121459435621262&w=2
    – EnjoyThePi
    Commented Jul 16, 2013 at 2:47
  • Looks like they beat me to it. That's exactly where I got it from.
    – Jacobm001
    Commented Jul 16, 2013 at 14:54
1
#!/usr/bin/python
from usb.core import find as finddev
dev = finddev(idVendor=0x1234, idProduct=0x5678)
dev.reset()
1
  • 1
    In future do not post duplicate answers the system flags these and they will be deleted. Rather you should flag the older one as a duplicate and a moderator will close one and link to the other. Commented Dec 25, 2016 at 22:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.