Autor Tópico: Receptor infravermelho - como ativar a com1 ?  (Lida 11929 vezes)

Offline cholletao

  • Usuário Ubuntu
  • *
  • Mensagens: 117
    • Ver perfil
Receptor infravermelho - como ativar a com1 ?
« Online: 08 de Outubro de 2008, 01:22 »
Olá
Dei uma pesquisada e não achei nenhuma solução para isso. Comprei um receptor infravermelho para contole remoto, como já indicado em outro tópico, mas sem explicar o procedimento. Comprei este: http://produto.mercadolivre.com.br/MLB-79934229-receptor-de-controle-remoto-p-pc-serial-15m-c-led-_JM

O vendedor falou que o procedimento para instalar no linux era o presente neste site:
http://www.ir2pc.com/inst/e_linux.php  A partir do passo 3.

 Vou colar aqui:

3. Installation of libirman (IR-2-serial and IR-2-usb)

First extract the files from the libirman package:

gunzip libirman_0.4.2.tar.gz
tar -xf libirman_0.4.2.tar

Now change to the libirman-directory

cd libirman_0.4.2

Configure, compile and install libirman

./configure
make
make install

Now execute ldconfig

ldconfig

Note: To execute "make install" and "ldconfig" superuser-rights are neccessary. Before executing these commands, login as user "root". From the commandline simply use the command "su".

4. Test of your ir2pc with libirman

Execute from within the directory "libirman_0.4.2" the program "test_io". "test_io" needs as only parameter the name of the serial port, your ir2pc is connected to. On linux systems the serial ports are named "/dev/ttySX", where X is the number of the port (0 for the first serial port , 1 for the second and so on). If your ir2pc is connected to the second serial port of your PC, execute "test_io" this way:

./test_io /dev/ttyS1

If the given serial port is correct and your ir2pc is connected properly, the following two lines should appear on you screen:

IR
OK

Now take you remote control and press some keys. For every keypress "test_io" should print a line, that looks like this one:

[5b][40][00][00][00][00]

If you see these lines, your ir2pc is working under Linux. Congratulations! Now stop "test_io" by pressing the keys CTRL + C.

Note 1: Please remind the name of the serial port, your ir2pc is connected to. You need this one for the installation of lirc.

Note 2: If "test_io" only shows "IR" after the start, choose another serial port or check the connection of ir2pc to your PC.

Note 3: Due to the layout of the USB-module, the ir2pc can only be initialized once on the USB bus. Every additional attempt will fail, unless you unplugged and plugged your ir2pc again. Since all programs (e.g. "test_io") won't work, if the initialization failed, you have to unplug and plug again your ir2pc before using them a second time _or_ disable the init-code (see the forum for help on this).

Note 4: If your ir2pc seems to react too slow on key-presses, please change the following line in "irman.h" (from the libirman-directory):

#define IR_POLL_TIMEOUT (1 MSEC)

Change the value from 1 msec to 50 msec. After this change the line should look like this:

#define IR_POLL_TIMEOUT (50 MSEC)

Please recompile and reinstall libirman after this change with "make clean; make; make install;". (This problem occured _only_ with the USB version)
5. LIRC installation (IR-2-serial and IR-2-usb)

Extract the files of the lirc-package and change to the lirc-directory:

gunzip lirc-0.6.6.tar.gz
tar -xf lirc-0.6.6.tar
cd lirc-0.6.6

Start the lirc-"Setup":

./configure

You should see now a menu with different options. Please choose item 1 "Driver configuration" and then item 4 "Other serial port devices" and finally item 6 "Irman / UIR".

Now lirc will ask you for the name of the serial port, your ir2pc is connected to. Please select the port , you tested successfully with "test_io". In item 2 of the "setup" "Software configuration" you can select some additional options of lirc. If you don't want to do this, just select item 3 "Save configuration und run ./configure".

To compile and install lirc, execute:

make
make install

6. Configuration of lirc and your ir2pc

To work with your IR-receiver and your remote control lirc needs a configuration file, which describes the remote control you want to use with lirc. This file says lirc what keys to use and what meanings the different keys possess. Since libirman doesn't work with the lirc-program "irrecord", which is used normally to create this configuration-file, we have to use a workaround to create the lircd.conf for ir2pc.

7. Creation of lircd.conf

In the "contrib"-directory of your lirc-directory you will find a perl-script called "irman2lirc". "irman2lirc" normally should be used to convert a libirman-configurationfile to the lirc-format. But we will use it, to create the base for our lircd.conf. With:

./irman2lirc > /etc/lircd.conf

you create this base-file named "lircd.conf" in the etc-directory. (You are free to choose another name than "lircd.conf" or save the file in a different directory.) To adapt this file to the needs of ir2pc and your remote control, it is recommended to open two consoles. If there is no X installed on your system, that's no problem: change the lircd.conf in two steps.
To get the codes of your remote control start again "test_io" from the libirman-directory. Press all keys of your remote control you want to use with lirc . Please note the output of "test_io" for every key (or edit lircd.conf in parallel).
Now start the text editor of your choise and load the configuration-file you have created with "irman2lirc". You will easily see the two main parts of this file: The common remote-control configuration on top of the file and the key-assigments at the end of the file. Please don't change the common configuration on top of the file. Exception: If you want to use more than on remote control, adapt the remote control name, which is always "irman" in the original file.
In the lower part (between "begin codes" and "end codes") "irman2lirc" already added a lot of keys. But we don't need these, except one single entry. This entry is the base for the keys of your own remote control.
Now add such an entry (line) for every key of your remote control. First there is the name of the key in this line (e.g. Pause, Stop, Play, 0,1,2,... ) and second there is the key data. This data starts always with a "0x". This is only to inform lirc, what data format is used. After this "0x" there are 16 characters (0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F), which represent the real data of a remote control key.
Because the data of a key contains 16 characters, but "test_io" sends only 12 characters per key, the first 4 characters after the "0x" have to be always 0. Afther this the 12 charaters of "test_io" follow.
Adapt now the configuration file to your remote control by creating such a line for every remote control key, changing the name of the key and entering the output of "test_io" after the keyname.
If you are ready with this, the worst part of the lirc-installation is done.

Note 1: Always use different names for different keys on remote control. Otherwise programs, that should use lirc, won't recognize clearly what key of the remote control was pressed.

Note 2: If you want to use more than one remote control with ir2pc and lirc, copy the complete content of the configuration file to the end of the file. Change the name of the remote control for this copy and the names and the data for the keys.

Note 3: If libirman was not installed, irman2lirc doesn't work since it is not able to find the irman.conf. In this case just give the path of the irman.conf file (from the libirman directory) to irman2lirc:

./irman2lirc /path/to/irman.conf > /etc/lircd.conf

8. Testing lircd.conf

To test the new lirc configuration file, the program "lircd" (the lirc daemon) should be started first. "lircd" is located after a default installation in /usr/local/sbin. If you have � as recommended � created the configuration file as "/etc/lircd.conf", start lircd like this:

/usr/local/sbin/lircd

If you configuration file is located in another directory or has got a different name start lircd as follows:

/usr/local/sbin/lircd /path/to/you/config/yourlircd.conf

You can stop lircd with:

killall lircd

After starting lircd, start the program "irw". "irw" outputs for every received IR code a single line:

irw
ffff5B4000000000 00 1 irman
ffff5B4000000000 00 2 irman
ffff5B4000000000 00 3 irman

Here you see, that the keys 1,2 und 3 of the remote control named irman have been pressed. If irw outputs such data, you did it! Your ir2pc is running with lirc.


Mas logo no passo 3, quando chego na parte de digitar "make", acontece este erro:

alexandre@alexandre-ubuntu:~/libirman-0.4.2$ sudo make
[sudo] password for alexandre:
gcc -I.  -DHAVE_CONFIG_H -g -O2 -c chunk.c -o chunk.o
chunk.c: Na função ‘ch_malloc’:
chunk.c:125: erro: lvalue required as left operand of assignment
make: ** [chunk.o] Erro 1
alexandre@alexandre-ubuntu:~/libirman-0.4.2$



Alguém sabe como resolver isso? Obrigado

« Última modificação: 09 de Outubro de 2008, 19:39 por cholletao »
Ubuntu user # 17886

Linux Registered user # 455957

