Using serial modem: Difference between revisions

From Alpine Linux
(→‎Create configfiles: Cleaning up config)
(Trying to do the doc as simple as possiple)
Line 3: Line 3:


== Requirements ==
== Requirements ==
Install alpine-2.1.3 or newer (see [[Installation|these]] notes if you are unsure how to do it).<BR>
Install alpine-2.1.3 or newer (see [[Installation|these]] notes if you are unsure how to do it).
And do basic setup (run 'setup-alpine').


== Hardware ==
== Hardware ==
Choose what ttyS port to use. ''(In below examples replace ttyS? with the ttyS? that applies for your needs)''<BR>
Start by deciding which serial port to use and plug you modem there.<BR>
* /dev/ttyS0 is same as COM1
In below examples replace ttyS0 with the ttyS? that applies for your needs.<BR>
* /dev/ttyS1 is same as COM2
''(/dev/ttyS0 is same as COM1 - ttyS1=COM2, ttyS2=COM3, ttyS3=COM4, ...)''
* ''(and so on...)''


== Install packages ==
== 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
Install required packages
apk add ppp
{{cmd|apk add ppp}}
apk add setserial


== Modules ==
== Modules ==
Load some needed modules and make sure they get automatically loaded at next reboot
Load some needed modules and make sure they get automatically loaded at next reboot
modprobe ppp
{{cmd|modprobe ppp
echo "ppp" >> /etc/modules
echo "ppp" >> /etc/modules}}


== Configure ==
== Configure ==
Line 67: Line 58:
= Start/Stop=
= Start/Stop=
== Start connection ==
== Start connection ==
pon serialmodem
{{cmd|pon serialmodem}}
== Stop connection ==
== Stop connection ==
poff serialmodem
{{cmd|poff serialmodem}}


= If something goes wrong... =
= 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 would also give you information on what happened
grep pppd /var/log/messages
{{cmd|grep pppd /var/log/messages}}
Check nic information
Check nic information
ifconfig ppp0
{{cmd|ifconfig ppp0}}
pppd seems to have some pppstats function
pppd seems to have some pppstats function
pppstats
{{cmd|pppstats}}
 
== Check and set serial speed ==
Check your ttyS settings
setserial -ga /dev/ttyS1
You should see something like this:
<pre>
/dev/ttyS1, Line 1, UART: 16550A, Port: 0x02f8, IRQ: 3
    Baud_base: 115200, close_delay: 50, divisor: 0
    closing_wait: 3000
    Flags: spd_normal skip_test
</pre>

Revision as of 17:22, 8 January 2011

This material is work-in-progress ...

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

Requirements

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

Hardware

Start by deciding which serial port to use and plug you modem there.
In below examples replace ttyS0 with the ttyS? that applies for your needs.
(/dev/ttyS0 is same as COM1 - ttyS1=COM2, ttyS2=COM3, ttyS3=COM4, ...)

Install packages

Install required packages

apk add ppp

Modules

Load some needed modules and make sure they get automatically loaded at next reboot

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

Configure

Create configfiles

/etc/ppp/peers/serialmodem

debug
/dev/ttyS0
115200
modem
crtscts
asyncmap 0
defaultroute
noipdefault
lock
noauth
connect '/usr/sbin/chat -v -f /etc/ppp/chat-serialmodem'

/etc/ppp/chat-serialmodem

ABORT 'BUSY'
ABORT 'ERROR'
ABORT 'NO ANSWER'
ABORT 'NO CARRIER'
ABORT 'NO DIALTONE'
ABORT 'Invalid Login'
ABORT 'Login incorrect'
REPORT 'CONNECT'
TIMEOUT '60'
'' 'ATZ'
OK 'ATDT{phonenumber}'
CONNECT ''
ogin: '{login_id}'
sword: '{your_password}'
Note: Replace above words {login_id}, {your_password} and {phonenumber} with what you received from your ISP.

See this link for more details.

Start/Stop

Start connection

pon serialmodem

Stop connection

poff serialmodem

If something goes wrong...

Check if process is running

pidof 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