Subject: misc/21442: SonyEricsson t200 vs GPRS
To: None <gnats-bugs@gnats.netbsd.org>
From: None <cagney@mac.com>
List: netbsd-bugs
Date: 05/03/2003 20:48:07
>Number:         21442
>Category:       misc
>Synopsis:       SonyEricsson t200 vs GPRS
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    misc-bug-people
>State:          open
>Class:          doc-bug
>Submitter-Id:   net
>Arrival-Date:   Sat May 03 20:49:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Andrew Cagney
>Release:        N/A
>Organization:
>Environment:
G4 Ti500

uplcom0 at uhub1 port 1
uplcom0: Prolific Technology PL2303 Serial adapter (ATEN/IOGEAR UC232A), rev 1.10/2.02, addr 2
ucom0 at uplcom0

>Description:
Ref: http://www.netbsd.org/Documentation/network/gprs.html

The SonyEricsson t200 GPRS phone has somewhat perverted modem support - it's serial baud rate is wired to 9600.  Fortunatly it can be changed using an AT command (via a chat script).

The SonyEricsson t200 GPRS phone doesn't drop the GPRS connection when pppd disconnects.  Fortunatly it can be disconnected using an AT command (via a chat script).

The SonyEricsson USB phone cable doesn't work with NetBSD.  Fortunatly, the combination of a BAFO (?) USB<->serial cable + SonyEricsson serial cable does (BAFO now make a tidy 9 pin adaptor).  (I should list the cable model numbers only none of the cables are branded with them :-()

Suggest updating the GPRS pages to include some or all of this info.  I suspect that much of it applies to all vendor phones.

>How-To-Repeat:
Try to follow the GPRS doco with a t200 phone using a baud rate other than 9600.


>Fix:
The options or peers file needs to include an init, connect and disconnect script vis:

115200
init "/etc/ppp/chat/t200.sh"
connect "chat -v -f /etc/ppp/chat/t200"
disconnect "chat -v -f /etc/ppp/chat/hup"

Where, t200.sh contains:

#!/bin/sh
# Find out the intended baud rate
b=`stty -g | sed -e 's/.*ispeed=//' -e 's/:.*//'`
# Force the serial line to 9600 baud so that it can be re-configured
stty 9600
# Ask for the modem to list all baud rates, and the current one.  Then
# force it to the rate the line was originally set to.
if chat -v \
    TIMEOUT 5 '' \
    +++AT OK \
    AT+IPR=? OK \
    AT+IPR? OK \
    AT+IPR=${b} OK
then
    stty ${b}
    exit 0
else
    exit 1
fi

The file t200 then contains (the chatscript.gprs would also work):

ABORT BUSY
ABORT ERROR
ABORT 'NO CARRIER'
ABORT 'NO DIALTONE'
ABORT 'NO DIAL TONE'
TIMEOUT 10 ''
AT OK--AT--OK
# Ask the modem its baud rate - a sanity check
AT+IPR=? OK
AT+IPR? OK
# connect
ATDT*99# CONNECT

And the hup file contains:

TIMEOUT 2
'' +++ATH OK

I tried having a combined init/connect script but it didn't appear to work.  Suspect pppd is doing an ioctl between init and connect and that cleans something up.

>Release-Note:
>Audit-Trail:
>Unformatted: