Using HSDPA modem: Difference between revisions
(Removing 'Draft' - I think it should be ready to use) |
(add config for a Huawei E378) |
||
Line 98: | Line 98: | ||
pppd has a statusinformation function that could come in handy | pppd has a statusinformation function that could come in handy | ||
{{cmd|pppstats}} | {{cmd|pppstats}} | ||
= Huawei E378 = | |||
Add usb-modeswitch (currently only in testing repo): | |||
{{cmd|apk add usb-modeswitch}} | |||
/etc/modules: | |||
<pre> | |||
usbserial vendor=0x12d1 product=0x1446 | |||
</pre> | |||
/etc/usb_modeswitch.conf: | |||
<pre> | |||
# Configuration for the usb_modeswitch package, a mode switching tool for | |||
# USB devices providing multiple states or modes | |||
# | |||
# This file is evaluated by the wrapper script "usb_modeswitch_dispatcher" | |||
# in /usr/sbin | |||
# To enable an option, set it to "1", "yes" or "true" (case doesn't matter) | |||
# Everything else counts as "disable" | |||
# Disable automatic mode switching globally (e.g. to access the original | |||
# install storage) | |||
DisableSwitching=0 | |||
# Enable logging (results in a extensive report file in /var/log, named | |||
# "usb_modeswitch_<interface-name>" (and probably others) | |||
EnableLogging=1 | |||
DefaultVendor=0x12d1 | |||
DefaultProduct=0x1446 | |||
TargetVendor=0x12d1 | |||
TargetProduct=0x14ac | |||
MessageContent="55534243000000000000000000000011060000000000000000000000000000" | |||
CheckSuccess=5 | |||
</pre> | |||
/etc/network/interfaces | |||
<pre> | |||
auto ppp0 | |||
iface ppp0 inet ppp | |||
provider E378 | |||
pre-up usb_modeswitch -c /etc/usb_modeswitch.conf | |||
</pre> | |||
/etc/ppp/peers/E378: | |||
<pre> | |||
debug | |||
/dev/ttyUSB0 | |||
460800 | |||
crtscts | |||
modem | |||
noauth | |||
usepeerdns | |||
defaultroute | |||
noipdefault | |||
noccp | |||
nobsdcomp | |||
novj | |||
connect '/usr/sbin/chat -v -f /etc/ppp/peers/chat-E378-nopin' | |||
</pre> | |||
/etc/ppp/peers/chat-E378-nopin: | |||
<pre> | |||
ABORT "BUSY" | |||
ABORT "ERROR" | |||
ABORT "NO CARRIER" | |||
REPORT "CONNECT" | |||
TIMEOUT "10" | |||
"" "ATZ" | |||
OK AT+CGDCONT=1,"ip","isp.telus.com" | |||
OK AT+CGQREQ=1,2,4,3,6,31 | |||
OK AT+CGQMIN=1,2,4,3,6,31 | |||
OK AT+CGATT=1 | |||
OK ATD*99# | |||
CONNECT \c | |||
</pre> |
Revision as of 12:24, 2 January 2012
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
Routes
Create a default gw route to your 'ppp0' device.
ip route add default dev ppp0
DNS
Figure out what DNS-servers your provider has.
egrep -i 'pppd.*dns' /var/log/messages
This might give you some useful information.
Search for a IP-address that might be your providers DNS-server and add this IP-address into '/etc/resolv.conf'.
echo "nameserver {DNS-server-IP-address}" > /etc/resolv.conf
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
Huawei E378
Add usb-modeswitch (currently only in testing repo):
apk add usb-modeswitch
/etc/modules:
usbserial vendor=0x12d1 product=0x1446
/etc/usb_modeswitch.conf:
# Configuration for the usb_modeswitch package, a mode switching tool for # USB devices providing multiple states or modes # # This file is evaluated by the wrapper script "usb_modeswitch_dispatcher" # in /usr/sbin # To enable an option, set it to "1", "yes" or "true" (case doesn't matter) # Everything else counts as "disable" # Disable automatic mode switching globally (e.g. to access the original # install storage) DisableSwitching=0 # Enable logging (results in a extensive report file in /var/log, named # "usb_modeswitch_<interface-name>" (and probably others) EnableLogging=1 DefaultVendor=0x12d1 DefaultProduct=0x1446 TargetVendor=0x12d1 TargetProduct=0x14ac MessageContent="55534243000000000000000000000011060000000000000000000000000000" CheckSuccess=5
/etc/network/interfaces
auto ppp0 iface ppp0 inet ppp provider E378 pre-up usb_modeswitch -c /etc/usb_modeswitch.conf
/etc/ppp/peers/E378:
debug /dev/ttyUSB0 460800 crtscts modem noauth usepeerdns defaultroute noipdefault noccp nobsdcomp novj connect '/usr/sbin/chat -v -f /etc/ppp/peers/chat-E378-nopin'
/etc/ppp/peers/chat-E378-nopin:
ABORT "BUSY" ABORT "ERROR" ABORT "NO CARRIER" REPORT "CONNECT" TIMEOUT "10" "" "ATZ" OK AT+CGDCONT=1,"ip","isp.telus.com" OK AT+CGQREQ=1,2,4,3,6,31 OK AT+CGQMIN=1,2,4,3,6,31 OK AT+CGATT=1 OK ATD*99# CONNECT \c