Using HSDPA modem: Difference between revisions

From Alpine Linux
(category networking. use notes template)
(Reorganizing the page. Removed obsolete information)
Line 1: Line 1:
{{Draft}}
[[Category:Networking]]
[[Category:Networking]]
= General notes =
{{Note|Don't plug in the modem yet! (Wait until document suggest you to plug it in)}}
Notes are based on [http://gentoo-wiki.com/HARDWARE_HUAWEI_E220_HSDPA_USB_MODEM gentoo] wiki<BR>


== Requirements ==
== Requirements ==
At least Alpine-1.7.22 would work (but maybe some older releases too)
This doc is tested on alpine-2.1.3.
* libusb-dev
* ppp
* usbutils


== Check kernel configuration ==
You will need a [http://en.wikipedia.org/wiki/High-Speed_Downlink_Packet_Access HSDPA] USB-modem.<BR>
'''Note:''' Checking kernel config is proably not needed. I just add this note in case you need it in the future.<BR>
Use 'dmesg | less' to figure out which /dev/ttyUSB? it uses ''(you will need to edit below config to reflect this)''.
These checks should result in '=m' values (except CONFIG_USB_SERIAL_GENERIC that should report '=y')
modprobe configs
zcat /proc/config.gz | grep "CONFIG_USB_SERIAL_GENERIC="
zcat /proc/config.gz | grep "CONFIG_USB_SERIAL_OPTION="
zcat /proc/config.gz | grep "CONFIG_PPP="
zcat /proc/config.gz | grep "CONFIG_PPP_ASYNC="


= Install modem =
== Install packages ==
== Install packages ==
Install required packages
Install required packages
apk_add ppp
{{cmd|apk add ppp}}
apk_add libusb-dev
apk_add usbutils


== Prepare ==
== Load modules ==
Now you should ''''plugging in the modem''''
Now let's load the driver ''(using the values you just found out)'' and prepare it to get automatically loaded at next reboot.
{{cmd|modprobe ppp
echo "ppp" >> /etc/modules}}


We need information about the modem
== Configfiles ==
lsusb -v | grep id


The output of previous action could look something like this:<BR>
=== /etc/ppp/peers/E220 ===
'''Note:''' You should take notes on the numbers presented in the output (you would need them soon)
''(The filename 'E220' can be changed to whatever is appropreate for you, but you will need to remember it when running pon/poff command)''
idVendor  0x12d1 Huwei Technologies Co., Ltd.
<pre>debug
idProduct  0x1003 E220 HSDPA Modem
/dev/ttyUSB0
460800
crtscts
modem
noauth
usepeerdns
defaultroute
noipdefault
noccp
nobsdcomp
novj
connect '/usr/sbin/chat -v -f /etc/ppp/chat-E220-pin || /usr/sbin/chat -f /etc/ppp/chat-E220-nopin'
</pre>


== Configure modem ==
=== /etc/ppp/chat-E220-pin ===
Now let's load the driver (using the values you just found out).
''(The filename 'chat-E220-pin' can be changed to whatever is appropreate for you, but you will need modify above configfile to reflect your decition)''
modprobe usbserial vendor=0x12d1 product=0x1003
<pre>ABORT "BUSY"
ABORT "ERROR"
ABORT "NO CARRIER"
REPORT "CONNECT"
TIMEOUT "10"
"" "ATZ"
OK "AT+CPIN={PIN}"
OK AT+CGDCONT=1,"ip","{APN}"
OK "ATE1V1&D2&C1S0=0+IFC=2,2"
OK "AT+IPR=115200"
OK "ATE1"
TIMEOUT "60"
"" "ATD*99***1#"
CONNECT \c
</pre>


Prepare this for next reboot
=== /etc/ppp/chat-E220-nopin ===
echo "options usbserial vendor=0x12d1 product=0x1003" >> /etc/modprobe.d/options
''(The filename 'chat-E220-nopin' can be changed to whatever is appropreate for you, but you will need modify above configfile to reflect your decition)''
<pre>ABORT "BUSY"
ABORT "ERROR"
ABORT "NO CARRIER"
REPORT "CONNECT"
TIMEOUT "10"
"" "ATZ"
OK AT+CGDCONT=1,"ip","{APN}"
OK "ATE1V1&D2&C1S0=0+IFC=2,2"
OK "AT+IPR=115200"
OK "ATE1"
TIMEOUT "60"
"" "ATD*99***1#"
CONNECT \c
</pre>
{{Note|Replace above word '''{PIN}''' with the "PIN" of your card ''(typically a 4 digit code)''}}
{{Note|Replace above word '''{APN}''' with the "Access Point Name" of the service you use ''(for instance mine is "web.omnitel.it")''. If you don't know the Internet APN, ask your service provider}}


== Configure programs ==
{{Warning|Route and DNS is not working. Something is still missing in above config}}
Seems we need to create a missing folder
mkdir -p /etc/ppp/peers
 
=== Create configfiles ===
'''''/etc/ppp/peers/E220'''''
/dev/ttyUSB0
460800
crtscts
modem
noauth
usepeerdns
defaultroute
noipdefault
debug
noccp
nobsdcomp
novj
user "irrelevant"
password "irrelevant"
connect '/usr/sbin/chat -f /etc/ppp/chat-E220-pin || /usr/sbin/chat -f /etc/ppp/chat-E220-nopin'
 
'''''/etc/ppp/chat-E220-pin'''''
ABORT BUSY
ABORT ERROR
ABORT 'NO CARRIER'
REPORT CONNECT
TIMEOUT 10
"" "ATZ"
OK "AT+CPIN='''''pin'''''"
OK AT+CGDCONT=1,"ip","'''''internet'''''"
OK "ATE1V1&D2&C1S0=0+IFC=2,2"
OK "AT+IPR=115200"
OK "ATE1"
TIMEOUT 60
"" "ATD*99***1#"
CONNECT \c
 
'''''/etc/ppp/chat-E220-nopin'''''
ABORT BUSY
ABORT ERROR
ABORT 'NO CARRIER'
REPORT CONNECT
TIMEOUT 10
"" "ATZ"
OK AT+CGDCONT=1,"ip","'''''internet'''''"
OK "ATE1V1&D2&C1S0=0+IFC=2,2"
OK "AT+IPR=115200"
OK "ATE1"
TIMEOUT 60
"" "ATD*99***1#"
CONNECT \c
'''Note:''' The above highlighted word(s) ''''''pin'''''' is the PIN of your card (typically a four digit code)<BR>
'''Note:''' The above highlighted word(s) ''''''internet'''''' is the Access Point Name (APN) of the service you use (for instance mine is "web.omnitel.it"). If you don't know the Internet APN, ask your service provider.<BR>
''<SPAN STYLE='color:red;'>'''FIXME:''' Seems I don't get any dns-server automatically added to /etc/resolv.conf. (Right now the only way I see it is to manually edit 'resolv.conf')</SPAN>''


= Start/Stop=
= Start/Stop=
== Start connection ==
== Start connection ==
pon E220
{{cmd|pon E220}}
== Stop connection ==
== Stop connection ==
poff E220
{{cmd|poff E220}}
= Checks =
 
= If something goes wrong... =
Check if process is running
Check if process is running
ps | grep pppd
{{cmd|pidof pppd}}
Logfile would also give you information on what happened
Logfile might give you a clue on what went wrong
grep pppd /var/log/messages
{{cmd|egrep "pppd{{!}}chat" /var/log/messages}}
Check nic information
Check nic information
ifconfig ppp0
{{cmd|ifconfig ppp0}}
pppd seems to have some pppstats function
pppd has a statusinformation function that could come in handy
pppstats
{{cmd|pppstats}}

Revision as of 11:26, 9 January 2011

This material is work-in-progress ...

Do not follow instructions here until this notice is removed.
(Last edited by Mhavela on 9 Jan 2011.)

Requirements

This doc is tested on alpine-2.1.3.

You will need a HSDPA USB-modem.
Use 'dmesg | less' to figure out which /dev/ttyUSB? it uses (you will need to edit below config to reflect this).

Install packages

Install required packages

apk add ppp

Load modules

Now let's load the driver (using the values you just found out) and prepare it to get automatically loaded at next reboot.

modprobe ppp echo "ppp" >> /etc/modules

Configfiles

/etc/ppp/peers/E220

(The filename 'E220' can be changed to whatever is appropreate for you, but you will need to remember it when running pon/poff command)

debug
/dev/ttyUSB0
460800
crtscts
modem
noauth
usepeerdns
defaultroute
noipdefault
noccp
nobsdcomp
novj
connect '/usr/sbin/chat -v -f /etc/ppp/chat-E220-pin || /usr/sbin/chat -f /etc/ppp/chat-E220-nopin'

/etc/ppp/chat-E220-pin

(The filename 'chat-E220-pin' can be changed to whatever is appropreate for you, but you will need modify above configfile to reflect your decition)

ABORT "BUSY"
ABORT "ERROR"
ABORT "NO CARRIER"
REPORT "CONNECT"
TIMEOUT "10"
"" "ATZ"
OK "AT+CPIN={PIN}"
OK AT+CGDCONT=1,"ip","{APN}"
OK "ATE1V1&D2&C1S0=0+IFC=2,2"
OK "AT+IPR=115200"
OK "ATE1"
TIMEOUT "60"
"" "ATD*99***1#"
CONNECT \c

/etc/ppp/chat-E220-nopin

(The filename 'chat-E220-nopin' can be changed to whatever is appropreate for you, but you will need modify above configfile to reflect your decition)

ABORT "BUSY"
ABORT "ERROR"
ABORT "NO CARRIER"
REPORT "CONNECT"
TIMEOUT "10"
"" "ATZ"
OK AT+CGDCONT=1,"ip","{APN}"
OK "ATE1V1&D2&C1S0=0+IFC=2,2"
OK "AT+IPR=115200"
OK "ATE1"
TIMEOUT "60"
"" "ATD*99***1#"
CONNECT \c
Note: Replace above word {PIN} with the "PIN" of your card (typically a 4 digit code)
Note: Replace above word {APN} with the "Access Point Name" of the service you use (for instance mine is "web.omnitel.it"). If you don't know the Internet APN, ask your service provider
Warning: Route and DNS is not working. Something is still missing in above config


Start/Stop

Start connection

pon E220

Stop connection

poff E220

If something goes wrong...

Check if process is running

pidof pppd

Logfile might give you a clue on what went wrong

egrep "pppd|chat" /var/log/messages

Check nic information

ifconfig ppp0

pppd has a statusinformation function that could come in handy

pppstats