Alternating problem with GPRS over Nokia mobile - PPP

This is a discussion on Alternating problem with GPRS over Nokia mobile - PPP ; Hi, I have a strange problem with Linux, pppd, bluetooth, and a Nokia mobile phone (6310i/6230): To get a connection I always have to start pppd twice. Exactly every second time the connection fails. Log files say that pppd detects ...

+ Reply to Thread
Results 1 to 8 of 8

Thread: Alternating problem with GPRS over Nokia mobile

  1. Alternating problem with GPRS over Nokia mobile

    Hi,

    I have a strange problem with Linux, pppd, bluetooth, and a Nokia mobile
    phone (6310i/6230):

    To get a connection I always have to start pppd twice. Exactly every
    second time the connection fails. Log files say that pppd detects a
    loop and terminates.

    Any idea?

    regards
    Hadmut

  2. Re: Alternating problem with GPRS over Nokia mobile

    On 2005-06-18, Hadmut Danisch wrote:
    > I have a strange problem with Linux, pppd, bluetooth, and a Nokia mobile
    > phone (6310i/6230):
    >
    > To get a connection I always have to start pppd twice. Exactly every
    > second time the connection fails. Log files say that pppd detects a
    > loop and terminates.


    pppd debug output on success and failure would help here. man pppd
    search for 'loop' shows up nomagic option which might be worth a try.

    On the other hand, a 7650 I used failed every second time too when the
    dial AT command resulted in failure. That was nothing PPP specific, just
    a buggy phone.

    -Mikko

  3. Re: Alternating problem with GPRS over Nokia mobile

    Mikko Rapeli wrote:
    > On 2005-06-18, Hadmut Danisch wrote:
    >> I have a strange problem with Linux, pppd, bluetooth, and a Nokia mobile
    >> phone (6310i/6230):
    >>
    >> To get a connection I always have to start pppd twice. Exactly every
    >> second time the connection fails. Log files say that pppd detects a
    >> loop and terminates.


    > pppd debug output on success and failure would help here. man pppd
    > search for 'loop' shows up nomagic option which might be worth a try.


    > On the other hand, a 7650 I used failed every second time too when the
    > dial AT command resulted in failure. That was nothing PPP specific, just
    > a buggy phone.


    He might try adding "ATZ OK" at the beginning of the chat script.
    Among other things it's supposed to clear the serial port buffers.
    I seem to recall a post long ago that had a problem with left over
    bytes there that caused an "every other fails" problem.

    No guarantee that ATZ will work or even be accepted - I currently know
    next to nothing about bluetooth.

    --
    Clifford Kite Email: "echo xvgr_yvahk-ccc@ri1.arg|rot13"
    PPP-Q&A links, downloads: http://ckite.no-ip.net/
    /* In my book, the first poster to resort to personal abuse in a Usenet
    debate loses by default. - Rod Smith */


  4. Re: Alternating problem with GPRS over Nokia mobile

    On 2005-06-19, Clifford Kite wrote:
    > He might try adding "ATZ OK" at the beginning of the chat script.
    > Among other things it's supposed to clear the serial port buffers.
    > I seem to recall a post long ago that had a problem with left over
    > bytes there that caused an "every other fails" problem.


    I'd like know if this was the issue I was seeing too, but I don't have any
    Nokia's around. The problem could be that the phone has some crap in the
    buffers, I suppose.

    -Mikko

  5. Re: Alternating problem with GPRS over Nokia mobile

    Mikko Rapeli wrote:
    > On 2005-06-19, Clifford Kite wrote:
    >> He might try adding "ATZ OK" at the beginning of the chat script.
    >> Among other things it's supposed to clear the serial port buffers.
    >> I seem to recall a post long ago that had a problem with left over
    >> bytes there that caused an "every other fails" problem.


    > I'd like know if this was the issue I was seeing too, but I don't have any
    > Nokia's around. The problem could be that the phone has some crap in the
    > buffers, I suppose.


    After posting, I stumbled across a post I'd saved back in May 1998 with
    a solution to an "every-other-time-fails" problem caused by a buffer with
    "NO CARRIER" left in it. The post had the source for a simple program
    to flush buffers and showed how to compile and use it. FWIW, the basics
    of the solution are reproduced below.
    ===

    Before starting pppd do:

    /usr/local/bin/tcflush < $MODEMPORT

    where $MODEMPORT represents the device file (usually /dev/tty)
    used by pppd and chat for transferring data to and from the modem.

    ( compile as cc -O2 tcflush.c -o /usr/local/bin/tcflush )
    ------ Begin source to tcflush.c
    #include
    #include

    main()
    {
    if(tcflush(0, TCIOFLUSH)) {
    perror("tcflush");
    }

    exit(0);
    }
    ------- End source

    ---
    Clifford Kite Email: "echo xvgr_yvahk-ccc@ri1.arg|rot13"

  6. Re: Alternating problem with GPRS over Nokia mobile

    Similar tcflush() call is in sys-linux.c/tty_disestablish_ppp of
    pppd-2.4.3, but is it called from anywhere? Didn't seem like it after a
    very quick grep/less.

    -Mikko

  7. Re: Alternating problem with GPRS over Nokia mobile

    Mikko Rapeli wrote:
    > Similar tcflush() call is in sys-linux.c/tty_disestablish_ppp of
    > pppd-2.4.3, but is it called from anywhere? Didn't seem like it after a
    > very quick grep/less.


    (In)famous C indirection(?):

    pppd/sys-linux.c: void tty_disestablish_ppp(int tty_fd)
    pppd/pppd.h: struct channel {
    ....
    /* take the channel out of PPP `mode', restore loopback if demand */
    void (*disestablish_ppp) __P((int));
    pppd/pppd.h: extern struct channel *the_channel;
    pppd/tty.c: struct channel tty_channel = {
    ....
    &tty_disestablish_ppp,
    pppd/tty.c: the_channel = &tty_channel;
    pppd/auth.c: the_channel->disestablish_ppp(devfd);

    It does look similar, but not being a C programmer it's not for me to
    say whether it's equivalent - at least not without more effort than I'm
    willing to put into it.

    --
    Clifford Kite Email: "echo xvgr_yvahk-ccc@ri1.arg|rot13"
    PPP-Q&A links, downloads: http://ckite.no-ip.net/
    /* In my book, the first poster to resort to personal abuse in a Usenet
    debate loses by default. - Rod Smith */


  8. Re: Alternating problem with GPRS over Nokia mobile

    Hadmut Danisch wrote:

    > I have a strange problem with Linux, pppd, bluetooth, and a Nokia mobile
    > phone (6310i/6230):
    >
    > To get a connection I always have to start pppd twice. Exactly every
    > second time the connection fails. Log files say that pppd detects a
    > loop and terminates.




    I finally found the problem. It was my own blindness, very stupid
    mistake. Just because others were reporting the same problem:

    I simply forgot to wait for the "CONNECT" reply at the end of
    my chat script.

    So what happened?

    With the first pppd the connection was initiated. But since the chat
    script didn't wait for CONNECT, the pppd was starting too early, while
    the modem (=mobile phone) was still in command line mode and thus in
    echo mode. That's why pppd was always seeing it's own ppp frames and
    detecting a loop back. pppd then terminated, while the phone was getting
    into the GPRS connection.

    With the second pppd the connection seemed to be already established,
    then the AT command was simply ignored and the connection already working.


    Just insert an expect CONNECT at the end of the chat script, and the
    problem was gone. As I said, stupid mistake.


    Hadmut



+ Reply to Thread