Logo Hardware.com.br
Equipe GdH
Equipe GdH Geek Moderador
3.5K Mensagens 82 Curtidas

Tutorial: 3G com modems USB Huawei 220/226 e E156, e Aiko 82D no Linux

#1 Por Equipe GdH 12/11/2008 - 21:07
ImagemTutorial: 3G com modems USB Huawei 220/226 e E156, e Aiko 82D no Linux

A compatibilidade dos modems 3G USB no Linux é foco de dúvidas freqüentes. Alguns usuários conseguem conectar sem praticamente nenhum esforço, enquanto outros tem dificuldades ou simplesmente desistem antes de conseguirem conectar. O objetivo deste tutorial é desmistificar o tema e mostrar como ativar os modems mesmo em distribuições antigas, onde eles não são detectados automaticamente.
Carlos E. Morimoto
12/11/2008

https://www.hardware.com.br/tutoriais/3g-linux/
dogui_bnu
dogui_bnu Novo Membro Registrado
17 Mensagens 0 Curtidas
#3 Por dogui_bnu
13/11/2008 - 08:54
Olá Amigos e equipe GDH.

Possuo o MD300 sony ericson. Já fiz umas milhares de vezes desde o zero a configurações que os famosos Blogs do Petry - http://blog.mdpetry.net/ e do Pretto's - http://laudecioliveira.org/blog/?p=70 tratam do assunto e muitas pessoas já tiverem sucesso.
Estou mais ou menos uns 2 meses em cima disso. Já tentei no Ubuntu 8.04., 8.10 (que dizem ter maior suporte ao wi-fi, fiquei na mesma) e hoje estou no Mandriva 2009. Então, estou entre comunidades Ubuntu e Mandriva. Tenho que agradecer a todos pelo help e paciência pois, muita gente não sabe mais o que me dizer, porque com essas configurações grande maioria obtiveram sucesso. Eu não sei mais o que fazer mais irei continuar tentando. Se funciona com os outros tem que funcionar por aqui também. Seguirei a dica do Morimoto que mostrou coisas um pouco diferentes.

Abaixo segue meu wvdial (Mandriva 2009):

[root@localhost douglas]# wvdial
--> WvDial: Internet dialer version 1.60
--> Cannot get information for serial port.
--> Initializing modem.
--> Sending: ATZ
ATZ
OK
--> Sending: AT+CFUN=1
AT+CFUN=1
OK
--> Sending: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
OK
--> Sending: AT+CGDCONT=1,"IP","bandalarga.claro.com.br"
AT+CGDCONT=1,"IP","bandalarga.claro.com.br"
OK
--> Modem initialized.
--> Sending: ATDT*99***1#
--> Waiting for carrier.
ATDT*99***1#
~[7f]}#@!}!}!} }9}#}%B#}%}(}"}'}"}"}&} } } } }%}&rO [02]{[1d]~
CONNECT
--> Carrier detected. Waiting for prompt.
~[7f]}#@!}!}"} }9}#}%B#}%}(}"}'}"}"}&} } } } }%}&rO [02]7p~
--> PPP negotiation detected.
--> Starting pppd at Thu Nov 13 08:50:25 2008
--> Pid of pppd: 25835
--> Using interface ppp0
--> pppd: Connect: ppp0 <--> /dev/ttyACM0
--> pppd: Warning - secret file /etc/ppp/pap-secrets has world and/or group access
--> pppd: Warning - secret file /etc/ppp/chap-secrets has world and/or group access
--> pppd: CHAP authentication succeeded: Congratulations!
--> pppd: CHAP authentication succeeded
--> pppd: LCP terminated by peer
--> pppd: Modem hangup
--> pppd: Connection terminated.
--> Disconnecting at Thu Nov 13 08:50:27 2008
--> The PPP daemon has died: A modem hung up the phone (exit code = 16)
--> man pppd explains pppd error codes in more detail.
--> Try again and look into /var/log/messages and the wvdial and pppd man pages for more information.
--> Auto Reconnect will be attempted in 5 seconds
--> Cannot get information for serial port.

Se alguém tiver alguma idéia do que possa estar acontecendo fico muito grato pela ajuda.
Abraços a todos e Obrigado!
AlexandreZabot
AlexandreZab... Novo Membro Registrado
2 Mensagens 0 Curtidas
#4 Por AlexandreZab...
15/11/2008 - 11:00
Oi Pessoal/Morimoto,

