[SLUG] script/modem problem

From: Eben King (eben1@tampabay.rr.com)
Date: Thu Nov 04 2004 - 13:56:00 EST


OK SLUGgers, maybe you (collectively) can see what I've missed. I wrote a
script that reads caller-ID info from the modem and dumps it to syslog.
I wrote another script that continually scans syslog for interesting data
and formats them nicely and dumps them to a text-to-speech engine
(festival). Right now I'm working on the modem-to-log script
(monitor-cid) so that it will, on receipt of SIGUSR1, hang up on the
current caller while it's still ringing, probably just after the second
ring.

But that's not important right now. I'm getting some sort of weird
failure every time I try to write to the modem. In this procedure
(greatly expanded with added debugging commands):

    initialize_modem () {
        logger 1
        logger "DEVICE='$DEVICE'"
        logger 1a
        echo AT > /dev/ttyS0
        logger 2
        chat -t 1 -v '' 'at z' < $DEVICE > $DEVICE
        logger 3
        chat -t 1 -v OK 'at #cid=1' < $DEVICE > $DEVICE
        chat -t 1 -v OK '' < $DEVICE > $DEVICE || {
            logger -t monitor-cid "$ERRORSTRING"
            print -u2 "$ERRORSTRING"
            exit 1
        }
        logger after chat
    }

it never gets past "1a". "$DEVICE"=/dev/modem, and

lrwxrwxrwx 1 root root 10 Jun 14 20:57 /dev/modem -> /dev/ttyS0
crw-rw---- 1 root modem 4, 64 Nov 4 12:40 /dev/ttyS0

The process is run as root.

lsof shows nothing using it:

[root@pc tmp]# lsof | grep -e ttyS -e modem
[root@pc tmp]# service monitor-cid status
monitor-cid (pid 9706) is running...
[root@pc tmp]#

even when a "chat" should be hanging on it waiting for data. In fact,

[root@pc tmp]# ps ax | grep chat
[root@pc tmp]#

This script used to work just fine, without the added "hang up on the
caller" logic.

-- 
-eben    ebQenW1@EtaRmpTabYayU.rIr.OcoPm    home.tampabay.rr.com/hactar

Unix is user-friendly; it's just picky about who it makes friends with.

----------------------------------------------------------------------- This list is provided as an unmoderated internet service by Networked Knowledge Systems (NKS). Views and opinions expressed in messages posted are those of the author and do not necessarily reflect the official policy or position of NKS or any of its employees.



This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 16:29:08 EDT