Re: [OFFTOPIC] Detector for modem for driver I want to code

Mike A. Harris (mharris@ican.net)
Fri, 25 Jun 1999 02:26:52 -0400 (EDT)


On Fri, 25 Jun 1999, Riley Williams wrote:

> > What I'm using it for is this: I want to automate my modem to
> > poll for mail once an hour or so, do a fetchmail and sendmail,
> > and then to log off. I *ONLY* want it to do that though if the
> > line is NOT in use currently (I only have one line).
>
>That part of your specification is part of normal modem behaviour: If
>it picks up the line and doesn't hear a dial tone, it drops the line
>without even trying to dial.

Only on ATX4 - which I can't use (see below).

> > Also, if the modem is already online, I want my script to just
> > sit idle.
>
>That's the easy part - your script can do that without any hardware at
>all. Try the following bash script:
>
> Q> #!/bin/bash
> Q> X=`/sbin/ifconfig | cut -d ' ' -f 1 | grep "^$1\$"`
> Q> if [ -n "$X" ]; then
> Q> exit 0
> Q> else
> Q> exit 1
> Q> fi

Yep, I can handle that part, it is the hardware switch that I
don't have time to experiment with.

>Save that as /sbin/online with mode 0755, then use `online ppp0` as
>the command to run when you want to determine if you're online. It
>returns TRUE (=0) if you are online, and FALSE (=1) if not.

I can just grep /proc/net/dev for ppp0 also.

> > So basically, if I'm not online, and not talking voice, I want
> > my script to go out for a mail run and then disconnect. To do
> > so, I need a device to detect if the phone line is not in use.
>
> > Someone suggested to me that the modem will not dial if ATX4
> > command is in the init string, and there is no dialtone.
>
>Ah...you've already met what I referred to earlier - sorry.

Yes.

> > That is true, but that is not what I want because 1) I have to
> > use ATX3 because I have "call answer" and the modem wont dial
> > out if I have messages waiting because it can't detect the
> > dialtone - so I need to force it with X3...
>
>I find that strange, as I have "call answer" as well, and I have no
>problem using my modem with ATX4 in the dial string. I'd have to
>presume that either your telephone provider uses a different dialtone
>if there are messages waiting, or your modem incorrectly detects dial
>tone in the first place.

Message waiting notification changes the dialtone from constant
to intermittent, which makes the modem detect no dialtone when
there is one - it is just intermittent. I've yet to see a modem
that detects this intermittent tone as a dialtone.

>If it's the latter, you could easily find that replacing the modem is
>the cheapest option.

No, the modem works fine, it is the different dialtone. It can
be disabled at the phone company, but that is not what I want.

> > ...and 2) The modem still takes the line off hook with X4 and
> > looks for a dialtone. I've got my phone plugged into the modem,
> > and as such, my voice call will get interrupted by the modem
> > every 30 seconds and I'll get cut off.
>
>SOme modems will interrupt the line if there's a glitch in their power
>connection, so plugging your phone in through the modem is rarely a
>good idea.

It's either that, or no telephone then. I don't want people
picking up the phone and disrupting my online status. I rewired
the whole house by flipping the wires and making a special Y
cable that plugs into the modem. Now when the modem is ONLINE,
*ALL* telephones are dead and cannot disrupt the modem.

This has worked perfectly for 4 years. As for the modem
disconnecting a voice call, I've never seen it happen. I've seen
a few modems toggle the relay when resetting, but this didn't
disconnect the voice call. At any rate I don't need to worry
about that.

> > > So, I really do need this device. Any help would be greatly
> > appreciated. Sorry for the [OT] posting.
>
>I'll have a go at designing one for you, but don't hold your breath.

That would be great! I figured a few rectifiers, a zener, and
a few other parts should do it, but I've been away from
electronics for a few years and don't have the time to fiddle.

If you come up with something, I'd be very greatful indeed!
Thanks in advance.

TTYL

--
Mike A. Harris                   Linux advocate      GNU advocate
Computer Consultant                          Open Source advocate  

Tea, Earl Grey, Hot...

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/