Strona 1 z 1

instalacja modemu GPRS RS232

: 27 lutego 2009, 15:34
autor: kewy
Witam serdecznie.
Chciałbym pod Linuksem zainstalować modem GPRS Wavecom.
Nie wiem jak to zrobić skąd ściągnąć sterowniki. Na stronie producenta nie znalazłem nic.
W Windowsie instalowałem go jako modem standardowy o prędkości 19200.
Modem jest podłączony do RS232.
Czy możecie mnie nakierować?
Dziękuję i pozdrawiam.
Kris

: 27 lutego 2009, 15:47
autor: LiTE
W internecie jest wiele poradników na ten temat ;-)

W skrócie to musisz utworzyć pliki

/etc/ppp/peers/gprs

Kod: Zaznacz cały

# File: gprs 
# 
# Description: 
# Serial cable, IrDA, Bluetooth and USB pppd options for GPRS phones. 

# Keep pppd attached to the terminal: 
# Comment this to get daemon mode pppd 
#nodetach 
updetach 
# Opcja updatach oznacza, ze pppd odlaczy sie od terminala dopiero 
# gdy zostanie nawiazane polaczenie. 

# Debug info from pppd: 
# Comment this off, if you don't need more info 
debug

# Show password in debug messages 
show-password 

# Connect/Disconnect scripts: 

connect "/usr/sbin/chat -v -f /etc/chatscripts/gprs-connect-chat" 

disconnect "/usr/sbin/chat -v -f /etc/chatscripts/gprs-disconnect-chat" 

# Serial device to which the GPRS phone is connected: 
# /dev/ttyS0 for serial port (COM1 in Windows), 
#/dev/ircomm0 
# /dev/ircomm0 for IrDA, 
#/dev/ttyUB0 for Bluetooth (Bluez with rfcomm running) and 
# /dev/ttyUSB0 for USB 
#/dev/ttyS0     # serial port one 
#/dev/ttyS1     # serial port two 
#/dev/ircomm0   # IrDA serial port one 
/dev/rfcomm0   # Bluetooth serial port one 
#/dev/ttyUSB0   # USB serial device, for example Orange SPV 

# Serial port line speed 
115200 # fast enough 
#57600   # perhaps usefull with IrDA 

# Hardware flow control: 
# Use hardware flow control with cable, Bluetooth and USB but not with IrDA. 
crtscts  # serial cable, Bluetooth and USB 
#nocrtscts # IrDA 

# Ignore carrier detect signal from the modem: 
local 

# IP addresses: 
# - accept peers idea of our local address and set address peer as 10.0.0.1 
# (any address would do, since IPCP gives 0.0.0.0 to it) 
# - if you use the 10. network at home or something and pppd rejects it, 
# change the address to something else 
:10.0.0.1 

# pppd must not propose any IP address to the peer! 
noipdefault 

# Accept peers idea of our local address 
ipcp-accept-local 

# Add the ppp interface as default route to the IP routing table 
defaultroute 

# DNS servers from the phone: 
# some phones support this, some don't. 
usepeerdns 

novj 
nobsdcomp 
novjccomp 
nopcomp 
noaccomp 

# The phone is not required to authenticate: 
noauth 

# Username and password: 
# If username and password are required by the APN, put here the username 
# and put the username-password combination to the secrets file: 
# /etc/ppp/pap-secrets for PAP and /etc/ppp/chap-secrets for CHAP 
# authentication. See pppd man pages for details. 
# Example, Radiolinja operator pap-secrets: 
# "rlnet"         *       "internet"    * 
user "internet" 

# Asyncmap: 
# some phones may require this option. 
#asyncmap 0xa0000 

# No magic: 
# some phones may require this option. 
#nomagic 

# Require PAP authentication: 
# some phones may require this option. 
#require-pap
/etc/charscripts/gprs-connect-chat

Kod: Zaznacz cały

# File: gprs-connect-chat 
# 
# Description: 
# 
# Set PDP context CID=1, protocol=IP, APN=internet: 
# AT+CGDCONT=1,"IP","internet","",0,0 
# 
# Set CID=1 QoS requirements from the network, not supported by Nokia: 
# AT+CGQREQ=1,0,0,0,0,0 
# 
# Set CID=1 minimum acceptable QoS parameters, not supported by Nokia: 
# AT+CGQMIN=1,0,0,0,0,0 
# 
# 'Call' CID=1 (activate PDP context one, perform GPRS attach): 
# ATD*99***1# 
# 
# Some phones like the Orange SPV (yes, the Microsoft Smartphone) use this 
# dial string to start GPRS connection: 
# ATD*99# 
# 
# The actual chat script: 

TIMEOUT         5 
ECHO            ON 
ABORT           '\nBUSY\r' 
ABORT           '\nERROR\r' 
ABORT           '\nNO ANSWER\r' 
ABORT           '\nNO CARRIER\r' 
ABORT           '\nNO DIALTONE\r' 
ABORT           '\nRINGING\r\n\r\nRINGING\r' 
''              \rAT 
TIMEOUT         12 
SAY             "Press CTRL-C to close the connection at any stage!" 
SAY             "\ndefining PDP context...\n" 
OK              ATH 
OK              ATE1 
OK              'AT+CGDCONT=1,"IP","internet"' 
OK              ATD*99# 
TIMEOUT         22 
SAY             "\nwaiting for connect...\n" 
CONNECT         "" 
SAY             "\nConnected." 
SAY             "\nIf the following ppp negotiations fail,\n" 
SAY             "try restarting the phone.\n" 
/etc/charscripts/gprs-disconnect-chat

Kod: Zaznacz cały

# File: gprs-disconnect-chat 
# 
# send break 
exec /usr/sbin/chat -V -s -S 
ABORT           "BUSY" 
ABORT           "ERROR" 
ABORT           "NO DIALTONE" 
SAY             "\nSending break to the modem\n" 
""              "\K" 
""              "+++ATH" 
SAY             "\nPDP context detached\n" 
Musisz tylko zmienić linie według swojego operatora:
OK 'AT+CGDCONT=1,"IP","internet"'
OK ATD*99#
Akurat to działa dla orange. W pliku /etc/ppp/peers/gprs musisz wybrać jeszcze odpowiedni port (ja akurat mam wybrany /dev/rfcoom0/ bo łącze się po bluetooth.)
/dev/rfcomm0 # Bluetooth serial port one
Dla Ciebie dobry będzie interfejs
# /dev/ttyS0 for serial port (COM1 in Windows)
Zakomentuj rfcoom0 i odkomentuj ttyS0

Później połączenie ustanawia się przez

Kod: Zaznacz cały

sudo pppd call gprs