Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.os.linux.hardware > #2867

Re: Talk to modem with USB to serial adapter: fail

From Moe Trin <ibuprofin@painkiller.example.tld.invalid>
Newsgroups comp.os.linux.hardware
Subject Re: Talk to modem with USB to serial adapter: fail
Date 2015-08-16 00:45 +0000
Organization International League of Cat Herders, Local 352
Message-ID <slrnmsvnbl.8de.ibuprofin@planck.phx.az.us> (permalink)
References <87lhdhqc05.fsf@bogus.nodomain.nowhere> <mqgaos$31j$1@dont-email.me> <8737zn3bb5.fsf@bogus.nodomain.nowhere> <slrnmsq2ef.c6h.ibuprofin@planck.phx.az.us> <87wpwx86lf.fsf@bogus.nodomain.nowhere>

Show all headers | View raw


On 15 Aug 2015, in the Usenet newsgroup comp.os.linux.hardware, in article
<87wpwx86lf.fsf@bogus.nodomain.nowhere>, Mike Spencer wrote:

>Coming to my rescue again?  I'm still grateful for last time.

Well, there's only so many people still using dialin   ;-)

>I have a shell script that invokes pppd with options, one of which is
>a separate chat script.

[planck ~]$ wc /usr/local/bin/dialin
 194  598 5517 /usr/local/bin/dialin
[planck ~]$ wc /etc/ppp/options
  0 0 0 /etc/ppp/options
[planck ~]$

Everything is in the one file, but that's because there are 16 phone
numbers used in rotation.  I created that one 20 years ago, and just
tweak it when I move to a new ISP, distribution/release or computer.

>No other data from pppd or chat is logged. When pppd runs and tries
>to run the chat script, DTR lights on the modem.  Then there is one
>blink on RD and one on SD. And that's it; hangs, then exits with
>error 3. I never get far enough to have a problem with the config of
>pppd itself.

OK - that answers one of my questions - you are able to talk TO the
modem, but it sounds as if the modem can't talk back to you.   Question
for you - what is minicom using for an init-string (minicom -s -> Modem
and dialing -> A)?

>That E-with-a-hat line appears to be 0x81 0xCA 0x0A followed by
>another extraneous 0x0A.  Might that cause chat to give up?

