I need to connect in internet with a usb 3g dongle using at commands.
My apn provider is:
APN = tim.br
Username = tim
Password = tim
How can I connect using only at commands? It's possible?
Thanks.
I need to connect in internet with a usb 3g dongle using at commands.
My apn provider is:
APN = tim.br
Username = tim
Password = tim
How can I connect using only at commands? It's possible?
Thanks.
The steps to connect to internet using 3G modem are the following, assuming you will use a serial command which includes two programs: 'chat' for send AT commands to the modem; 'pppd' for managing the data connection and configure a interface that you can use for the IP packet communication.
STEPS:
Put the USB device on modem mode, it is archieved with usb_modswitch, generally its automatic at USB plugging.
Configure the AT comands using a chat script:
# cat /var/usb3g.chat
ABORT 'NO DIAL TONE'
ABORT 'NO ANSWER'
ABORT 'NO CARRIER'
ABORT DELAYED
ABORT 'COMMAND NOT SUPPORT'
SAY 'ola'
'' ''
'' 'ATZ'
SAY 'set APN...\n'
'OK' 'AT+CGDCONT=1,"IP","timbrasil.br"'
SAY 'dialing...\n\n'
'OK' 'ATD*99***1#'
#'OK' 'ATD*99#' # for 2G dialling
'CONNECT' ''
# cat pppd.conf
hide-password
persist
nodetach
lcp-echo-interval 20
lcp-echo-failure 3
holdoff 2
connect-delay 100
noauth
/dev/ttyUSB0
115200
debug
defaultroute
ipcp-accept-local
ipcp-accept-remote
usepeerdns
crtscts
lock
noccp
noipdefault
user tim
password tim
mtu 1490
mru 1490
# disable compression if not getting IP
#novj
connect 'chat -v -t10 -f /var/usb3g.chat'
If you see valid IPs on the output when calling pppd file pppd.conf
, in an network interface called ppp0
, all should be working well.
The above configuration I just tested for TIM Brazil, using a E3131 3G modem, and all worked fine.
Try something like this:-