Offline cholletao

  • Usuário Ubuntu
  • *
  • Mensagens: 117
    • Ver perfil
Re: Receptor infravermelho para controle remoto
« Resposta #1 Online: 08 de Outubro de 2008, 19:47 »
ninguem??
Ubuntu user # 17886

Linux Registered user # 455957

Offline Tota

  • Usuário Ubuntu
  • *
  • Mensagens: 14.982
    • Ver perfil
Re: Receptor infravermelho para controle remoto
« Resposta #2 Online: 08 de Outubro de 2008, 20:11 »
Ola, cholletao

Dê uma olhada no Gerenciador de pacotes synaptic e procure os arquivos

libirman-dev 0.4.4-2
lirc 0.8.3

Isto vai levar voce direto ao passo 4.
Citar
4. Test of your ir2pc with libirman

Veja se resolve para voce.

[],s

Offline cholletao

  • Usuário Ubuntu
  • *
  • Mensagens: 117
    • Ver perfil
Re: Receptor infravermelho para controle remoto
« Resposta #3 Online: 08 de Outubro de 2008, 21:29 »
olá tota,
td bem?
pois é, eu nesse exato instante acabei de fazer isso hehe..
so que no passo 4, ele pede para executar um comando de dentro da pasta do lirc, para testar..  como instalou pelo synaptic, em qual pasta foi instalado?



Ola, cholletao

Dê uma olhada no Gerenciador de pacotes synaptic e procure os arquivos

libirman-dev 0.4.4-2
lirc 0.8.3

Isto vai levar voce direto ao passo 4.
Citar
4. Test of your ir2pc with libirman

Veja se resolve para voce.

[],s

Ubuntu user # 17886

Linux Registered user # 455957

Offline cholletao

  • Usuário Ubuntu
  • *
  • Mensagens: 117
    • Ver perfil
Re: Receptor infravermelho para controle remoto
« Resposta #4 Online: 08 de Outubro de 2008, 23:46 »
instalei isso e nao funcionou. resolvi testar o do tutorial, mas o vendedor me mandou outra versao do libirman... e deu tudo ok.. só nao sei em que porta serial que está o receptor.. existe algum comando para saber, como tem para usb (lsusb)  ?

porque quando tento:

