Using serial modem: Difference between revisions

From Alpine Linux
(Trying to do the doc as simple as possiple)
(Reorganizing the page)
Line 5: Line 5:
Install alpine-2.1.3 or newer (see [[Installation|these]] notes if you are unsure how to do it).
Install alpine-2.1.3 or newer (see [[Installation|these]] notes if you are unsure how to do it).


== Hardware ==
Decide which serial port to use and plug you modem there.<BR>
Start by deciding which serial port to use and plug you modem there.<BR>
In below examples replace ttyS0 with the ttyS? that applies for your needs.<BR>
In below examples replace ttyS0 with the ttyS? that applies for your needs.<BR>
''(/dev/ttyS0 is same as COM1 - ttyS1=COM2, ttyS2=COM3, ttyS3=COM4, ...)''
''(/dev/ttyS0 is same as COM1 - ttyS1=COM2, ttyS2=COM3, ttyS3=COM4, ...)''
Line 14: Line 13:
{{cmd|apk add ppp}}
{{cmd|apk add ppp}}


== Modules ==
== Load 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
{{cmd|modprobe ppp
{{cmd|modprobe ppp
echo "ppp" >> /etc/modules}}
echo "ppp" >> /etc/modules}}


== Configure ==
== Configfiles ==


=== Create configfiles ===
=== /etc/ppp/peers/serialmodem ===
'''''/etc/ppp/peers/serialmodem'''''
''(The filename 'serialmodem' can be changed to whatever is appropreate for you, but you will need to remember it when running pon/poff command)''
<pre>debug
<pre>debug
/dev/ttyS0
/dev/ttyS0
Line 36: Line 35:
</pre>
</pre>


'''''/etc/ppp/chat-serialmodem'''''
=== /etc/ppp/chat-serialmodem ===
''(The filename 'chat-serialmodem' can be changed to whatever is appropreate for you, but you will need modify above configfile to reflect your decition)''
<pre>ABORT 'BUSY'
<pre>ABORT 'BUSY'
ABORT 'ERROR'
ABORT 'ERROR'
Line 53: Line 53:
</pre>
</pre>


{{Note|Replace above words '''{login_id}''', '''{your_password}''' and '''{phonenumber}''' with what you received from your ISP.}}
{{Note|Replace above words '''{login_id}''', '''{your_password}''' and '''{phonenumber}''' with what you received from your ISP. The characters '''{''' and '''}''' should also be removed.}}
See [http://www.yolinux.com/TUTORIALS/LinuxTutorialPPP.html this] link for more details.
See [http://www.yolinux.com/TUTORIALS/LinuxTutorialPPP.html this] link for more details.


Line 65: Line 65:
Check if process is running
Check if process is running
{{cmd|pidof pppd}}
{{cmd|pidof pppd}}
Logfile would also give you information on what happened
Logfile might give you a clue on what went wrong
{{cmd|grep pppd /var/log/messages}}
{{cmd|grep pppd /var/log/messages
grep chat /var/log/messages}}
Check nic information
Check nic information
{{cmd|ifconfig ppp0}}
{{cmd|ifconfig ppp0}}
pppd seems to have some pppstats function
pppd has a statusinformation function that could come in handy
{{cmd|pppstats}}
{{cmd|pppstats}}

Revision as of 17:32, 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).

Decide 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

Load modules

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

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

Configfiles

/etc/ppp/peers/serialmodem

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

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

(The filename 'chat-serialmodem' 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 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. The characters { and } should also be removed.

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 might give you a clue on what went wrong

grep pppd /var/log/messages grep chat /var/log/messages

Check nic information

ifconfig ppp0

pppd has a statusinformation function that could come in handy

pppstats