Stop after "Serial connection established" - PPP

This is a discussion on Stop after "Serial connection established" - PPP ; Hi, We work on an embedded product which use a White Dwarf Linux distribution and a wavecom GPRS modem. In most cases our ppp connection works fine but sometimes nothing happens after ppp says "Serial connection established". Any idea ? ...

+ Reply to Thread
Results 1 to 14 of 14

Thread: Stop after "Serial connection established"

  1. Stop after "Serial connection established"


    Hi,

    We work on an embedded product which use a White Dwarf Linux
    distribution and a wavecom GPRS modem.
    In most cases our ppp connection works fine but sometimes nothing
    happens after ppp says "Serial connection established".

    Any idea ?

    Thanks,

    --
    Manu




  2. Re: Stop after "Serial connection established"

    It's hard to tell without debug output from pppd. Perhaps the modem hangs for
    some odd reason...

    -Mikko

  3. Re: Stop after "Serial connection established"


    You're right,

    Debug output :
    --------------------------------------------------------------
    Press CTRL-C to close the connection at any stage!^M
    defining PDP context...
    ^MrAT
    OK
    ATH
    OK
    ATE1
    OK
    AT+CGDCONT=1,"IP","Fdl16"
    OK
    AT+CGQREQ=1,0,0,3,0,0
    OK
    waiting for connect...
    ^M
    ATD*99***1#
    CONNECT
    Connected.^M
    If the following ppp negotiations fail,
    ^Mtry restarting the phone.
    ^M
    Serial connection established.
    ------------------------------------------------------------------

    Script :
    ------------------------------------------------------------------
    exec chat \
    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\",\"Fdl16\" \
    OK AT+CGQREQ=1,0,0,3,0,0 \
    OK ATD*99***1# \
    TIMEOUT 22 \
    SAY "\nwaiting for connect...\n" \
    CONNECT "" \
    SAY "\nConnected." \
    SAY "\nIf the following ppp negotiations fail,\n" \
    SAY "try restarting the phone.\n"
    ------------------------------------------------------------------



  4. Re: Stop after "Serial connection established"

    In article <40a0b63e$0$20762$626a14ce@news.free.fr>, Manu wrote:
    > You're right,
    >
    > Debug output :
    > --------------------------------------------------------------
    > Press CTRL-C to close the connection at any stage!^M
    > defining PDP context...
    > ^MrAT
    > OK
    > ATH
    > OK
    > ATE1
    > OK
    > AT+CGDCONT=1,"IP","Fdl16"
    > OK
    > AT+CGQREQ=1,0,0,3,0,0
    > OK
    > waiting for connect...
    > ^M
    > ATD*99***1#
    > CONNECT
    > Connected.^M
    > If the following ppp negotiations fail,
    > ^Mtry restarting the phone.
    > ^M
    > Serial connection established.


    No LCP traffic at all? Your host should start the LCP negotiations and the phone
    should respond. Can you see a pppd process running ('ps') with the correct
    /dev/ttyS? file open ('lsof') when the scripts hang like this?

    Wavecom manual seems to have some troubleshooting hints:
    http://www.pro4wireless.com/manualer...andon_gprs.pdf

    But you really should see some error messages, if pppd notices a problem. Since
    there aren't any ppp messages on the log, your serial cable link may be down,
    locked or maybe pppd isn't started properly. Try opening a minicom session
    when the chat script hangs, there you should see some binary stuff from the
    phones ppp stack.

    Just to be shure, what pppd options you use and how do you start pppd?

    -Mikko


  5. Re: Stop after "Serial connection established"

    Mikko Rapeli wrote:
    > No LCP traffic at all? Your host should start the LCP negotiations
    > and the phone should respond.

    No at all. This problem not occurs all the time (about 50-50) ...

    >Can you see a pppd process running
    > ('ps') with the correct /dev/ttyS? file open ('lsof') when the
    > scripts hang like this?

    Yes we can see pppd process running and 'lsof /dev/ttsS0' returns pppd
    ....
    When the scripts hang like this we need to make a 'kill -9 xx' in order
    to stop pppd process, 'kill xx' isn't enough.

    > But you really should see some error messages, if pppd notices a
    > problem. Since there aren't any ppp messages on the log, your serial
    > cable link may be down, locked or maybe pppd isn't started properly.
    > Try opening a minicom session
    > when the chat script hangs, there you should see some binary stuff
    > from the phones ppp stack.

    In minicom (when the chat script hangs) we can enter some AT commands
    and the modem answer correctly.

    >
    > Just to be shure, what pppd options you use and how do you start pppd?
    >

    Here they are :

    nodetach
    persist
    maxfail 0
    debug
    show-password
    connect /opt/sextant/ppp/gprs-connect-chat
    disconnect /opt/sextant/ppp/gprs-disconnect-chat
    /dev/ttyS0 # serial port one
    115200 # fast enough
    crtscts # serial cable, Bluetooth and USB
    local
    noipdefault
    ipcp-accept-local
    defaultroute
    novj
    nobsdcomp
    novjccomp
    nopcomp
    noaccomp
    noauth
    user buun.li624ric@ACG2.buun.001
    asyncmap 0
    nomagic
    lcp-echo-interval 60
    lcp-echo-failure 3
    lcp-max-failure 3



  6. Re: Stop after "Serial connection established"

    In article <40a0da41$0$20754$626a14ce@news.free.fr>, Manu wrote:
    > No at all. This problem not occurs all the time (about 50-50) ...


    So it seems like a pppd/ppp stack/kernel/driver issue.

    > Yes we can see pppd process running and 'lsof /dev/ttsS0' returns pppd
    > ...
    > When the scripts hang like this we need to make a 'kill -9 xx' in order
    > to stop pppd process, 'kill xx' isn't enough.


    Which version of pppd, which kernel?

    > In minicom (when the chat script hangs) we can enter some AT commands
    > and the modem answer correctly.


    So the modem is working as it should, but Linux PPP and pppd are not. The pppd
    options seem just fine. Last thing that I would suggest is using the
    "options ppp_async flag_time=0" modules.conf line, but if this were the issue,
    the serial port propably wouldn't work at all towards the modem.

    I can only suggest trying with latest pppd and kernel versions (or latest for
    your architecture if it's not i386). And if this doesn't solve it, you could try
    ltrace'ing and strace'ing pppd to see which system or library call it hangs on.
    Then showing this issue to the kernel developers for example could get it
    solved.

    -Mikko

  7. Re: Stop after "Serial connection established"

    Manu wrote:

    > In minicom (when the chat script hangs) we can enter some AT commands
    > and the modem answer correctly.


    If I parse that correctly then the problem may be that the modem is
    not being correctly set to the data mode.

    Under Linux, when there is a hangup by the remote pppd or "kill -9 pppd"
    doesn't reset the serial device file correctly. There are also other
    times it doesn't do this, although I've never determined a cause for
    those.

    If you become desperate enough then there is are simple patches for
    various pppd versions at the website in my signature that, AFAIK,
    cures the problem in every case except a "kill -9 `pidof pppd`".

    But GPRS PPP (ISP) implementations are funky, so it may not help.

    --
    Clifford Kite Email: "echo xvgr_yvahk-ccc@ri1.arg|rot13"
    PPP-Q&A links, downloads: http://ckite.no-ip.net/

  8. Re: Stop after "Serial connection established"

    In article , Clifford Kite wrote:
    > If I parse that correctly then the problem may be that the modem is
    > not being correctly set to the data mode.
    >
    > Under Linux, when there is a hangup by the remote pppd or "kill -9 pppd"
    > doesn't reset the serial device file correctly. There are also other
    > times it doesn't do this, although I've never determined a cause for
    > those.
    >
    > If you become desperate enough then there is are simple patches for
    > various pppd versions at the website in my signature that, AFAIK,
    > cures the problem in every case except a "kill -9 `pidof pppd`".


    Perhaps an 'init' option to pppd and setserial script with some options could
    do the same?

    Just a thought...
    -Mikko

  9. Re: Stop after "Serial connection established"

    Mikko Rapeli wrote:

    > Perhaps an 'init' option to pppd and setserial script with some
    > options could do the same?


    > Perhaps an 'init' option to pppd and setserial script with some
    > options could do the same?


    I'm doubtful any "init" option would be accepted for pppd since all
    I ever got from my suggestion on the Linux PPP mailing list about the
    patch was deafing silence.

    I don't think setserial could be of help. You might be able to use
    "stty crtscts -F /dev/ttySx" (where x = whatever appropriate for the
    device file), in a script just before launching pppd.

    --
    Clifford Kite Email: "echo xvgr_yvahk-ccc@ri1.arg|rot13"
    PPP-Q&A links, downloads: http://ckite.no-ip.net/

  10. Re: Stop after "Serial connection established"

    Clifford Kite writes:
    > I'm doubtful any "init" option would be accepted for pppd since all
    > I ever got from my suggestion on the Linux PPP mailing list about the
    > patch was deafing silence.


    Say what? pppd has always had an "init" option -- it runs any
    executable script or program that you like.

    > I don't think setserial could be of help. You might be able to use
    > "stty crtscts -F /dev/ttySx" (where x = whatever appropriate for the
    > device file), in a script just before launching pppd.


    crtscts is also a pppd option ...

    --
    James Carlson, IP Systems Group
    Sun Microsystems / 1 Network Drive 71.234W Vox +1 781 442 2084
    MS UBUR02-212 / Burlington MA 01803-2757 42.497N Fax +1 781 442 1677

  11. Re: Stop after "Serial connection established"

    James Carlson wrote:
    > Clifford Kite writes:
    >> I'm doubtful any "init" option would be accepted for pppd since all
    >> I ever got from my suggestion on the Linux PPP mailing list about the
    >> patch was deafing silence.


    > Say what? pppd has always had an "init" option -- it runs any
    > executable script or program that you like.


    You are right, of course. I just haven't ever used it and the pppd man
    pages seem ambiguous to me, first saying the script is "to initialize the
    serial line" and then saying a typical use is for chat to configure the
    modem to enable auto answer. The modem is different from the serial line.

    >> I don't think setserial could be of help. You might be able to use
    >> "stty crtscts -F /dev/ttySx" (where x = whatever appropriate for the
    >> device file), in a script just before launching pppd.


    > crtscts is also a pppd option ...


    Sorry about that. The problem involves pppd not setting clocal rather
    than not setting crtscts. That is, doing "stty -F /dev/ttySx clocal"
    in a script before launching pppd might help.

    --
    Clifford Kite Email: "echo xvgr_yvahk-ccc@ri1.arg|rot13"
    PPP-Q&A links, downloads: http://ckite.no-ip.net/
    /* The wealth of a nation is created by the productive labor of its
    * citizens. */

  12. Re: Stop after "Serial connection established"

    Mikko Rapeli wrote:

    > Which version of pppd, which kernel?

    pppd 2.4.1
    kernel 2.4.20

    > I can only suggest trying with latest pppd and kernel versions (or
    > latest for your architecture if it's not i386). And if this doesn't
    > solve it, you could try ltrace'ing and strace'ing pppd to see which
    > system or library call it hangs on. Then showing this issue to the
    > kernel developers for example could get it solved.

    Is it possible that an hardware problem (serial device or modem) cause
    this error ?

    Many thanks for your help !

    --
    Manu



  13. Re: Stop after "Serial connection established"

    "Manu" writes:
    > Is it possible that an hardware problem (serial device or modem) cause
    > this error ?


    Yes, indeed.

    --
    James Carlson, IP Systems Group
    Sun Microsystems / 1 Network Drive 71.234W Vox +1 781 442 2084
    MS UBUR02-212 / Burlington MA 01803-2757 42.497N Fax +1 781 442 1677

  14. Re: Stop after "Serial connection established"

    James Carlson wrote:
    >> Is it possible that an hardware problem (serial device or modem)
    >> cause this error ?

    >
    > Yes, indeed.

    Finally we add "AT&D2&C1" in the chat script and it's better : now pppd
    never hangs and retry to establish a connection because it receives a
    "NO CARRIER" signal.

    http://www.fokus.gmd.de/linux/FAQ/PPP-FAQ-17.html

    --
    Manu



+ Reply to Thread