USB IRToy v2




Firmware update

switch to bootloader mode

dpavlin@blue:~$ microcom -p /dev/ttyACM0 
connected to /dev/ttyACM0
Escape character: Ctrl-\
Type the escape character followed by c to get to the menu or q to quit
# press v to get version
V212
# press $ to go into bootloader mode
exiting

flash new bootloader

http://blog.rot13.org/2013/04/usb-ir-toy---pic-18f2550-fw-update-under-linux.html

https://github.com/dpavlin/fw_update

dpavlin@blue:/blue/IR_Toy_v2/fw_update$ sudo ./fw_update  -e -w -v -m flash -vid 0x04d8 -pid 0xfd0b -ix /blue/IR_Toy_v2/USB_IR_Toy/package/firmware/USBIRToy.v22.hex
U2IO flash erasing: DONE.
U2IO flash programming: DONE.
U2IO flash verifying: DONE.
RESET Device
Operation successfully completed.

use

https://github.com/myshen/IRToyRecPlay

record

dpavlin@blue:/blue/IR_Toy_v2/IRToyRecPlay$ ./IRToy -d /dev/ttyACM0 -f lg-power -r -v 1 
+-----------------------------------------+
|IR Toy Recorder/Player utility v21 (CC-0)|
|http://dangerousprototypes.com           |
+-----------------------------------------+
Opening IR Toy on /dev/ttyACM0 at 115200bps...
opening serial port /dev/ttyACM0
Setting up serial port...
Initializing IR Toy...
Asking for firmware version...(0/2)...wrote v...
Firmware version: V222
Entering IRs sample mode...(0/2)...wrote S...
IRs sampler version: S01
Current sample timer resolution: 21.3333us
binary mode
Recording at Resolution= 21.333300us
Recording started.
Press a button on the remote or any key to exit... 
got 512 bytes9E01 D300 1600 1D00 1600 1D00 1500 5200 1600 1D00 1500 1D00 1600 1D00 1500 1D00 1500 1D00 1500 5100 1700 
 5200 1500 1D00 1500 5200 1600 5000 1700 5200 1600 5100 1700 5100 1700 1D00 1500 1D00 1500 1E00 1500 5200 1500 1D00 1600
 1D00 1500 1E00 1500 1E00 1500 5200 1600 5200 1500 5200 1600 1D00 1600 5100 1600 5100 1700 5200 1600 5200 1600 F208 9E01
 D300 1600 1D00 1500 1D00 1500 5100 1700 1D00 1500 1D00 1500 1E00 1500 1D00 1600 1D00 1500 5200 1600 5100 1600 1D00 1500
 5200 1700 5100 1600 5100 1600 5100 1600 5200 1600 1D00 1500 1E00 1500 1D00 1500 5200 1600 1D00 1500 1D00 1500 1D00 1500
 1E00 1500 5200 1600 5100 1700 5100 1600 1D00 1500 5200 1600 5200 1600 5100 1700 5100 1600 6B07 9E01 6C00 1700 D012 9E01
 D200 1700 1D00 1500 1D00 1500 5200 1600 1D00 1500 1D00 1500 1D00 1500 1E00 1500 1E00 1500 5200 1600 5200 1600 1D00 1500
 5200 1600 5100 1600 5100 1600 5200 1600 5100 1600 1D00 1600 1D00 1500 1E00 1500 5200 1600 1D00 1500 1D00 1600 1D00 1500
 1E00 1500 5200 1600 5100 1600 5200 1600 1D00 1500 5200 1600 5200 1600 5100 1600 5200 1600 6B07 9E01 6D00 1600 970A 9F01
 D300 1600 1D00 1500 1D00 1600 5100 1700 1D00 1600 1D00 1500 1D00 1500 1E00 1500 1D00 1500 5200 1600 5100 1600 1D00 1600
 5100 1600 5200 1600 5100 1600 5100 1600 5200 1600 1D00 1500 1D00 1500 1D00 1500 5200 1600 1D00 
got 54 bytes1500 1E00 1500 1D00 1500 1E00 1500 5200 1600 5200 1500 5200 1700 1C00 1600 5100 1700 5100 1600 5200 1600 5100
 1600 6B07 9E01 6D00 1600 got 2 bytesFFFF 
Captured command.
Creating file: lg-power_000.bin
Press a button on the remote or any key to exit... 

Recording finished.
shutting down...wait for serial port to clear...done.

play

To have it work reliably you have to turn off autosuspend of usb devices, see http://dangerousprototypes.com/forum/viewtopic.php?f=29&t=3336

echo "options usbcore autosuspend=-1" > /etc/modprobe.d/irtoy.conf

And then play recorded codes with:

dpavlin@blue:/blue/IR_Toy_v2/IRToyRecPlay$ ./IRToy -d /dev/ttyACM0 -f lg-power -p -v 1