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


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

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

From Mike Spencer <mds@bogus.nodomain.nowhere>
Newsgroups comp.os.linux.hardware
Subject Re: Talk to modem with USB to serial adapter: fail
Date 2015-08-15 02:26 -0300
Organization Bridgewater Institute for Advanced Study - Blacksmith Shop
Message-ID <87wpwx86lf.fsf@bogus.nodomain.nowhere> (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>

Show all headers | View raw


Hi Old Guy --

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

"Last time", though, was problem with the new operators of an ISP
firing up software out of the box without anyone there having a clue
about how the system worked. (Compounded by their trashing their
authentication system at the same time.)

This time it appears to be about making the USB/serial adapter and the
tty that it presents to the Linux system work right.

Moe Trin <ibuprofin@painkiller.example.tld.invalid> writes:

> Commands used?  Options?    What is in the logs?

Lets go right to the logs.  I'll append the pppd command and the
chat(8) script below. I have a shell script that invokes pppd with
options, one of which is a separate chat script.

(I know, I have to tweak syslog.conf to get pppd logging in one
place.)

After running my script, syslog says:

   Aug 15 00:45:20 roadgrime pppd[14015]: Connect script failed

/var/log/debug says:

   Aug 15 00:45:20 roadgrime pppd[14015]: Script /home/mds/bin/ppp-on-dialer
                   finished (pid 14020), status = 0x3

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.

Exit code 3 for chat(8) means:

    3   A timeout event occurred when there was an expect string
        without having a "-subsend" string. This may mean that you did
        not program the script correctly for the condition or that
        some unexpected event has occurred and the expected string
        could not be found.

If I set up two shells and do this:

   Shell-1: echo at > /dev/ttyUSB0

   Shell-2: cat /dev/ttyUSB0

   at
   Ê      <- Non-ASCII char here, E-with-a-hat

   OK

That E-with-a-hat line appears to be 0x81 0xCA 0x0A followed by
another extraneous 0x0A.  Might that cause chat to give up?  "...some
unexpected event has occurred and the expected string could not be
found."  It seems like I should be able to run down what 0x81CA is and
where it's coming from but I'm not having much luck.

Minicom works as expected, the "0x81 0xCA 0x0A" doesn't appear nor
does the extra newline after that; just:

   at
   OK

comes back.

Tnx,
- Mike

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

#!/bin/tcsh -f
#
# TEST TEST: CALLS ppp-on-dialer-test!  
# ------------------------------------
#
#  NOTE Adapter appears to be /dev/ttyUSB0. With cable plugged in but modem
#       not on, cat /proc/tty/driver/serial replies:
# 
#  NOTE That pppd has to be suid root for this to work.
#  NOTE That "noauth" has to be enabled in /etc/ppp/options. Doing it
#       from the command line is allowed only for root.
#
#   Wed 12 Aug 2015
#

setenv TELEPHONE 902-xxx-xxxx        # The telephone number for the connection

setenv  ACCOUNT [my-ISP-username]      # The account name for logon 

set LOCAL_IP = 0.0.0.0       # Local IP address if known. Dynamic = 0.0.0.0
set REMOTE_IP = 0.0.0.0      # Remote IP address if desired. Normally 0.0.0.0
set NETMASK = 255.255.255.0  # The proper netmask if needed
#
# Get a password without putting in this file in plaintext
#

[ shell code to get $PASSWORD from keyboard; elided]

# This is the location of the script which dials the phone and logs
# in. 

set DIALER_SCRIPT = /home/mds/bin/ppp-on-dialer-test



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 &

[ shell code to log the connection in ~/; elided]

--- End shell script that invokes pppd ---

--- Begin chat script ---

#!/bin/sh
#
# TALLSHIPS VERSION -- Looks for "Login:" instead of Username:" 
#
# This is part 2 of the ppp-on script. It will perform the connection
# protocol for the desired connection.
#

exec /usr/sbin/chat  -e -V -v                   \
    ECHO ON                                     \
    TIMEOUT      10                             \
    ABORT        '\nBUSY\r'                     \
    ABORT        '\nNO ANSWER\r'                \
    ABORT        '\nNO DIALTONE\r'              \
    ABORT        '\nRINGING\r\n\r\nRINGING\r'   \
    ''           '\rATZ'                        \
    'OK-+++\c-OK' "ATV1Q0&C1&D2X4S0=0H0s7=60"   \
    TIMEOUT        80                           \
    OK        "ATDT$TELEPHONE"                  \
    CONNECT        ''                           \
    ogin:--ogin: $ACCOUNT                       \
    ECHO OFF                                    \
    assword:    $PASSWORD                       \
    SAY "\nChat script done\n"

--- End chat script ---


-- 
Mike Spencer                  Nova Scotia, Canada

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