alexandre@alexandre-ubuntu:~/libirman-0.4.4$ ./test_io /dev/ttyS0
unable to open port `/dev/ttyS0' (Input/output error)


dá isso. tentei com todos os ttyS...
« Última modificação: 09 de Outubro de 2008, 01:02 por cholletao »
Ubuntu user # 17886

Linux Registered user # 455957

Offline cholletao

  • Usuário Ubuntu
  • *
  • Mensagens: 117
    • Ver perfil
Re: Receptor infravermelho para controle remoto
« Resposta #5 Online: 09 de Outubro de 2008, 00:33 »
tentei isso aqui, mas acho q nao detectou nada conectado nas portas.. minha placa mae so tem uma, que é onde está o receptor


alexandre@alexandre-ubuntu:~$ cat /proc/devices |grep -y ttyS
  4 ttyS

alexandre@alexandre-ubuntu:~$ setserial /dev/ttyS0
/dev/ttyS0, UART: unknown, Port: 0x03f8, IRQ: 4
alexandre@alexandre-ubuntu:~$ setserial /dev/ttyS1
/dev/ttyS1, UART: unknown, Port: 0x02f8, IRQ: 3
alexandre@alexandre-ubuntu:~$ setserial /dev/ttyS2
/dev/ttyS2, UART: unknown, Port: 0x03e8, IRQ: 4
alexandre@alexandre-ubuntu:~$ setserial /dev/ttyS3
/dev/ttyS3, UART: unknown, Port: 0x02e8, IRQ: 3
Ubuntu user # 17886

Linux Registered user # 455957

Offline Tota

  • Usuário Ubuntu
  • *
  • Mensagens: 14.982
    • Ver perfil
Re: Receptor infravermelho para controle remoto
« Resposta #6 Online: 09 de Outubro de 2008, 18:08 »
Bem vamos do começo.

utilize o comando
Código: [Selecionar]
sudo lspci -vv
Ele vai listar os dispositivos pci correntes na máquina

Por ex.:

Citar
02:08.0 Ethernet controller: Intel Corporation 82801DB PRO/100 VE (MOB) Ethernet Controller (rev 83)
   Subsystem: Sony Corporation Unknown device 818d
   Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV+ VGASnoop- ParErr- Stepping- SERR- FastB2B-
   Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR-
   Latency: 66 (2000ns min, 14000ns max), Cache Line Size: 64 bytes
   Interrupt: pin A routed to IRQ 9
   Region 0: Memory at e0205000 (32-bit, non-prefetchable) [size=4K]
   Region 1: I/O ports at 3000 [size=64]
   Capabilities: [dc] Power Management version 2
      Flags: PMEClk- DSI+ D1+ D2+ AuxCurrent=0mA PME(D0+,D1+,D2+,D3hot+,D3cold+)
      Status: D0 PME-Enable- DSel=0 DScale=2 PME-

esta é a minha placa de rede.
O que é necessário anotar na sua IRed:

Interrupt ( no meu caso IRQ9 )
Memory ( no meu caso 0x5000 )
I/O ports ( no meu caso 0x300 )

Se ela não possuir estes parâmetros, o modulo ( driver ) responsável por ela não foi adicionado ao kernel.

poste aqui e vamos ver.

[],s

Offline cholletao

  • Usuário Ubuntu
  • *
  • Mensagens: 117
    • Ver perfil
Re: Receptor infravermelho para controle remoto
« Resposta #7 Online: 09 de Outubro de 2008, 18:45 »
obrigado pela ajuda
seria isso:

00:07.0 Bridge: nVidia Corporation MCP61 Ethernet (rev a2)

   Subsystem: Elitegroup Computer Systems Unknown device 2602

   Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-

   Status: Cap+ 66MHz+ UDF- FastB2B+ ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR-

   Latency: 0 (250ns min, 5000ns max)

   Interrupt: pin A routed to IRQ 220

   Region 0: Memory at fe02d000 (32-bit, non-prefetchable) [size=4K]

   Region 1: I/O ports at ec00 [size=8]

   Capabilities: [44] Power Management version 2

      Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=0mA PME(D0+,D1+,D2+,D3hot+,D3cold+)

      Status: D0 PME-Enable+ DSel=0 DScale=0 PME-

   Capabilities: [50] Message Signalled Interrupts: Mask+ 64bit+ Queue=0/3 Enable+

      Address: 00000000fee0300c  Data: 41e9

      Masking: 000000fe  Pending: 00000000

   Capabilities: [6c] HyperTransport: MSI Mapping


?
« Última modificação: 09 de Outubro de 2008, 18:52 por cholletao »
Ubuntu user # 17886

Linux Registered user # 455957

Offline cholletao

  • Usuário Ubuntu
  • *
  • Mensagens: 117
    • Ver perfil
Re: Receptor infravermelho para controle remoto
« Resposta #8 Online: 09 de Outubro de 2008, 18:53 »
aff, nao sei pq ficou tao grande a 2a parte, e nao consigo diminuir ???
Ubuntu user # 17886

Linux Registered user # 455957

Offline Tota

  • Usuário Ubuntu
  • *
  • Mensagens: 14.982
    • Ver perfil
Re: Receptor infravermelho para controle remoto
« Resposta #9 Online: 09 de Outubro de 2008, 19:02 »
Não esquenta, fica assim mesmo em todos os topicos onde se colam estes resultados.

Copie só o referente à sua placa infra vermelha.

[],s

Offline cholletao

  • Usuário Ubuntu
  • *
  • Mensagens: 117
    • Ver perfil
Re: Receptor infravermelho para controle remoto
« Resposta #10 Online: 09 de Outubro de 2008, 19:03 »
ok, vou procurar aqui agora.
ela tem algo especifico que seja de facil identificacao?
Ubuntu user # 17886

Linux Registered user # 455957

Offline cholletao

  • Usuário Ubuntu
  • *
  • Mensagens: 117
    • Ver perfil
Re: Receptor infravermelho para controle remoto
« Resposta #11 Online: 09 de Outubro de 2008, 19:07 »
é, nao tem nada que fale dela.
tanto porque ela é daquelas caseiras e por isso que o vendedor mandou aquele link "manual"
Ubuntu user # 17886

Linux Registered user # 455957

Offline cholletao

  • Usuário Ubuntu
  • *
  • Mensagens: 117
    • Ver perfil
Re: Receptor infravermelho para controle remoto
« Resposta #12 Online: 09 de Outubro de 2008, 19:11 »
so os que tem sao:

00:00.0 RAM memory: nVidia Corporation MCP61 Memory Controller (rev a1)
00:01.0 ISA bridge: nVidia Corporation MCP61 LPC Bridge (rev a2)
00:01.2 RAM memory: nVidia Corporation MCP61 Memory Controller (rev a2)
00:02.0 USB Controller: nVidia Corporation MCP61 USB Controller (rev a2) (prog-if 10 [OHCI])
00:02.1 USB Controller: nVidia Corporation MCP61 USB Controller (rev a2) (prog-if 20 [EHCI])
00:04.0 PCI bridge: nVidia Corporation MCP61 PCI bridge (rev a1) (prog-if 01 [Subtractive
00:05.0 Audio device: nVidia Corporation MCP61 High Definition Audio (rev a2)
00:06.0 IDE interface: nVidia Corporation MCP61 IDE (rev a2) (prog-if 8a [Master SecP PriP])
00:07.0 Bridge: nVidia Corporation MCP61 Ethernet (rev a2)
00:08.0 IDE interface: nVidia Corporation MCP61 SATA Controller (rev a2) (prog-if 85 [Master SecO PriO])
00:09.0 PCI bridge: nVidia Corporation MCP61 PCI Express bridge (rev a2) (prog-if 00 [Normal decode])
00:0b.0 PCI bridge: nVidia Corporation MCP61 PCI Express bridge (rev a2) (prog-if 00 [Normal decode])
00:0c.0 PCI bridge: nVidia Corporation MCP61 PCI Express bridge (rev a2) (prog-if 00 [Normal decode])
00:0d.0 VGA compatible controller: nVidia Corporation GeForce 6100 nForce 405 (rev a2) (prog-if 00 [VGA controller])
00:18.0 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] HyperTransport Technology Configuration
00:18.1 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] Address Map
   Control: I/O- Mem- BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-
00:18.2 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] DRAM Controller
   Control: I/O- Mem- BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-
00:18.3 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] Miscellaneous Control

Ubuntu user # 17886

Linux Registered user # 455957

Offline cholletao

  • Usuário Ubuntu
  • *
  • Mensagens: 117
    • Ver perfil
Re: Receptor infravermelho para controle remoto
« Resposta #13 Online: 09 de Outubro de 2008, 19:13 »
lembrando que nao é placa infra vermelha, é um plug só, como os usb, mas via porta serial ao invés se usb..
http://produto.mercadolivre.com.br/MLB-79934229-receptor-de-controle-remoto-p-pc-serial-15m-c-led-_JM
Ubuntu user # 17886

Linux Registered user # 455957

Offline Tota

  • Usuário Ubuntu
  • *
  • Mensagens: 14.982
    • Ver perfil
Re: Receptor infravermelho para controle remoto
« Resposta #14 Online: 09 de Outubro de 2008, 19:29 »
Desculpas cara, tou te metendo numa roubada...

Eu estava acessando do meu celular, e só agora pude ir no mercado livre para ver sua placa. Eu pensava que era uma PCI. ;D

Esqueça lspci.

Bem, agora temos duas possibilidades.

Veja na configuração de sua BIOS quais e quantas portas seriais voce tem.

Se voce estiver usando a com1 ( normalmente a do mouse serial nos Pc's antigos) /dev/ttyS0, UART: unknown, Port: 0x03f8, IRQ: 4

voce terá que "criar " a conexão como dito nas instruções e provavelmente vai ter que criar um link simbólico para a placa.

Para adiantar, teremos que editar o arquivo modules ( /etc/modules) e criar a porta.

(Eu posso postar isto quando chegar em casa para voce testar)( +/- lá pelas 21:30h )

Enquanto isto, vá no primeiro post do seu tópico e edite ele do tipo: => Receptor infravermelho - como ativar a com1

Isto pode chamar a atenção de outros do Forum porque até agora só apareci eu, o que, neste forum não é comum.
 
[],