Perhaps - but that MAY be a "locale" problem (isn't "i18n" wonderful?)
with your shell. Redirect the 'cat' output to a file, then use
'/usr/bin/hexdump' to view the file.  It would help to get syslog
configured (depending on your distro, it could be /etc/rsyslog.conf, or
some other strange filename), as what we're interested in is the "chat
-v" dialog.    Chat is ROUGHLY running a language called "expect" and
you see this in the log outputs:

Aug 13 12:25:37 planck chat[4933]: send (AT&F1^M)
Aug 13 12:25:37 planck chat[4933]: expect (OK)
Aug 13 12:25:38 planck chat[4933]: AT&F1^M^M
Aug 13 12:25:38 planck chat[4933]: OK
Aug 13 12:25:38 planck chat[4933]:  -- got it

You might understand it as "grep -q" - where it's looking for a string
of characters that might be buried in a ton of other noise.   Lessee...

  Aug 15 08:26:13  planck chat[19634]: CONNECT

but using a "REPORT CONNECT" string to chat, I see the modem said

  chat:  Aug 15 08:26:13 CONNECT 45333/ARQ/V92/LAPM/V44

so the extra characters are ignored.  It's looking for "CONNECT" and
that's all, and will wait up to TIMEOUT seconds for it before tossing
in the towel.   If you are actually getting a non-ascii sequence, it's
most likely a framing setup with your serial port or something, because
I doubt the modem is speaking Esperanto or Klingon.   Minicom here is
reporting (minicom -s  -> "Serial Port setup") 115200 8N1, but I don't
know enough about the 'stty' command to say what you may need to kick,
or even if that is the right tool (as opposed to perhaps ldattach(8)).

>--- Begin shell script that invokes pppd ---

>#  NOTE That "noauth" has to be enabled in /etc/ppp/options. Doing it
>#       from the command line is allowed only for root.

COMMENT: noauth shouldn't be needed - it's for the case where your
routing table shows a _pre-existing_ route to the IP of the peer, or a
_pre-existing_ default route (where pppd then assumes you're acting as
an ISP, and gets paranoid).  Not hurting anything.

I'm still amazed you can get a working text based login twenty years
after microsoft invented dial-up access (or what-ever).

>eval /usr/sbin/pppd  debug lock modem crtscts /dev/ttyUSB0 115200 \ 
>     asyncmap 20A0000 escape FF kdebug 0 ${LOCAL_IP}:$REMOTE_IP \  
>     noipdefault netmask $NETMASK defaultroute connect $DIALER_SCRIPT &

COMMENT: (it's not causing problem, but) asyncmap, escape, kdebug, the
LOCAL:REMOTE and netmask are not needed.   The 'modem' and 'crtscts'
_MIGHT_ be a problem due to the adapter (a USB port doesn't have the
control wires, even though the serial modem does). I'm not sure how the
/dev/USBn device looks to the kernel - as mentioned, I'm now using a
USB modem directly after the ancient laptop with a USR 5686 external I
was using as a firewall box finally died.

>exec /usr/sbin/chat  -e -V -v                   \ 

COMMENT: (as above) not sure the -e is needed.   Also, that script has
some rather old chestnuts in it.

>    TIMEOUT      10

Used to was, a (conventional) serial port with the IRQ set to the
wrong one would cause a problem here - the old (1.x and 2.x) kernel
would check the serial port for data every twenty-ish seconds - but
this timeout would prevent you from identifying the problem. I've
always left the TIMEOUTs at the default (45 seconds) as altering them
does nothing useful in a "working" system.

>    ABORT        '\nRINGING\r\n\r\nRINGING\r'   \ 
>    ''           '\rATZ'                        \ 
>    'OK-+++\c-OK' "ATV1Q0&C1&D2X4S0=0H0s7=60"   \ 

Your USR is _likely_ to "need" only "AT&F1" to set it to a sane
condition.  (In minicom, "AT$" will most likely return a quick command
reference and "ATI4" will probably show the "current settings" - and
AT&F1 should set things to "factory defaults with hardware flow
control".)  The "HO" command in the init string ("hang up the phone")
is a little counter-intuitive, but I doubt it's breaking anything. The
rest of the string is the same as the factory defaults.  (While "ATZ"
is pretty much a universal init-string, it _resets_ the modem to a user
defined state that was saved to NVRAM with AT&W0 - and that _could_ be
garbage that mis-configures the modem, such as setting ATQ1 which
disables result codes.)

That 'OK-+++\c-OK' sequence came from Al Longyear back in ppp-2.2.0 in
1995.  I don't know about his telco, but if I keep the line "off-hook"
with the modem and not using it, they will eventually disconnect me
and send out a service tech, then bill me for that and the time the
line is off-hook, not in actual use.  I'd much rather know about that
right now (so I can correct the problem) than when I get an
eleventyseven dollar charge I could have avoided.   What your log will
eventually show is something akin to

   chat[4933]: send (ATZ^M)
   chat[4933]: expect (OK)
   chat[4933]: alarm
   chat[4933]: Failed
   chat[4933]: Exit.

with the exit caused by the TIMEOUT expiring without seeing a response
from the modem.

Bottom line - I'd suggest it's still something about the way the serial
line is set up, although it could be a modem or crtscts option not
working as desired or (heck of a slim chance) something dodgy saved to
NVRAM on the modem.  You could try deleting those two options and set
the init string to AT&F1 (rather than ATZ) to see if you can get any
response from the modem.

        Old guy

Back to comp.os.linux.hardware | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Talk to modem with USB to serial adapter: fail Mike Spencer <mds@bogus.nodomain.nowhere> - 2015-08-12 03:03 -0300
  Re: Talk to modem with USB to serial adapter: fail Jerry Peters <jerry@example.invalid> - 2015-08-12 20:36 +0000
    Re: Talk to modem with USB to serial adapter: fail Mike Spencer <mds@bogus.nodomain.nowhere> - 2015-08-13 04:19 -0300
      Re: Talk to modem with USB to serial adapter: fail Moe Trin <ibuprofin@painkiller.example.tld.invalid> - 2015-08-13 21:17 +0000
        Re: Talk to modem with USB to serial adapter: fail Mike Spencer <mds@bogus.nodomain.nowhere> - 2015-08-15 02:26 -0300
          Re: Talk to modem with USB to serial adapter: fail Moe Trin <ibuprofin@painkiller.example.tld.invalid> - 2015-08-16 00:45 +0000
            Re: Talk to modem with USB to serial adapter: fail Mike Spencer <mds@bogus.nodomain.nowhere> - 2015-08-16 00:43 -0300
              Re: Talk to modem with USB to serial adapter: fail Moe Trin <ibuprofin@painkiller.example.tld.invalid> - 2015-08-16 20:09 +0000
            Re: Talk to modem with USB to serial adapter: fail Mike Spencer <mds@bogus.nodomain.nowhere> - 2015-08-16 01:41 -0300
              Re: Talk to modem with USB to serial adapter: fail Moe Trin <ibuprofin@painkiller.example.tld.invalid> - 2015-08-16 20:10 +0000
                Re: Talk to modem with USB to serial adapter: fail Mike Spencer <mds@bogus.nodomain.nowhere> - 2015-08-16 22:28 -0300
                Re: Talk to modem with USB to serial adapter: fail Michael Black <et472@ncf.ca> - 2015-08-16 22:48 -0400
                Re: Talk to modem with USB to serial adapter: fail Mike Spencer <mds@bogus.nodomain.nowhere> - 2015-08-17 03:35 -0300
                Re: Talk to modem with USB to serial adapter: fail Mike Spencer <mds@bogus.nodomain.nowhere> - 2015-08-17 03:22 -0300
                Re: Talk to modem with USB to serial adapter: fail Moe Trin <ibuprofin@painkiller.example.tld.invalid> - 2015-08-17 23:50 +0000
                Re: Talk to modem with USB to serial adapter: fail Mike Spencer <mds@bogus.nodomain.nowhere> - 2015-08-18 16:16 -0300
                Re: Talk to modem with USB to serial adapter: fail Moe Trin <ibuprofin@painkiller.example.tld.invalid> - 2015-08-21 03:31 +0000
                Re: Talk to modem with USB to serial adapter: fail Mike Spencer <mds@bogus.nodomain.nowhere> - 2015-08-25 01:58 -0300
                Re: Talk to modem with USB to serial adapter: fail Moe Trin <ibuprofin@painkiller.example.tld.invalid> - 2015-08-27 02:28 +0000
                All better now (Re: Talk to modem with USB to serial adapter: fail) Mike Spencer <mds@bogus.nodomain.nowhere> - 2015-09-03 18:53 -0300
                Re: All better now (Re: Talk to modem with USB to serial adapter: fail) Moe Trin <ibuprofin@painkiller.example.tld.invalid> - 2015-09-04 20:00 +0000
                Re: All better now (Re: Talk to modem with USB to serial adapter: fail) Richard Kettlewell <rjk@greenend.org.uk> - 2015-09-04 21:09 +0100
                Re: All better now (Re: Talk to modem with USB to serial adapter: fail) Mike Spencer <mds@bogus.nodomain.nowhere> - 2015-09-04 23:14 -0300
                Re: All better now (Re: Talk to modem with USB to serial adapter: fail) Richard Kettlewell <rjk@greenend.org.uk> - 2015-09-05 10:08 +0100
                Re: All better now (Re: Talk to modem with USB to serial adapter: fail) Moe Trin <ibuprofin@painkiller.example.tld.invalid> - 2015-09-05 18:08 +0000
                Re: All better now (Re: Talk to modem with USB to serial adapter:  fail) Mike Spencer <mds@bogus.nodomain.nowhere> - 2015-09-06 01:31 -0300
                Re: All better now (Re: Talk to modem with USB to serial adapter:  fail) Moe Trin <ibuprofin@painkiller.example.tld.invalid> - 2015-09-06 19:17 +0000
                Re: All better now (Re: Talk to modem with USB to serial adapter:   fail) Mike Spencer <mds@bogus.nodomain.nowhere> - 2015-09-17 01:26 -0300
                Re: All better now (Re: Talk to modem with USB to serial adapter:   fail) Charlie Gibbs <cgibbs@kltpzyxm.invalid> - 2015-09-17 05:53 +0000
                Re: All better now (Re: Talk to modem with USB to serial adapter:    fail) Mike Spencer <mds@bogus.nodomain.nowhere> - 2015-09-17 04:02 -0300
                Re: All better now (Re: Talk to modem with USB to serial adapter:    fail) Charlie Gibbs <cgibbs@kltpzyxm.invalid> - 2015-09-17 18:02 +0000
                Re: All better now (Re: Talk to modem with USB to serial adapter:     fail) Mike Spencer <mds@bogus.nodomain.nowhere> - 2015-09-18 02:05 -0300
                Re: All better now (Re: Talk to modem with USB to serial adapter:    fail) Moe Trin <ibuprofin@painkiller.example.tld.invalid> - 2015-09-17 19:14 +0000
                Re: All better now (Re: Talk to modem with USB to serial adapter:    fail) Charlie Gibbs <cgibbs@kltpzyxm.invalid> - 2015-09-18 01:55 +0000
                Re: All better now (Re: Talk to modem with USB to serial adapter:    fail) Moe Trin <ibuprofin@painkiller.example.tld.invalid> - 2015-09-18 21:22 +0000
                Re: All better now (Re: Talk to modem with USB to serial adapter:   fail) Moe Trin <ibuprofin@painkiller.example.tld.invalid> - 2015-09-17 19:12 +0000

csiph-web