Ricerca tra la vecchia roba

Lirc su un Dell Latitude D610

Posted: Marzo 31st, 2007 | Author: | Filed under: General | Commenti disabilitati su Lirc su un Dell Latitude D610

Sul mio bel laptop vi è una piccola discontinuità semitrasparente che un giorno scopro essere una porta infrarossa: buon dio, quante periferiche hanno incorporatie questi maledetti computer! ma come si userà mai: scopro che esistono i progetti LIRC e Irda per far utilizzare al nostro beneamato pinguino la tecnologia infrarossa.

Prima di tutto per poter configurare una periferica del genere bisognerebbe sapere che esiste, nel mio caso è semplice perché la si vede fisicamente ma nel dubbio controllate nel BIOS, dove va abilitata (come nel mio caso) o documentatevi tramite l'infrared howto dove vengono spiegate le vicende storiche e tecniche che adesso non ho tempo di spiegarvi.

Io principalmente descriverò come configurare sul mio FIGHISSIMO portatile (un Dell Latitude D610) la porta infrarossa per usare il telecomando di un banale televisore:  tutti i comandi vanno impartti da root (o usate sudo se ubuntu è la vostra passione) e magari controllate da un'altra console come si comporta il kernel ed il sistema tramite un bel

$ tail -f /var/log/kern.log

e/o

$ tail -f /var/log/sys.log

Quindi i comandi sono 

# modprobe ircomm-tty

e il kernel dovrebbe restituire un messaggio del tipo 

IrComm protocol (Dog Brattli)

poi ancora 

# irattach /dev/ircomm0 -s 

e a questo punto un $ ifconfig dovrebbe mostrarvi la presenza di una nuova interfaccia di rete denominata irda0: nel mio caso si ha

irda0     Link encap:IrLAP  HWaddr 3d:ee:df:0d  
          UP RUNNING NOARP  MTU:2048  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:8
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

Attiviamo il demone che sta in ascolto per eventuali segnali

# lircd –device=/dev/lirc0

#setserial /dev/ttyS1 uart none

#modprobe lirc_sir 

Adesso viene la parte empirica in quanto dovete procurarvi un telecomando (penso vada bene di qualunque tipo) ed usare le utility messe a disposizione per riuscire a ricavare i tasti premuti su di esso e i codici che lirc riuscirà a comprendere: prima di tutto verifichiamo che il segnale venga effettivemente ricevuto e per questo date

# mode2 -d /dev/lirc0

e dovrebbero comparivi (alla pressione dei tasti del telecomando) tanti numerini sulla console preceduti da 'pulse' e qualcos'altro… se non compare niente dovete sincerarvi che effettivamente il telecomando funzioni… a questo punto facciamo sul serio: date il comando

# irrecord -d /dev/lirc0 lird.conf 

e dovrebbe comparirvi una schermata con tutti i cazzi&mazzi del programma

irrecord –  application for recording IR-codes for usage with lirc

Copyright (C) 1998,1999 Christoph Bartelmus(lirc@bartelmus.de)

This program will record the signals from your remote control
and create a config file for lircd.

A proper config file for lircd is maybe the most vital part of this
package, so you should invest some time to create a working config
file
. Although I put a good deal of effort in this program it is often
not possible to automatically recognize all features of a remote
control. Often short-comings of the receiver hardware make it nearly
impossible. If you have problems to create a config file READ THE
DOCUMENTATION of this package, especially section "Adding new remote
controls" for how to get help.

If there already is a remote control of the same brand available at
http://www.lirc.org/remotes/ you might also want to try using such a
remote as a template. The config files already contain all
parameters of the protocol used by remotes of a certain brand and
knowing these parameters makes the job of this program much
easier. There are also template files for the most common protocols
available in the remotes/generic/ directory of the source
distribution of this package. You can use a template files by
providing the path of the file as command line parameter.

Please send the finished config files to <lirc@bartelmus.de> so that I
can make them available to others. Don't forget to put all information
that you can get about the remote control in the header of the file.

Press RETURN to continue.

La fase successiva è la registrazione preliminare dello schema generale (penso io) dell'apparecchio che tenete in mano

Now start pressing buttons on your remote control.

It is very important that you press many different buttons and hold them
down for approximately one second. Each button should generate at least one
dot but in no case more than ten dots of output.
Don't stop pressing buttons until two lines of dots (2×80) have been
generated.

Press RETURN now to start recording.

Il mio consiglio è di premere ordinatamente i tasti uno dopo l'altro evitando di ripeterli (io ho ripetuto la procedura 4 volte prima di ottenere il risultato funzionante); finita questa fase vi viene chiesto di inserire i nomi dei tasti in modo da registrarli singolarmente

Please enter the name for the next button (press to finish recording)
powerdown

Non vi preoccupate di configurare tutti i tasti in una volta sola, potete passare il file appena creato come argomento a irrecord e aggiungerli in seguito; per completezza ecco il mio file che serve per far funzionare il telecomando di questo televisore: un Amstrad Tv 14

# Please make this file available to others
# by sending it to <lirc@bartelmus.de>
#
# this config file was automatically generated
# using lirc-0.8.2-CVS(default) on Sat Mar 31 12:10:06 2007
#
# contributed by
#
# brand:                       lircd.conf
# model no. of remote control:
# devices being controlled by this remote:
#

begin remote

  name  lircd.conf
  bits           13
  flags RC5|CONST_LENGTH
  eps            30
  aeps          100

  one           863   899
  zero          863   899
  plead         869
  gap          113004
  toggle_bit_mask 0x0

      begin codes
          powerdown                0x180C
          1                        0x1001
          2                        0x1802
          3                        0x1003
          4                        0x1804
          5                        0x1005
          6                        0x1806
          7                        0x1007
          8                        0x1808
          9                        0x1009
          0                        0x1800
          vol_down                 0x1811
          vol_up                   0x1010
          prog_up                  0x1820
          prog_down                0x1021
          mute                     0x180D
      end codes

end remote

 


Comments are closed.