Vi esta matéria ontem e saí correndo pra Vivo pra comprar o Vivo Zap, pois preciso desesperadamente de internet em casa pra trabalhar.
Mas não funcionou :-(
Mexi nos parâmetros, fucei na net, mas nada.

O modem é o HUAWEI E156 HSDPA USB stick


----------------------------------------------------------------------------
Saída do wvdial 3g:

gauss:/home/zabot # wvdial 3g
--> WvDial: Internet dialer version 1.60
--> Cannot get information for serial port.
--> Initializing modem.
--> Sending: ATZ
ATZ
OK
--> Sending: ATQ0 V1 E1 S0=0 &C1 &D2
ATQ0 V1 E1 S0=0 &C1 &D2
OK
--> Sending: AT+CGDCONT=1,"IP","zap.vivo.com.br"
AT+CGDCONT=1,"IP","zap.vivo.com.br"
OK
--> Modem initialized.
--> Sending: ATDT*99#
--> Waiting for carrier.
ATDT*99#
CONNECT
--> Carrier detected. Starting PPP immediately.
--> Starting pppd at Sat Nov 15 10:27:15 2008
--> Pid of pppd: 22064
--> Using interface ppp0
--> pppd: ������[06][08]��[06][08]
--> pppd: ������[06][08]��[06][08]
--> pppd: ������[06][08]��[06][08]
--> pppd: ������[06][08]��[06][08]
--> local IP address 189.96.201.191
--> pppd: ������[06][08]��[06][08]
--> remote IP address 10.64.64.64
--> pppd: ������[06][08]��[06][08]
--> primary DNS address 200.220.227.101
--> pppd: ������[06][08]��[06][08]
--> secondary DNS address 200.142.130.10
--> pppd: ������[06][08]��[06][08]
--> Script /etc/ppp/ip-up failed (return value: 0xff )
--> pppd: ������[06][08]��[06][08]
^CCaught signal 2: Attempting to exit gracefully...
--> Terminating on signal 15
--> pppd: ������[06][08]��[06][08]
--> Connect time 0.6 minutes.
--> pppd: ������[06][08]��[06][08]
--> pppd: ������[06][08]��[06][08]
--> pppd: ������[06][08]��[06][08]
--> pppd: ������[06][08]��[06][08]
--> Disconnecting at Sat Nov 15 10:27:50 2008



-----------------------------------------------------------------------------
Saída em /var/log/messages

Nov 15 10:27:15 gauss pppd[22064]: Plugin passwordfd.so loaded.
Nov 15 10:27:15 gauss pppd[22064]: pppd 2.4.4 started by root, uid 0
Nov 15 10:27:15 gauss pppd[22064]: Using interface ppp0
Nov 15 10:27:15 gauss pppd[22064]: Connect: ppp0 <--> /dev/ttyUSB0
Nov 15 10:27:15 gauss pppd[22064]: PAP authentication succeeded
Nov 15 10:27:17 gauss pppd[22064]: Could not determine remote IP address: defaulting to 10.64.64.64
Nov 15 10:27:17 gauss pppd[22064]: local IP address 189.96.201.191
Nov 15 10:27:17 gauss pppd[22064]: remote IP address 10.64.64.64
Nov 15 10:27:17 gauss pppd[22064]: primary DNS address 200.220.227.101
Nov 15 10:27:17 gauss pppd[22064]: secondary DNS address 200.142.130.10
Nov 15 10:27:17 gauss pppd[22104]: Can't execute /etc/ppp/ip-up: Exec format error
Nov 15 10:27:17 gauss pppd[22064]: Script /etc/ppp/ip-up finished (pid 22104), status = 0xff
Nov 15 10:27:50 gauss pppd[22064]: Terminating on signal 15
Nov 15 10:27:50 gauss pppd[22064]: Connect time 0.6 minutes.
Nov 15 10:27:50 gauss pppd[22064]: Sent 0 bytes, received 0 bytes.
Nov 15 10:27:50 gauss pppd[22064]: Connection terminated.
Nov 15 10:27:50 gauss pppd[22660]: Can't execute /etc/ppp/ip-down: Exec format error
Nov 15 10:27:50 gauss pppd[22064]: Script /etc/ppp/ip-down finished (pid 22660), status = 0xff
Nov 15 10:27:50 gauss pppd[22064]: Exit.



-----------------------------------------------------------------------------
Meu Sistema:

Alexandre>uname -a
Linux gauss 2.6.25.18-0.2-pae #1 SMP 2008-10-21 16:30:26 +0200 i686 athlon i386 GNU/Linux
Alexandre>more /etc/SuSE-release
openSUSE 11.0 (i586)
VERSION = 11.0

Acer Aspire 5050


-----------------------------------------------------------------------------
Arquivo de configuração wvdial.conf:

[Dialer 3g]
Modem = /dev/ttyUSB0
Baud = 921600
DialCommand = ATDT
Check Def Route = on
FlowControl = Hardware(CRTSCTS)
Username = vivo
Password = vivo
Phone = *99#
Stupid mode = 1
Auto Reconnect = on
Auto DNS = on
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2
Init3 = AT+CGDCONT=1,"IP","zap.vivo.com.br"
ISDN = 0
Modem Type = Analog Modem

(se tiro o init3 não muda nada)

-----------------------------------------------------------------------------
Arquivo /etc/ppp/options

# /etc/ppp/options
#
# Not every option is listed here, see man pppd for more details. This file
# is read by the pppd, it is an error when it is not present.
#
# Use the following command to see the active options:
# grep -v ^# /etc/ppp/options | grep -v ^$
#

# The name of this server. Often, the FQDN is used here.
#name

# Enforce the use of the hostname as the name of the local system for
# authentication purposes (overrides the name option).
#usehostname

# If no local IP address is given, pppd will use the first IP address
# that belongs to the local hostname. If "noipdefault" is given, this
# is disabled and the peer will have to supply an IP address.
noipdefault

# With this option, pppd will accept the peer's idea of our local IP
# address, even if the local IP address was specified in an option.
#ipcp-accept-local

# With this option, pppd will accept the peer's idea of its (remote) IP
# address, even if the remote IP address was specified in an option.
#ipcp-accept-remote

# Run the executable or shell command specified after pppd has terminated
# the link. This script could, for example, issue commands to the modem
# to cause it to hang up if hardware modem control signals were not
# available.
# If mgetty is running, it will reset the modem anyway. So there is no need
# to do it here.
#disconnect "chat -- \d+++\d\c OK ath0 OK"

# Increase debugging level (same as -d). The debug output is written
# to syslog LOG_LOCAL2.
#debug

# Enable debugging code in the kernel-level PPP driver. The argument n
# is a number which is the sum of the following values: 1 to enable
# general debug messages, 2 to request that the contents of received
# packets be printed, and 4 to request that the contents of transmitted
# packets be printed.
#kdebug n

# noauth means do not require the peer to authenticate itself, this must
# be set if you want to use pppd to connect to the internet. In this case
# *you* must authenicate yourself to the peer(internet provider), so do
# not disable this setting unless you are the dial-in server which where
# the peer has to autenticate to.
noauth

# Use hardware flow control (i.e. RTS/CTS) to control the flow of data
# on the serial port.
crtscts

# Specifies that pppd should use a UUCP-style lock on the serial device
# to ensure exclusive access to the device.
lock

# Use the modem control lines.(is default)
modem
# The opposite: local
#
# Description:
# Don't use the modem control lines. With this option, pppd will ignore the
# state of the CD (Carrier Detect) signal from the modem and will not change
# the state of the DTR (Data Terminal Ready) signal.
#
# You need to disable modem and enable local if you want to connect to anoter
# system without using a modem:
#local

# async character map -- 32-bit hex; each bit is a character
# that needs to be escaped for pppd to receive it. 0x00000001
# represents '\x01', and 0x80000000 represents '\x1f'.
# To allow pppd to work over a rlogin/telnet connection, ou should escape
# XON (^Q), XOFF (^S) and ^]: (The peer should use "escape ff".)
#asyncmap 200a0000
asyncmap 0

# needed for some ISDN Terminaladaters, namely ELSA, those seem to have
# problems with asyncmap negotiation, so you can turn off this procedure
# in case your ISDN box has trouble with it, by enabling this option.
# You have to disable the asyncmap option to be sure to have it
# active. If you use wvdial, set the ISDN parameter in /etc/wvdial.conf
# instead.
#default-asyncmap

# Set the MRU [Maximum Receive Unit] value to for negotiation. pppd
# will ask the peer to send packets of no more than bytes. The
# minimum MRU value is 128. The default MRU value is 1500. A value of
# 296 is recommended for slow links (40 bytes for TCP/IP header + 256
# bytes of data). The value 1492 is for DSL connections (PPP Default -
# PPPoE Header: 1500 - 8 = 1492)
# mru 1492

# Set the MTU [Maximum Transmit Unit] value to . Unless the peer
# requests a smaller value via MRU negotiation, pppd will request that
# the kernel networking code send data packets of no more than n bytes
# through the PPP network interface. The value 1492 is for DSL connections
# (PPP Default - PPPoE Header: 1500 - 8 = 1492)
# mtu 1492

# Set the interface netmask to , a 32 bit netmask in "decimal dot"
# notation (e.g. 255.255.255.0).
#netmask 255.255.255.0

# Don't fork to become a background process (otherwise pppd will do so
# if a serial device is specified).
nodetach

# If this option is given, pppd will send an LCP echo-request frame to
# the peer every n seconds. Under Linux, the echo-request is sent when
# no packets have been received from the peer for n seconds. Normally
# the peer should respond to the echo-request by sending an echo-reply.
# This option can be used with the lcp-echo-failure option to detect
# that the peer is no longer connected.
lcp-echo-interval 30

# If this option is given, pppd will presume the peer to be dead if n
# LCP echo-requests are sent without receiving a valid LCP echo-reply.
# If this happens, pppd will terminate the connection. Use of this
# option requires a non-zero value for the lcp-echo-interval parameter.
# This option can be used to enable pppd to terminate after the physical
# connection has been broken (e.g., the modem has hung up) in
# situations where no hardware modem control lines are available.
lcp-echo-failure 4

# Send up to 60 LCP configure-request during negotiation. With a value
# of 2 for lcp-restart below, this might take up to 2 minutes.
lcp-max-configure 60

# Resend unanswered LCP requests after 2 seconds.
lcp-restart 2

# Specifies that pppd should disconnect if the link is idle for n seconds.
idle 600

# Specifies the maximal number of attempts to connect to the server. This
# is useful for dial on demand. Default value is 10.
#maxfail 3

# Disable the IPXCP and IPX protocols.
noipx

# In the file /etc/ppp/filters are some active-filter rules. See man pppd
# and man tcpdump for more informations.
file /etc/ppp/filters

#-------------------------------------------------------------------------
# The next two options are only interesting for you if you are admin of
# a system with other users that use ppp, and those users are normally
# never allowed to add default route, or you do not want users to
# replace the default route.
#-------------------------------------------------------------------------

# enable this to prevent users from attempting to add a default route.
# Use this option with caution: If the user needs to use a program like
# wvdial, he will not be able to connect because wvdial forces defaulroute
# but this is rejected by this option and the user will not be able to
# connect to the internet.
#nodefaultroute

# enable this to prevent users from replacing an existing default route.
#noreplacedefaultroute

#-------------------------------------------------------------------------
# All options below only make sense if you configure pppd to be a dial-in
# server, so don't touch these if you want dial into your provider with
# PPP!
#-------------------------------------------------------------------------

# Set the assumed name of the remote system for authentication purposes
# to .
#remotename

# Add an entry to this system's ARP [Address Resolution Protocol]
# table with the IP address of the peer and the Ethernet address of this
# system. {proxyarp,noproxyarp}
#proxyarp

# Use the system password database for authenticating the peer using
# PAP. Note: mgetty already provides this option. If this is specified
# then dialin from users using a script under Linux to fire up ppp wont work.
#login

# Specify which DNS Servers the incoming Win95 or WinNT Connection should use
# Two Servers can be remotely configured
#ms-dns 192.168.1.1
#ms-dns 192.168.1.2

# Specify which WINS Servers the incoming connection Win95 or WinNT should use
#ms-wins 192.168.1.50
#ms-wins 192.168.1.51

ipcp-max-failure 30
asyncmap 0xa0000
mru 1500
refuse-chap


-----------------------------------------------------------------------------


Desculpem colocar todos os arquivos assim.
Mas é que seria fantástico seu eu conseguisse fazer isso funcionar.
Tenho até hj a tarde (sábado 15/11) pra devolver o modem na loja (período de teste de 1 dia)

Grato,
Alexandre Zabot
Cairo Caplan
Cairo Caplan Novo Membro Registrado
2 Mensagens 0 Curtidas
#5 Por Cairo Caplan
19/11/2008 - 22:07
Olá pessoal,
Custei mas consegui colocar o modem BandLuxe C120, padrão da Oi aqui no Rio, no Kurumin 7. Tive que atualizar o Kernel( talvez no final nem precisa-se se eu tivesse usado os drivers da Huawei) do Kurumin 7 original para o Sidux 2.6.27, só assim esse modem 3G poderia ser reconhecido como tal, assim como os das outras marcas tinham problemas com Kernel anterior ao 2.6.20. E no final usei o script conectar conectar_vivozap (Valeu mesmo!!Imagem).

Mas estou aqui para relatar um problema que aconteceu comigo.

Seguindo o Tutorial de instalação do modem no linux pelo Site da empresa, que usou o Fedora, quanto a localização do modem havia 2 possibilidades:

Usando o comando dmesg no terminal ele mostrava na tela dispositivos conectados ao pc, entre eles:
...
usb 1-2: configuration #1 chosen from 1 choice
option 1-2:1.0: GSM modem (1-port) converter detected
usb 1-2: GSM modem (1-port) converter now attached to ttyUSB0
option 1-2:1.1: GSM modem (1-port) converter detected
usb 1-2: GSM modem (1-port) converter now attached to ttyUSB1
...

Se houvessem 2 localizações para o modem na tela( ttyUSB0, ttyUSB1) você deveria usar ttyUSB0, o script do conectar_vivozap funciona, pois ele acha ttyUSB0 primeiro.

Mas... Se houver 3 localizações para tal modem, assim como no meu PC dessa semana pra cá (ttyUSB0, ttyUSB1,ttyUSB2), deveria-se usar ttyUSB1(!):

...
option 1-2:1.0: GSM modem (1-port) converter detected
usb 1-2: GSM modem (1-port) converter now attached to ttyUSB0
option 1-2:1.1: GSM modem (1-port) converter detected
usb 1-2: GSM modem (1-port) converter now attached to ttyUSB1
option 1-2:1.2: GSM modem (1-port) converter detected
usb 1-2: GSM modem (1-port) converter now attached to ttyUSB2
usb 1-2: New USB device found, idVendor=1a8d, idProduct=1002
usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=20
usb 1-2: Product: BandLuxe 3.5G HSDPA Adapter
usb 1-2: Manufacturer: BandRich, Inc.
...

Aí eu tive que fazer uma gambiarra no script:

o que seria:

elif [ -e "/dev/ttyUSB0" ]; then
echo "Modem encontrado em /dev/ttyUSB0"; sleep 2
porta="/dev/ttyUSB0"
echo 'porta="/dev/ttyUSB0"' >> /home/$USER/.3gconfig

(modem detectado em ttyUSB0 => usar 3gconfig com ttyUSB0)

mudei para:

elif [ -e "/dev/ttyUSB0" ]; then
echo "Modem encontrado em /dev/ttyUSB1"; sleep 2
porta="/dev/ttyUSB1"
echo 'porta="/dev/ttyUSB1"' >> /home/$USER/.3gconfig

(modem detectado em ttyUSB0 => usar 3gconfig com ttyUSB1)

Posso ter falado algo tecnicamente errado aqui, mas o importante é que agora funciona no meu PC...Imagem
steniosilva
steniosilva Novo Membro Registrado
1 Mensagem 0 Curtidas
#6 Por steniosilva
26/11/2008 - 15:45
Olá!

Estou utilizando um Huawei E156 da Vivo.
A distro é Conectiva 10.

O propósito desta mensagem é esclarecer uma falha de conexão após o uso do programa wvdial e contribuir com melhorias para o tutorial.

Segui o tutorial e ao executar o comando wvdial 3g, encontrei problemas durante a conexão.

Acredito que outras pessoas também se depararam com a seguinte situação (ver imagem).

Imagem Anexo do post

A negociação do serviço pppd falhou e retornou erro 10.

Na ocasião, eu estava monitorando o log de mensagens do linux (/var/log/messages) e durante a falha uma mensagem me chamou a atenção (ver imagem).

Imagem Anexo do post

A mensagem é a seguinte:
"IPCP: timeout sending Config-Requests"

Passei a investigar o porque da falha e a associação com o IPCP (Internet Protocol Control Protocol).

Após "rachar a cuca" durante alguns dias, resolvi comentar todos os parâmetros do arquivo /etc/ppp/options.

Ele passou usar a autenticação por CHAP.
Retornei no arquivo options o parâmetro refuse-chap.
Então, ele passou a usar a autenticação por PAP.
Resolvi criar dentro do arquivo options o parâmetro refuse-pap.
Funcionou perfeitamente.

Portanto, aos que se depararam com este tipo de problema.
Basta colocar no final do arquivo /etc/ppp/options, a seguinte linha.

refuse-pap

No final do arquivo options ficará assim:

ipcp-max-failure 30
asyncmap 0xa0000
mru 1500
refuse-chap
refuse-pap

Para quem ainda não sabia, espero ter ajudado.

Saudações,

Stênio Oliveira da Silva

Anexos

henrique.azevedo
henrique.aze... Novo Membro Registrado
1 Mensagem 0 Curtidas
#7 Por henrique.aze...
29/11/2008 - 17:22
Passei o dia tentando instalar o Aiko 82d da vivo no meu pc, que está com o kurumin ng, e não obtive sucesso. tentei segui todas as orientações contidas aqui e mesmo assim não foi possível. Alguém pode me auxiliar? essa é a primeira vez que uso o Linux, por isso estou batendo a cabeça. Espero que alguém possa me dar dica mais direcionada ao meu caso. Grato pela atenção.
standart
standart Novo Membro Registrado
2 Mensagens 0 Curtidas
#8 Por standart
30/11/2008 - 15:46
Olá pessoal, seguindo o script apresentado deu tudo certo, mas estou com com um dilema, precisava criar um script que desconectasse e conectasse novamente. Apenas em caracter de teste fiz o seguinte:

killall -9 wvdial
killall -9 pppd

E logo em seguida tento reconectar, mas dá o seguinte erro:
--> WvDial: Internet dialer version 1.60
--> Cannot get information for serial port.
--> Initializing modem.
--> Sending: ATZ
Caught signal 2: Attempting to exit gracefully...
--> Sending: ATQ0
--> Re-Sending: ATZ
--> Modem not responding.

E não sei como proceder para que o modem volte a ficar disponivel.

Meu sistema operacional é slackware 12.1.

Agradeço a todos
Cairo Caplan
Cairo Caplan Novo Membro Registrado
2 Mensagens 0 Curtidas
#9 Por Cairo Caplan
03/12/2008 - 19:27
standart disse:
Olá pessoal, seguindo o script apresentado deu tudo certo, mas estou com com um dilema, precisava criar um script que desconectasse e conectasse novamente. Apenas em caracter de teste fiz o seguinte:

killall -9 wvdial
killall -9 pppd

E logo em seguida tento reconectar, mas dá o seguinte erro:
--> WvDial: Internet dialer version 1.60
--> Cannot get information for serial port.
--> Initializing modem.
--> Sending: ATZ
Caught signal 2: Attempting to exit gracefully...
--> Sending: ATQ0
--> Re-Sending: ATZ
--> Modem not responding.

E não sei como proceder para que o modem volte a ficar disponivel.

Meu sistema operacional é slackware 12.1.

Agradeço a todos

standart não sei se é esse mesmo o seu problema, mas eu tenho uma solução instala um aplicativo chamado gprsconnect. Para instalar deve ser

apt-get gprsconnect

Por via de dúvidas usa o Synaptics, mas antes de tudo você terá que padronizar sua porta /dev/modem para apontar para o seu modem usb, para isso eu usei o modemlink:

Procura no Synaptics pelo modemlink
Depois de instalado abra o terminal e digite dmesg, procure pela porta do seu modem segundo o meu post anterior, abra o modemlink, escolha o tipo de modem( segunda opção - USB no nosso caso), em seguida aparecerá os nomes das portas em uma lista, procure pela sua segundo dmesg.

Aparecerá um menu dizendo:

Do you want to set the symlink /dev/modem to point to the newly configured device? This is necessary if you want o use the device as modem for kppp, as an example, or for using GPRS (all of these located in the sidux "network configuration" menu).

Create link /dev/modem -> ?

Clique em OK e iremos para a segunda parte, execute o gprsconnect:


Primeiro menu :
Role a barra até a última opção:
=> other : (INIT-String)
Continue

Segundo menu:

Please enter the INIT string for GPRS that you provider recommends(check your documentation):

=>AT+CGDCONT=1,¨IP¨, ¨¨

Que no meu caso é

=>AT+CGDCONT=1,¨IP¨, ¨gprs.oi.com.br¨

Terceiro menu:

Please be aware that surfing the net over GPRS, while not being onlinetime-dependent, can cause high costs for traffic volume, depending on your provider (usually about 1 cent/kB). You can get a detailled statistic about internet traffic in the "Root-Shell" using the program iptraf (on ppp0). Start GPRS Internet Access now?

=>OK

A partir daí aparecerá o shell dizendo o estado da sua conexão:

Por exemplo:

Dec 3 19:00:05 sidux chat[8762]: timeout set to 120 seconds
Dec 3 19:00:05 sidux chat[8762]: abort on (BUSY)
Dec 3 19:00:05 sidux chat[8762]: abort on (ERROR)
Dec 3 19:00:05 sidux chat[8762]: abort on (NO CARRIER)
Dec 3 19:00:05 sidux chat[8762]: send (ATE1^M)
Dec 3 19:00:06 sidux chat[8762]: expect (OK)
Dec 3 19:00:06 sidux chat[8762]: ATE1^M^M
Dec 3 19:00:06 sidux chat[8762]: OK
Dec 3 19:00:06 sidux chat[8762]: -- got it
Dec 3 19:00:06 sidux chat[8762]: send (AT+CGDCONT=1,"IP","gprs.oi.com.br"^M)
Dec 3 19:00:06 sidux chat[8762]: expect (OK)
Dec 3 19:00:06 sidux chat[8762]: ^M
Dec 3 19:00:06 sidux chat[8762]: AT+CGDCONT=1,"IP","gprs.oi.com.br"^M^M
Dec 3 19:00:06 sidux chat[8762]: OK
Dec 3 19:00:06 sidux chat[8762]: -- got it
Dec 3 19:00:06 sidux chat[8762]: send (ATD*99***1#^M)
Dec 3 19:00:06 sidux chat[8762]: expect (CONNECT)
Dec 3 19:00:06 sidux chat[8762]: ^M
Dec 3 19:00:06 sidux chat[8762]: ATD*99***1#^M^M
Dec 3 19:00:06 sidux chat[8762]: CONNECT
Dec 3 19:00:06 sidux chat[8762]: -- got it
Dec 3 19:00:06 sidux chat[8762]: send (\d)
Dec 3 19:00:07 sidux pppd[8742]: Serial connection established.
Dec 3 19:00:07 sidux pppd[8742]: Using interface ppp0
Dec 3 19:00:07 sidux pppd[8742]: Connect: ppp0 <--> /dev/modem
Dec 3 19:00:08 sidux pppd[8742]: PAP authentication succeeded
Dec 3 19:00:11 sidux pppd[8742]: Could not determine remote IP address: defaulting to 10.64.64.64
Dec 3 19:00:11 sidux pppd[8742]: local IP address 10.126.38.102
Dec 3 19:00:11 sidux pppd[8742]: remote IP address 10.64.64.64
Dec 3 19:00:11 sidux pppd[8742]: primary DNS address 200.222.0.34
Dec 3 19:00:11 sidux pppd[8742]: secondary DNS address 200.202.193.75


Aparecerá na barra de tarefas os dois computadores acesos, dizendo o tráfego da sua internet.

Semelhante ao script de conectar internet discada com o slmodemd, você não deverá fechar essa janela, a menos que queira desconectar, que você pode conseguir com o Ctrl-C. A partir daí vocêpode executar o gprsconnect no modo default: (No Change).

Essa etapa do gprsconnect pode ser feita via kppp mas a configuração é bem mais complicada.
standart
standart Novo Membro Registrado
2 Mensagens 0 Curtidas
#10 Por standart
03/12/2008 - 21:57
Olá caro amigo Cairo, agradeço imensamente o seu interesse em ajudar fico extremamente grato pela ajuda, mas no meu caso eu não uso interface grafica essas solucões sao para servidores de servicos que dependem de um certo cuidado, o meu interesse em saber como posso parar um modem e reconectar é exatamente para criar stripts que previnam as quedas.

Se Alguem souber como eu posso parar o wvdial e consegui uma reconexão, eu agradeço.


Abraços


Cairo Caplan disse:
standart não sei se é esse mesmo o seu problema, mas eu tenho uma solução instala um aplicativo chamado gprsconnect. Para instalar deve ser

apt-get gprsconnect

Por via de dúvidas usa o Synaptics, mas antes de tudo você terá que padronizar sua porta /dev/modem para apontar para o seu modem usb, para isso eu usei o modemlink:

Procura no Synaptics pelo modemlink
Depois de instalado abra o terminal e digite dmesg, procure pela porta do seu modem segundo o meu post anterior, abra o modemlink, escolha o tipo de modem( segunda opção - USB no nosso caso), em seguida aparecerá os nomes das portas em uma lista, procure pela sua segundo dmesg.

Aparecerá um menu dizendo:

Do you want to set the symlink /dev/modem to point to the newly configured device? This is necessary if you want o use the device as modem for kppp, as an example, or for using GPRS (all of these located in the sidux "network configuration" menu).

Create link /dev/modem -> ?

Clique em OK e iremos para a segunda parte, execute o gprsconnect:


Primeiro menu :
Role a barra até a última opção:
=> other : (INIT-String)
Continue

Segundo menu:

Please enter the INIT string for GPRS that you provider recommends(check your documentation):

=>AT+CGDCONT=1,¨IP¨, ¨¨

Que no meu caso é

=>AT+CGDCONT=1,¨IP¨, ¨gprs.oi.com.br¨

Terceiro menu:

Please be aware that surfing the net over GPRS, while not being onlinetime-dependent, can cause high costs for traffic volume, depending on your provider (usually about 1 cent/kB). You can get a detailled statistic about internet traffic in the "Root-Shell" using the program iptraf (on ppp0). Start GPRS Internet Access now?

=>OK

A partir daí aparecerá o shell dizendo o estado da sua conexão:

Por exemplo:

Dec 3 19:00:05 sidux chat[8762]: timeout set to 120 seconds
Dec 3 19:00:05 sidux chat[8762]: abort on (BUSY)
Dec 3 19:00:05 sidux chat[8762]: abort on (ERROR)
Dec 3 19:00:05 sidux chat[8762]: abort on (NO CARRIER)
Dec 3 19:00:05 sidux chat[8762]: send (ATE1^M)
Dec 3 19:00:06 sidux chat[8762]: expect (OK)
Dec 3 19:00:06 sidux chat[8762]: ATE1^M^M
Dec 3 19:00:06 sidux chat[8762]: OK
Dec 3 19:00:06 sidux chat[8762]: -- got it
Dec 3 19:00:06 sidux chat[8762]: send (AT+CGDCONT=1,"IP","gprs.oi.com.br"^M)
Dec 3 19:00:06 sidux chat[8762]: expect (OK)
Dec 3 19:00:06 sidux chat[8762]: ^M
Dec 3 19:00:06 sidux chat[8762]: AT+CGDCONT=1,"IP","gprs.oi.com.br"^M^M
Dec 3 19:00:06 sidux chat[8762]: OK
Dec 3 19:00:06 sidux chat[8762]: -- got it
Dec 3 19:00:06 sidux chat[8762]: send (ATD*99***1#^M)
Dec 3 19:00:06 sidux chat[8762]: expect (CONNECT)
Dec 3 19:00:06 sidux chat[8762]: ^M
Dec 3 19:00:06 sidux chat[8762]: ATD*99***1#^M^M
Dec 3 19:00:06 sidux chat[8762]: CONNECT
Dec 3 19:00:06 sidux chat[8762]: -- got it
Dec 3 19:00:06 sidux chat[8762]: send (\d)
Dec 3 19:00:07 sidux pppd[8742]: Serial connection established.
Dec 3 19:00:07 sidux pppd[8742]: Using interface ppp0
Dec 3 19:00:07 sidux pppd[8742]: Connect: ppp0 <--> /dev/modem
Dec 3 19:00:08 sidux pppd[8742]: PAP authentication succeeded
Dec 3 19:00:11 sidux pppd[8742]: Could not determine remote IP address: defaulting to 10.64.64.64
Dec 3 19:00:11 sidux pppd[8742]: local IP address 10.126.38.102
Dec 3 19:00:11 sidux pppd[8742]: remote IP address 10.64.64.64
Dec 3 19:00:11 sidux pppd[8742]: primary DNS address 200.222.0.34
Dec 3 19:00:11 sidux pppd[8742]: secondary DNS address 200.202.193.75


Aparecerá na barra de tarefas os dois computadores acesos, dizendo o tráfego da sua internet.

Semelhante ao script de conectar internet discada com o slmodemd, você não deverá fechar essa janela, a menos que queira desconectar, que você pode conseguir com o Ctrl-C. A partir daí vocêpode executar o gprsconnect no modo default: (No Change).

Essa etapa do gprsconnect pode ser feita via kppp mas a configuração é bem mais complicada.
Camocinense
Camocinense Membro Senior Registrado
216 Mensagens 10 Curtidas
#11 Por Camocinense
04/12/2008 - 00:53
Fala, comunidade. Vocês já testaram o software Smart Connect? Ele foi feito por um brasileiro para configurar automaticamente e com interface gráfica ps modems 3G vendidos pelas operadoras no país. Passo aqui o link para esse maravilhoso programa: http://smartconnect3g.wordpress.com/. Não se esqueçam de ler detalhadamente as instruções de instalação, os comentários dos internautas e os tópicos do fórum. Valeu.
barrosneo
barrosneo Novo Membro Registrado
4 Mensagens 0 Curtidas
#13 Por barrosneo
25/12/2008 - 13:11
E ae galera do forum do GDH, um feliz natal para todos!!, eu estou com um problema com o meu modem ts9989i da siemens, a minha operadora é a amazonia celular, to querendo sair totalmente do ******** e achei o ubuntu 8.10 bom para se iniciar no mundo linux...

peguei um manual do site da amazoniacelular e o meu wvdial ficou assim:


[Dialer 3g]
Init2 = AT+CGATT=1
Abort on No Dialtone = on
Password = celular
Check Def Route = on
Phone = *99***1#
Idle Seconds = 0
Abort on Busy = off
Modem type = USB Modem
Stupid Mode = on
Baud = 460800
Auto DNS = on
Dial Command = ATD
Dial Attempts = 1
Ask Password = off
Init = Init1 = AT+CGDCONT=1,"IP","gprs.amazoniacelular.com.br"
ISDN = off
Username = celular
Carrier Check = on
Auto Reconnect = on
Modem = /dev/ttyACM0

Obs. Após usar o script do conectar vivo zap continuou do mesmo jeito!!


Meu modem re reconhecido normalmente pelo ubuntu 8.10, conforme abaixo:


root@Notebook:/home/elisson# wvdialconf
Editing `/etc/wvdial.conf'.
Scanning your serial ports for a modem.
Modem Port Scan<*1>: S0 S1 S2 S3
WvModem<*1>: Cannot get information for serial port.
ttyACM0<*1>: ATQ0 V1 E1 -- OK
ttyACM0<*1>: ATQ0 V1 E1 Z -- OK
ttyACM0<*1>: ATQ0 V1 E1 S0=0 -- OK
ttyACM0<*1>: ATQ0 V1 E1 S0=0 &C1 -- OK
ttyACM0<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 -- OK
ttyACM0<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 -- OK
ttyACM0<*1>: Modem Identifier: ATI -- SIEMENS
ttyACM0<*1>: Speed 4800: AT -- OK
ttyACM0<*1>: Speed 9600: AT -- OK
ttyACM0<*1>: Speed 19200: AT -- OK
ttyACM0<*1>: Speed 38400: AT -- OK
ttyACM0<*1>: Speed 57600: AT -- OK
ttyACM0<*1>: Speed 115200: AT -- OK
ttyACM0<*1>: Speed 230400: AT -- OK
ttyACM0<*1>: Speed 460800: AT -- OK
ttyACM0<*1>: Max speed is 460800; that should be safe.
ttyACM0<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 – OK



Quando dou o comando (wvdial 3g) fica assim e não conecta na internet!!

root@Notebook:/home/elisson# wvdial 3g
--> WvDial: Internet dialer version 1.60
--> Cannot get information for serial port.
--> Initializing modem.
--> Sending: Init1 = AT+CGDCONT=1,"IP","gprs.amazoniacelular.com.br"
AT+CGDCONT=1,"IP","gprs.amazoniacelular.com.br"
OK
--> Sending: AT+CGATT=1
AT+CGATT=1
OK
--> Modem initialized.
--> Sending: ATD*99***1#
--> Waiting for carrier.
ATD*99***1#
CONNECT
--> Carrier detected. Starting PPP immediately.
--> Starting pppd at Thu Dec 25 11:39:43 2008
--> Pid of pppd: 6257
--> Using interface ppp0
--> pppd: �D� �B�
--> pppd: �D� �B�
--> pppd: �D� �B�
--> pppd: �D� �B�
--> pppd: �D� �B�
--> pppd: �D� �B�
--> pppd: �D� �B�
--> Disconnecting at Thu Dec 25 11:39:50 2008
--> The PPP daemon has died: A modem hung up the phone (exit code = 16)
--> man pppd explains pppd error codes in more detail.
--> Try again and look into /var/log/messages and the wvdial and pppd man pages for more information.
--> Auto Reconnect will be attempted in 5 seconds
--> Cannot get information for serial port.
--> Initializing modem.
--> Sending: Init1 = AT+CGDCONT=1,"IP","gprs.amazoniacelular.com.br"
AT+CGDCONT=1,"IP","gprs.amazoniacelular.com.br"
OK
--> Sending: AT+CGATT=1
AT+CGATT=1
OK
--> Modem initialized.
--> Cannot get information for serial port.
--> Initializing modem.
--> Sending: Init1 = AT+CGDCONT=1,"IP","gprs.amazoniacelular.com.br"
AT+CGDCONT=1,"IP","gprs.amazoniacelular.com.br"
OK
--> Sending: AT+CGATT=1
AT+CGATT=1
OK
--> Modem initialized.
--> Sending: ATD*99***1#
--> Waiting for carrier.
ATD*99***1#
CONNECT
--> Carrier detected. Starting PPP immediately.
--> Starting pppd at Thu Dec 25 11:39:57 2008
--> Pid of pppd: 6299
--> Using interface ppp0
--> pppd: �D� �B�
--> pppd: �D� �B�
--> pppd: �D� �B�
--> pppd: �D� �B�
--> pppd: �D� �B�
--> pppd: �D� �B�
--> pppd: �D� �B�
--> Disconnecting at Thu Dec 25 11:40:01 2008
--> The PPP daemon has died: A modem hung up the phone (exit code = 16)
--> man pppd explains pppd error codes in more detail.
--> Try again and look into /var/log/messages and the wvdial and pppd man pages for more information.
--> Auto Reconnect will be attempted in 10 seconds
--> Cannot get information for serial port.
--> Initializing modem.
--> Sending: Init1 = AT+CGDCONT=1,"IP","gprs.amazoniacelular.com.br"
AT+CGDCONT=1,"IP","gprs.amazoniacelular.com.br"
OK
--> Sending: AT+CGATT=1
AT+CGATT=1
OK
--> Modem initialized.
--> Cannot get information for serial port.
--> Initializing modem.
--> Sending: Init1 = AT+CGDCONT=1,"IP","gprs.amazoniacelular.com.br"
AT+CGDCONT=1,"IP","gprs.amazoniacelular.com.br"
OK
--> Sending: AT+CGATT=1
AT+CGATT=1
OK
--> Modem initialized.
--> Sending: ATD*99***1#
--> Waiting for carrier.
ATD*99***1#
CONNECT
--> Carrier detected. Starting PPP immediately.
--> Starting pppd at Thu Dec 25 11:40:13 2008
--> Pid of pppd: 6314
--> Using interface ppp0
--> pppd: �D� �B�
--> pppd: �D� �B�
--> pppd: �D� �B�
--> pppd: �D� �B�
--> pppd: �D� �B�
--> pppd: �D� �B�
--> pppd: �D� �B�
--> Disconnecting at Thu Dec 25 11:40:44 2008
--> The PPP daemon has died: PPP negotiation failed (exit code = 10)
--> man pppd explains pppd error codes in more detail.
--> I guess that's it for now, exiting
--> The PPP daemon has died. (exit code = 10)



O sinal é detectado só que logo em seguida é desconectado!!

já alterei o (/etc/ppp/options) conforme abaixo, de acordo com uma dica aqui mesmo do forum, e ficou assim:

.Apenas um trecho ao arquivo pois é muito grande!!
.
.
# Packet filtering: for more information, see pppd(8)
# Any packets matching the filter expression will be interpreted as link
# activity, and will cause a "demand" connection to be activated, and reset
# the idle connection timer. (idle option)
# The filter expression is akin to that of tcpdump(1)
#active-filter

ipcp-max-failure 30
asyncmap 0xa0000
mru 1500
refuse-chap
refuse-pap

# ------


Lá em (/var/log/messages) fica assim...

Dec 25 11:45:03 Notebook pppd[6545]: pppd 2.4.4 started by root, uid 0
Dec 25 11:45:03 Notebook pppd[6545]: Using interface ppp0
Dec 25 11:45:03 Notebook pppd[6545]: Connect: ppp0 <--> /dev/ttyACM0
Dec 25 11:45:03 Notebook pppd[6545]: CHAP authentication succeeded: TTP Com PPP - Password Verified OK
Dec 25 11:45:03 Notebook pppd[6545]: CHAP authentication succeeded
Dec 25 11:45:08 Notebook pppd[6545]: LCP terminated by peer (Normal Termination by NCP)
Dec 25 11:45:09 Notebook pppd[6545]: Modem hangup
Dec 25 11:45:09 Notebook pppd[6545]: Connection terminated.
Dec 25 11:45:09 Notebook pppd[6545]: Exit.
Dec 25 11:45:16 Notebook pppd[6556]: pppd 2.4.4 started by root, uid 0
Dec 25 11:45:16 Notebook pppd[6556]: Using interface ppp0
Dec 25 11:45:16 Notebook pppd[6556]: Connect: ppp0 <--> /dev/ttyACM0
Dec 25 11:45:16 Notebook pppd[6556]: CHAP authentication succeeded: TTP Com PPP - Password Verified OK
Dec 25 11:45:16 Notebook pppd[6556]: CHAP authentication succeeded
Dec 25 11:45:20 Notebook pppd[6556]: LCP terminated by peer (Normal Termination by NCP)
Dec 25 11:45:21 Notebook pppd[6556]: Modem hangup
Dec 25 11:45:21 Notebook pppd[6556]: Connection terminated.
Dec 25 11:45:21 Notebook pppd[6556]: Exit.
Dec 25 11:45:33 Notebook pppd[6571]: pppd 2.4.4 started by root, uid 0
Dec 25 11:45:33 Notebook pppd[6571]: Using interface ppp0
Dec 25 11:45:33 Notebook pppd[6571]: Connect: ppp0 <--> /dev/ttyACM0
Dec 25 11:45:33 Notebook pppd[6571]: CHAP authentication succeeded: TTP Com PPP - Password Verified OK
Dec 25 11:45:33 Notebook pppd[6571]: CHAP authentication succeeded
Dec 25 11:46:03 Notebook pppd[6571]: IPCP: timeout sending Config-Requests
Dec 25 11:46:03 Notebook pppd[6571]: Connection terminated.
Dec 25 11:46:03 Notebook pppd[6571]: Exit.



Já vi aki no forum uma dica sobe o IPCP e já alterei conforme a dica... mas não mudou nada, a versão do ubuntu que utilizo agora é o 8.10, mas já testei em outras versões e não conecta também... se alguem poder me ajudar eu agradeço!!!
marcoprimeiro
marcoprimeir... Super Participante Registrado
489 Mensagens 2 Curtidas
#15 Por marcoprimeir...
23/04/2009 - 16:10
Pessoal, se alguem puder dar um help..
segui os passos do tutorial e aparentemente o modem conectou - ele chega a pegar IP, DNSs etc..
mas nao navega..meus browsers ficam paradinhos.

info2:/home/marco# wvdial 3g
--> WvDial: Internet dialer version 1.60
--> Cannot get information for serial port.
--> Initializing modem.
--> Sending: ATZ
ATZ
OK
--> Sending: ATQ0 V1 E1 S0=0 &C1 &D2
ATQ0 V1 E1 S0=0 &C1 &D2
OK
--> Sending: AT+CGDCONT=1,"IP","bandalarga.claro.com.br"
AT+CGDCONT=1,"IP","bandalarga.claro.com.br"
OK
--> Modem initialized.
--> Sending: ATDT*99***1#
--> Waiting for carrier.
ATDT*99***1#
CONNECT
--> Carrier detected. Starting PPP immediately.
--> Starting pppd at Thu Apr 23 16:39:02 2009
--> Pid of pppd: 6387
--> Using interface ppp0
--> pppd: ��� ���
--> pppd: ��� ���
--> pppd: ��� ���
--> pppd: ��� ���
--> pppd: ��� ���
--> pppd: ��� ���
--> pppd: ��� ���
--> local IP address 187.27.218.168
--> pppd: ��� ���
--> remote IP address 10.64.64.64
--> pppd: ��� ���
--> primary DNS address 10.11.12.13
--> pppd: ��� ���
--> secondary DNS address 10.11.12.14
--> pppd: ��� ���



Alguem tem idéia do q pode ser??
Debian testing
Huawei E226
Operadora Claro
© 1999-2024 Hardware.com.br. Todos os direitos reservados.
Imagem do Modal