Antes de qualquer coisa execute o comando lsusb na consola/terminal para ver que dispositivos estão ligados ao PC.
lsusb
--------------------------------------------------------------
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 003: ID 03f0:0324 Hewlett-Packard
Bus 005 Device 002: ID 046d:c016 Logitech, Inc. M-UV69a/HP M-UV96 Optical Wheel Mouse
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
--------------------------------------------------------------
Depois de inserir o dispositivo na porta USB, execute outra vez o lsusb para ver que dispositivo é que apareceu.
lsusb
--------------------------------------------------------------
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 003: ID 03f0:0324 Hewlett-Packard
Bus 005 Device 002: ID 046d:c016 Logitech, Inc. M-UV69a/HP M-UV96 Optical Wheel Mouse
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 004: ID 0af0:4002 Option
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
--------------------------------------------------------------
Reparem que a linha Option é nova e registem os dados hexadecimais que seguem o ID (0af0:4002)
Instalaem o usb-modeswitch:
sudo apt-get install usb-modeswitch
criar o ficheiro usb-modeswitch
vi /etc/usb-modeswitch.conf
ou
nano /etc/usb_modeswitch.conf
insiram no ficheiro os seguintes dados:
--------------------------------------------------------------
DefaultVendor= 0x0af0
DefaultProduct= 0x4002
TargetVendor= 0x0af0
TargetProduct= 0x4002
TargetClass= 0xff
MessageEndpoint=0x1
MessageContent="55534243f8a81c8500000000000006bd000000020000000000000000000000"
ResponseEndpoint=0x1
--------------------------------------------------------------
Certifiquem-se que os campos TargetProduct e TargetClass correspondem aos dados que aparecem a seguir ao ID após a execução do comando lsusb.
De seguida execute o sudo usb_modeswitch
se tiver uma mensagem de erro, a dizer que o dispositivo não foi encontrado, faça outro lsusb e confirme que o ficheiro /etc/usb-modeswitch.conf tem os dados correctos.
Resultado esperado da execução do usb_modeswitch:
--------------------------------------------------------------
Looking for target devices ...
No devices in target mode or class found
Looking for default devices ...
Found default devices (1)
Accessing device 002 on bus 001 ...
Using endpoints 0x01 (out) and 0x01 (in)
Inquiring device details; driver will be detached ...
Looking for active driver ...
OK, driver found ("usb-storage")
OK, driver "usb-storage" detached
SCSI inquiry data (for identification)
-------------------------
Vendor String: ZCMCEL
Model String: HSDPA Modem
Revision String: 2.31
-------------------------
USB description data (for identification)
-------------------------
Manufacturer: MCEL
Product: MCEL
Serial No.: 1234567890ABCDEF
-------------------------
Setting up communication with interface 0 ...
Trying to send the message to endpoint 0x01 ...
OK, message successfully sent
-> Run lsusb to note any changes. Bye.
--------------------------------------------------------------
faça um ls /dev/tty* e veritique se aparecem os dispositivos ttyUSB0, ttyUSB1 e ttyUSB2
se não estiverem presentes os dispositivos supracitados é porque alguma coisa não está correcta.
sudo modprobe usbserial vendor=0x0af0 product=0x4002 (aqui o vendor e product têm de bater certo com o que aparece no lsusb)
--------------------------------------------------------------
tty tty11 tty15 tty19 tty22 tty26 tty3 tty33 tty37 tty40 tty44 tty48 tty51 tty55 tty59 tty62 tty9 ttyS3
tty0 tty12 tty16 tty2 tty23 tty27 tty30 tty34 tty38 tty41 tty45 tty49 tty52 tty56 tty6 tty63 ttyS0 ttyUSB0
tty1 tty13 tty17 tty20 tty24 tty28 tty31 tty35 tty39 tty42 tty46 tty5 tty53 tty57 tty60 tty7 ttyS1 ttyUSB1
tty10 tty14 tty18 tty21 tty25 tty29 tty32 tty36 tty4 tty43 tty47 tty50 tty54 tty58 tty61 tty8 ttyS2 ttyUSB2--------------------------------------------------------------
Instale o comgt
faça o download do comgt do Sourceforge em http://sourceforge.net/projects/comgt e siga as instruções para a instalação em http://www.pharscape.org/comgt.html
o comgt é NECESSÁRIO e não apenas se o PIN estiver activado no cartão SIM (nós desactivamos o PIN do cartão usado).
depois de instalado o comgt, execute sudo comgt -d /dev/ttyUSB2
Deverá aparecer algo como:
--------------------------------------------------------------
SIM ready
Waiting for Registration..(120 sec max).....
Registered on Home network: "MOZ - mCel",0
Signal Quality: 27,99
--------------------------------------------------------------
depois experimente executar:
sudo pon MCel
The file /etc/ppp/peers/mcel does not exist. Please create it or use
a command line argument to use another file in the /etc/ppp/peers/ directory.
isto acontece porque a ligação PPP ainda não foi configurada, para isso execute:
sudo pppconfig
e aparecerá um menú azul com opções de configuração, crie uma nova ligação com os seguintes dados:
Provider Name: MCel
Configure Nameservers (DNS): Dynamic DNS
Authentication Method: CHAP
User Name: guest
Password: guest
Speed: 115200
Pulse or Tone: Tone
Phone Number: *99#
Choose Modem Config Method: No
Manually Select Modem Port: /dev/ttyUSB2
depois seleccionem as opções :
Finished - Write files and return to Main Menu.
Quit - Exit this Utility
depois execute o comando:
sudo pon MCel
para começar a ligação PPP. Depois de executar o comando, verifique se a interface ppp apareceu, executando:
ifconfig
--------------------------------------------------------------
eth1 Link encap:Ethernet HWaddr 00:19:bb:dd:32:50
inet6 addr: fe80::219:bbff:fedd:3250/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:949636 errors:0 dropped:0 overruns:0 frame:0
TX packets:673026 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:1145597379 (1.1 GB) TX bytes:443045480 (443.0 MB)
Memory:f0500000-f0520000
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:143 errors:0 dropped:0 overruns:0 frame:0
TX packets:143 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:12304 (12.3 KB) TX bytes:12304 (12.3 KB)
ppp0 Link encap:Point-to-Point Protocol
inet addr:10.32.109.60 P-t-P:10.64.64.64 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1
RX packets:7 errors:0 dropped:0 overruns:0 frame:0
TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:3
RX bytes:118 (118.0 B) TX bytes:157 (157.0 B)
--------------------------------------------------------------
Finalmente, podem experimentar fazer um ping ao google a ver se há resposta.
ping www.google.com
--------------------------------------------------------------
PING www.l.google.com (216.239.59.103) 56(84) bytes of data.
64 bytes from gv-in-f103.1e100.net (216.239.59.103): icmp_seq=1 ttl=51 time=610 ms
64 bytes from gv-in-f103.1e100.net (216.239.59.103): icmp_seq=2 ttl=51 time=570 ms
64 bytes from gv-in-f103.1e100.net (216.239.59.103): icmp_seq=3 ttl=51 time=595 ms
64 bytes from gv-in-f103.1e100.net (216.239.59.103): icmp_seq=4 ttl=51 time=590 ms
--- www.l.google.com ping statistics ---
6 packets transmitted, 4 received, 33% packet loss, time 4999ms
rtt min/avg/max/mdev = 570.316/591.789/610.027/14.269 ms
--------------------------------------------------------------
No comments:
Post a Comment