Using serial modem: Difference between revisions

From Alpine Linux
(→‎Install packages: Typo on old apk_add command)
(→‎Checks: notes on setserial command)
Line 90: Line 90:


= Checks =
= Checks =
Check your ttyS0 settings
setserial -ga /dev/ttyS0
Check if process is running
Check if process is running
  ps | grep pppd
  ps | grep pppd

Revision as of 09:58, 5 January 2011

General notes

Warning: Page is under heavy construction. Do not use unless you know what you are doing! Funtionallity is still unknown.


Requirements

Install alpine-2.1.3 or newer (see these notes if you are unsure how to do it).
And do basic setup (run 'setup-alpine').

Install packages

Configure repository

When this article was written, some of the packages was still in 'testing'. So we need to add testing to repository.

echo "http://dl-3.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repository
apk update

Install packages

Install required packages

apk add ppp
apk add setserial

Load modules

Note: I am not sure what modules is needed

If we need to load some modules we need to make sure we add them to /etc/modules

Check and set serial speed

Note: I am not sure how to do that

Configure

Create a missing folder

mkdir -p /etc/ppp/peers

Create configfiles

Note: This is a draft config - it needs fixing

/etc/ppp/peers/serialmodem

/dev/ttyS0
38400
crtscts
modem
noauth
usepeerdns
defaultroute
noipdefault
debug
noccp
nobsdcomp
novj
user "irrelevant"
password "irrelevant"
connect '/usr/sbin/chat -f /etc/ppp/chat-serialmodem-pin || /usr/sbin/chat -f /etc/ppp/chat-serialmodem-nopin'
Note: This is a draft config - it needs fixing

/etc/ppp/chat-serialmodem-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
Note: This is a draft config - it needs fixing

/etc/ppp/chat-serialmodem-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)
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.

Start/Stop

Start connection

pon serialmodem

Stop connection

poff serialmodem

Checks

Check your ttyS0 settings

setserial -ga /dev/ttyS0

Check if process is running

ps | grep pppd

Logfile would also give you information on what happened

grep pppd /var/log/messages

Check nic information

ifconfig ppp0

pppd seems to have some pppstats function

pppstats