diff options
Diffstat (limited to 'src/SW/usb-ir-toy-lirc')
-rw-r--r-- | src/SW/usb-ir-toy-lirc/.gitignore | 2 | ||||
-rw-r--r-- | src/SW/usb-ir-toy-lirc/document.en.rest.txt | 108 | ||||
-rw-r--r-- | src/SW/usb-ir-toy-lirc/document.it.rest.txt | 111 | ||||
l--------- | src/SW/usb-ir-toy-lirc/du2html.xsl | 1 |
4 files changed, 222 insertions, 0 deletions
diff --git a/src/SW/usb-ir-toy-lirc/.gitignore b/src/SW/usb-ir-toy-lirc/.gitignore new file mode 100644 index 0000000..08d33d4 --- /dev/null +++ b/src/SW/usb-ir-toy-lirc/.gitignore @@ -0,0 +1,2 @@ +/document.en.du.xml +/document.it.du.xml diff --git a/src/SW/usb-ir-toy-lirc/document.en.rest.txt b/src/SW/usb-ir-toy-lirc/document.en.rest.txt new file mode 100644 index 0000000..9f7169e --- /dev/null +++ b/src/SW/usb-ir-toy-lirc/document.en.rest.txt @@ -0,0 +1,108 @@ +============================== +Using the USB IR Toy with LIRC +============================== +:CreationDate: 2012-10-08 10:49:07 +:Id: SW/usb-ir-toy-lirc +:tags: - software + - configs + +So I got myself a `programmable remote control in the shape of Eleven's +sonic screwdriver <http://thewandcompany.com/sonic/>`_ (sorry, +horrible in-accessible website). Of course I want to control my PC +with it! + +To do that, I needed a IR receiver and `LIRC +<http://www.lirc.org/>`_. Since I sometimes like being overly generic, +I bought `Dangerous Prototypes <http://dangerousprototypes.com/>`_ +`USB Infrared Toy +<http://dangerousprototypes.com/docs/USB_Infrared_Toy>`_, which allows +me to send & receive any kind of IR pulse stream. + +Getting the three pieces (remote, toy, LIRC) to play together was more +effort than I'd really liked, so here's what I did, to help everybody +else. + +Flash a newer firmware +====================== + +Your IR Toy is probably running an old version of the firmware. If +you're running Windows, the `instructions provided +<http://dangerousprototypes.com/docs/USB_IR_Toy_firmware_update>`_ may +work; otherwise, you have to dig deeper. The source code for the +``fw_update`` program that you can get from those pages (or from `the +Subversion repository +<http://dangerous-prototypes-open-hardware.googlecode.com/svn/trunk/Bootloaders/USB-HID-Diolan/18F24J50/fw_update/>`_) +does not even compile (it "forgets" to include half the header files +it needs), and when you get it to compile it segfaults. User +"JessH" of the Dangerous Prototypes forums `posted a working version +<http://dangerousprototypes.com/forum/viewtopic.php?t=3697&p=37398#p37371>`_ +(`here's the patch <JessH.patch>`_ if you want to see it, it should +apply to the SVN version). + +.. note:: + + Yes, I know I'm pointing at the updater source for the 18F24J50, but + the chip on the actual IR Toy says "18F2550". What can I say, it + works! + +Having compiled it, I was able to update the firmware to version 22:: + + $ 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 + +Unplug, re-plug, and we're set. + +Patching LIRC +============= + +LIRC can use the IR Toy in ``irman`` compatibility mode, but I needed +full send capability, to program the sonic screwdriver. I found `a +patch to add full support +<http://sourceforge.net/mailarchive/forum.php?thread_name=4ebf97df-17f8-48bb-ba65-32e4b9983ac4%40devleno&forum_name=lirc-list>`_, +thanks to Peter Kooiman. If you're running Gentoo, you can add `my +overlay <http://www.thenautilus.net/cgit/gentoo-overlay/>`_ and +install `my patched LIRC +<http://www.thenautilus.net/cgit/gentoo-overlay/tree/app-misc/lirc/>`_. + +Configuring LIRC +================ + +This may well be written down somewhere, but I had problems finding a +useful guide, so I'll just show what I did: + +1) get a full Philips RC-5 code list from `the LIRC remotes repository + <http://lirc.sourceforge.net/remotes/rc-5/>`_ + +2) assign, arbitrarily, the first 39 codes to the 13 gestures on 3 + memory banks of the screwdriver:: + + begin remote + name sonic + # snip + begin codes + b1_tap_top 0x1000 + b1_tap_left 0x1001 + #etc etc + +Programming the remote +====================== + +I wrote `a simple Perl program to send the IR codes <send>`_. Run it +with ``lircd`` running and ``irsend`` in your path. When it say +``Ready to send $something``, press "enter" to send it, ``a`` to go +back to the previous code (useful if the screwdriver didn't get it), +``n`` to go the next code without sending anything. + +I put the screwdriver in programming mode, performed all 39 gestures +one after the other, and programmed all of them. LIRC now uses +sensible names for the 39 gestures. + +Using it +======== + +Finally, I re-compiled `vlc <http://www.videolan.org/>`_ with LIRC +support, and wrote `a |lircrc| for vlc <lircrc>`_. With that, I can +control ``vlc`` with my sonic screwdriver! + +.. |lircrc| replace:: ``~/.lircrc`` diff --git a/src/SW/usb-ir-toy-lirc/document.it.rest.txt b/src/SW/usb-ir-toy-lirc/document.it.rest.txt new file mode 100644 index 0000000..953bd22 --- /dev/null +++ b/src/SW/usb-ir-toy-lirc/document.it.rest.txt @@ -0,0 +1,111 @@ +================================= +Come usare lo USB IR Toy con LIRC +================================= +:CreationDate: 2012-10-08 10:49:07 +:Id: SW/usb-ir-toy-lirc +:tags: - software + - configs + +Mi son comprato un `telecomando universale a forma di cacciavite +sonico <http://thewandcompany.com/sonic/>`_ (il sito è orrendo e +difficile da navigare…). Chiaramente voglio poterci controllare il mio +PC! + +Per farlo, mi serviva un ricevitore IR e `LIRC +<http://www.lirc.org/>`_. Visto che mi piace complicarmi la vita, ho +comprato lo `USB Infrared Toy +<http://dangerousprototypes.com/docs/USB_Infrared_Toy>`_ da `Dangerous +Prototypes <http://dangerousprototypes.com/>`_, che permette di +inviare e ricevere qualsiasi sequenza di impulsi a infrarossi. + +Convincere i tre pezzi (telecomando, Toy, LIRC) a funzionare assieme è +stato più complicato di quel che avrei gradito, per cui descrivo qua +quel che ho fatto, per aiutare i prossimi. + +Aggiornare il firmware +====================== + +Il vostro IR Top ha probabilmente una versione vecchia del +firmware. Se usate Windows, le `instruzioni fornite +<http://dangerousprototypes.com/docs/USB_IR_Toy_firmware_update>`_ +potrebbero anche funzionare; altrimenti, bisogna studiarci un po'. I +sorgenti del programma ``fw_update`` che potete ottenere da quelle +pagine (o dal `repository Subversion +<http://dangerous-prototypes-open-hardware.googlecode.com/svn/trunk/Bootloaders/USB-HID-Diolan/18F24J50/fw_update/>`_) +non compilano neppure (si sono "scordati" di includere metà degli +header che servono), e quando riuscite a compilarli, vanno in +segfault. L'utente "JessH" dei forum di Dangerous Prototypes `ha +postato una versione che funziona +<http://dangerousprototypes.com/forum/viewtopic.php?t=3697&p=37398#p37371>`_ +(`questa è la patch <JessH.patch>`_ se la volete vedere, dovrebbe +applicarsi alla versione SVN). + +.. note:: + + Sì, lo so che sto puntando ai sorgenti per il 18F24J50, ma il chip + sul IR Toy dice "18F2550". Che ci posso fare, così funziona! + +Dopo averlo compilato, sono finalmente riuscito ad aggiornare il +firmware alla versione 22:: + + $ 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 + +Stacca, ri-attacca, e siamo pronti. + +Patch per LIRC +============== + +LIRC può usare lo IR Toy in modalità compatibile ``irman``, ma a me +serviva la funzione completa di invio segnali, per programmare il +cacciavite. Ho trovato `una patch per aggiungere il supporto completo +<http://sourceforge.net/mailarchive/forum.php?thread_name=4ebf97df-17f8-48bb-ba65-32e4b9983ac4%40devleno&forum_name=lirc-list>`_, +grazie a Peter Kooiman. Se usate Gentoo, potete aggiungere `la mia +overlay <http://www.thenautilus.net/cgit/gentoo-overlay/>`_ e +installare `LIRC già modificato +<http://www.thenautilus.net/cgit/gentoo-overlay/tree/app-misc/lirc/>`_. + +Configurare LIRC +================ + +Questo dovrebbe essere scritto da qualche parte, ma non sono riuscito +a trovare usa spiegazione usabile, per cui mostro quel che ho fatto: + +1) mi son procurato un set completo di codici Philips RC-5 dal + `repository di telecomandi LIRC + <http://lirc.sourceforge.net/remotes/rc-5/>`_ + +2) ho assegnato, arbitrariamente, i primi 39 codici ai 13 gesti su 3 + banchi di memoria del cacciavite:: + + begin remote + name sonic + # snip + begin codes + b1_tap_top 0x1000 + b1_tap_left 0x1001 + #etc etc + +Programmare il telecomando +========================== + +Ho scritto `un semplice programma Perl per inviare i codici IR +<send>`_. Eseguitelo mentre ``lircd`` è in esecuzione, e con +``irsend`` nel path. Quando dice ``Ready to send $something``, premete +"enter" per inviare il codice, ``a`` per tornare al codice precedente +(utile se il cacciavite non l'ha ricevuto), ``n`` per saltare al +codice successivo senza inviare nulla. + +Ho messo il cacciavite in modalità programmazione, ho eseguito i 39 +gesti uno alla volta, e li ho programmati tutti. LIRC ora usa nomi +sensati per tutti e 39 i gesti. + +Usarlo +====== + +Finalmente, ho ri-compilato `vlc <http://www.videolan.org/>`_ col +supporto LIRC, e ho scritto `un |lircrc| per vlc <lircrc>`_. A questo +punto, posso controllare ``vlc`` col cacciavite sonico! + +.. |lircrc| replace:: ``~/.lircrc`` diff --git a/src/SW/usb-ir-toy-lirc/du2html.xsl b/src/SW/usb-ir-toy-lirc/du2html.xsl new file mode 120000 index 0000000..e2487e0 --- /dev/null +++ b/src/SW/usb-ir-toy-lirc/du2html.xsl @@ -0,0 +1 @@ +../../../templates/du2html.xsl
\ No newline at end of file |