pppd hangs: problem found and solved (almost)

Discussion in 'Linux Networking' started by dubal, Aug 7, 2005.

  1. The modem can't access the hardware configuration of the UART.
    There is only one way, other than AT commands, that any
    information is exchanged with the modem... and that is
    empirical analysis of the data sent over the Tx line!

    When the modem is initially powered up the incoming bit stream
    is analyzed to determine if it matches an 'A' character at *any*
    of the speed/parity/stopbit configurations allowed. When a
    pattern matches, the configuration it matched for is locked in
    as the port configuration.

    The process is interesting! The bit rate has to initially be
    set at the highest bit rate the modem port can accept. But it
    has to examine the pattern over a time interval that equals the
    time for a character frame at the slowest bit rate possible.

    If the modem can receive data at 115,200 bps, for example, it
    has to grab the first 10 bits at that rate and see if they match
    an 'A' character frame. If there is no match it collects
    another 10 bits at that rate, and examines the entire 20 bits as
    if it were a 57,600 bps character frame. If no match is found,
    it continues to collect bits and examines them at each possible
    rate. If the slowest rate that can be used is 300 bps, then the
    last bit pattern examined would be 115,200 / 300 * 10, or 3,840
    bits long. (Actually, each time another individual bit is added
    to the bit bucket, the entire analysis has to start over, from
    the beginning.)

    Note that in fact the shortest pattern might be 1 start bit,
    5 data bits, and 1 stop bit, or only 7 bits, while the longest
    bit pattern might be based on a frame that has two stop bits,
    and hence would be 4224 bits long instead of 3840.

    That is why if you actually get a modem locked to one speed,
    the only way to change the speed is to power cycle it and send
    an AT command to it.
     
    Floyd L. Davidson, Aug 9, 2005
    #41
    1. Advertisements

  2. dubal

    Moe Trin Guest

    In the Usenet newsgroup comp.os.linux.networking, in article

    At the front of the command listings is a "Command Summary". On my manual
    the second bulleted point is

    If a command has numeric options, and you don't include a number, zero is
    assumed. For example, if you type ATB, the command ATB0 is assumed.
    What model? _EVERY_ Sportster I have access to (and the manuals as well)
    indicate AT&F0 is _no_ flow control, AT&F1 (the recommends init string) is
    hardware flow control, and AT&F2 is software. Here, right out of the
    on-line help (AT&? in command mode):

    &Fn n=0 Load Factory 0, no FC
    n=1 Load Factory 1, HW FC
    n=2 Load Factory 2, SW FC

    Can you show otherwise?

    Old guy
     
    Moe Trin, Aug 9, 2005
    #42
    1. Advertisements

  3. dubal

    Moe Trin Guest

    In the Usenet newsgroup comp.os.linux.networking, in article
    This Sportster has five ATZ commands defined. As for AT&W, like most it
    only has two

    &Wn n=0 Store Configuration 0
    n=1 Store Configuration 1

    but did you notice the reference to Yn above? The same help screen give

    Yn n=0 Next Reset to &W0 settings
    n=1 Next Reset to &W1 settings
    n=2 Next Reset to &F0 settings
    n=3 Next Reset to &F1 settings
    n=4 Next Reset to &F2 settings
    and these can further alter things.

    [bad factory defaults]
    I see in your reply to James Knott, you stated:

    ]It's not a 14k4 Courier (do they exist?).

    Yes - somewhere in the back room, I still have at least one

    ]It's more like a no name Tornado clone.

    None of the modems I have access to default to anything other than auto
    answer off. Best Data, Diamond, Hayes, no-name using a Lucent chipset,
    no-name using a Rockwell chipset, Siig, USR/3com - not one. And that
    includes the Hayes 2400 BPS full size clunker still living in one of the
    file servers for some reason. Who ever built/programmed that clone of
    yours should be shot.

    [word length, parity,stop bits]
    How? There is NO Hayes command or "extended" Hayes command used by any
    modem manufacturer that controls this. It's not in an 'S' register either.
    It's a function of the serial application programming a UART - even if
    that UART is on a built in modem. It has nothing to do with the modem
    function. Remember, your external modem doesn't even _have_ a UART.
    The only connection is serial.

    Old guy
     
    Moe Trin, Aug 9, 2005
    #43
  4. dubal

    Moe Trin Guest

    In the Usenet newsgroup comp.os.linux.networking, in article
    Hi Clifford!
    Floyd explained it well. People forget that the modem is used as if it
    were an external device connected to the computer with an RS-232 cable,
    even if the modem is internal and a ISA, EISA, MCA, or PCI bus, or some
    abomination hanging off the Intel sound card interface. All the modem
    cares about is the port interface speed. The number of bits and parity
    etc. is a function of the UART that is (supposedly) installed on the
    serial port between the computer and the modem. Then modem merely
    converts the ones and zeros on the TXData wire to a tone that is shipped
    out the telephone wires, and converts tones received back into ones and
    zeros on the RXData wire. It wouldn't know a start, stop, parity or
    data bit if one of them bit the modem in the butt.

    "Internal" modems have a UART chip (or something that functions like
    one), but that is part of the _extra_ serial port that is supplied to
    allow you to have that modem internally. Also, if we are talking about
    a Loosemodem, which has only a DAC and ADC (with everything else
    emulated in software), the "modem" still functions in the same way. The
    only difference is that the serial-telephone interface is in one section
    of the software, and the UART is in another.

    Old guy
     
    Moe Trin, Aug 9, 2005
    #44
  5. dubal

    Unruh Guest

    Uh, read the manual? YOur modem manual will usually contain an appendix
    listing all the AT commands. Look for the one that sets 8 bits no parity
    one stop bit (8N1)

    AT\B3
    for a modem manual I happen to have here (Motorola Modemsurfr)
     
    Unruh, Aug 9, 2005
    #45
  6. dubal

    Unruh Guest

    Nope, the manual is at home, and the last time I read it was about 3 years
    ago, so you could be right, but my distinct memory was that F0 gave
    software flow control.
     
    Unruh, Aug 9, 2005
    #46
  7. dubal

    Moe Trin Guest

    In the Usenet newsgroup comp.os.linux.networking, in article
    Done. See my reply to Clifford, just upthread
    Not found. Literally. Not one manual I have, nor any book mentions
    being able to do this - not surprising in view of the fact that the
    modem itself doesn't know anything about 'start', 'stop', 'parity' or
    data bits - that's all a function of the UART.

    Not all modems speak the Hayes command set. I have this fancy
    modem made by "Null". Care to think what the commands are to set
    the data/parity/stop bit settings on a null modem? ;-)
    The only modem I have that has a \B command uses that command to send
    a 'break' where the digit is the length of the break is the digit times
    a tenth of a seconds (that's a Rockwell command, by the way). It's
    labeled as an "ECC Command" for some reason.

    Motorola Modemsurfr - wazzat? Is it a real serial modem?

    Old guy
     
    Moe Trin, Aug 10, 2005
    #47
  8. Hi there


    It usume the manufacterer considered it an production fault and dumped
    the lot. I bought it really cheap. Or maybe they produced a customized
    batch and the customer went broke.
    An other desing flaw was that it wouldn't do leased line without a DC
    component on the line. By scratching a few PCB traces and soldering a
    few wires I was able to make it work.
    That's what you get when you buy cheap stuff.
    It does have a cirquit with a aurt like function. Otherwise it couldn't
    interpret AT commands. This function can be emulated with software.
    It can also interpret the data on a bit level.
    With start and stop bits;

    AT 0x41 0x54 0 0100 0001 1 0 0101 0100 1

    at 0x61 0x74 0 0110 0001 1 0 0111 0100 1

    By timing the length of the bits the modem can establish the baud rate.
    If the first bit isn't zero the data is 7 bits instead of 8.
    In case of even parity the A will have a '0' before the stop bit and the
    T is followed by a '1'. With odd parity it's the other way around.
    If both are '1' it's mark parity and if both are '0' space.
    7 bits with no parity looks just like mark parity.

    There is no point in accessing these through S registers. After all,
    they are set by "AT".
    In dumb mode the modem ignores AT commands and cannot establish stuff
    like baud rate and parity. It will simply use the settings during the
    last AT&W.


    Regards,
    Rob
     
    Rob van der Putten, Aug 10, 2005
    #48
  9. Hi there


    The modem needs to interpret the serial data during command mode and
    therefore needs to emulate a uart.
    So the modem does know the speed and parity of the serial data.

    Regards,
    Rob
     
    Rob van der Putten, Aug 10, 2005
    #49
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.