
This is merlin, a curses app that will keep a window updated with
the status of a Novatel Wireless CDPD modem (Merlin, Sage, etc).
Simply run this in an xterm (or whatever), and you'll get most
of the important data you can get out of your modem while the link is
up. Note that for this program to work the link must be up and the
default route for your machine (or at least a host route for 10.0.0.1)
must go through the ppp daemon associated with the modem.

v1.1.1 (v1.1, really) will probably be the last version of merlinmon
that I maintain. I got tired of the poor CDPD connections I have been
getting lately and have moved over to Ricochet. Of course, the BSD-style
license invites anyone else who chooses to take over maintainership if
they like.

While the program is running, you can type ctrl-L to redraw the
screen or q to quit.

HISTORY:
	v1.1.1 - 2/23/2001
		- No code changes, just changes in the README to add
		  mention of Ricochet Merlin and lack of further
		  support.
	v1.1 - 11/16/2000
		- Add color support. Try and make good things green,
		  bad things red.
		- Don't bomb out on timeouts. Just clear the screen,
		  report the timeout and try again. Also, close and
		  reopen the socket each loop so that the source port
		  changes each time around. This insures that stale
		  replies won't be misinterpreted.
		- Reformat byte counts into K and M to make them
		  easier to read.
	v1.0 - 12/13/99
		- Initial release

FAQ:

Q. I have a Ricochet Merlin. Will this work?

A. No. I have heard from Novatel that the Ricochet version of Merlin
does not support MCSI, so this program will not work. Before
establishing a connection, you may be able to get Ricochet status info
via the AT command set. I don't have a Ricochet Merlin, so I have no
further information.

Q. I can't get ppp to negotiate a link with my Sage/Merlin. Is there a
trick to it?

A. Yes. Novatel misread one bit of the PPP spec. Your MRU must be the
same as the MRU that Sage/Merlin demands. In actual fact, the MRU in
each direction of a PPP connection is independent. But Sage/Merlin will
NAK the MRU setting if it doesn't match what it wants, which by default
is 576. So in your ppp.conf entry for Sage/Merlin, add 'set mru 576'.

Q. merlin prints out an error and quits rather than starting up the
connection. What gives?

A. Those of you used to the Windows software for Sage/Merlin might
be expecting this daemon to give stats as well as bring up the link
for you. This is not the case. You must establish the ppp connection
yourself _before_ you start this program. This program only prints out
the stats.

Q. I am using Linux. I can see the Internet through my Sage/Merlin, but
this program doesn't work. What's wrong?

A. The problem stems from the special nature of the packets this method
uses. UDP packets destined for 10.0.0.1, port 4950 are intercepted by
Sage/Merlin and treated as commands. Sage/Merlin then generates a reply
internally and sends it back. The problem is that this reply is not from
10.0.0.1:4950, it is from the link's local side IP address. That is, if
your IP address is 192.168.2.4, then the response is a packet from
192.168.2.4 port n, and it's to 192.168.2.4 port 4950. Linux sees these
packets as illegal and drops them. You'll have to convince your Linux
kernel not to do this to get this software to work.

Q. Is there an X/KDE/AfterStep/whatever version of this?

A. Not that I am aware of, but it would be pretty easy to do if you
are familiar with the GUI you want to plug into.

Q. I am too feckless to figure it out on my own. Do you have a ppp.conf
entry that would work with Sage/Merlin?

A. Sure:

merlin:
 enable dns
 set mru 576
 set device /dev/cuaa3
 set speed 19200
 set dial "ABORT ERROR \"\" ATO\\r\\c OK AT\\\\APPP\\r\\c CONNECT"
 add! default HISADDR

If you're using Sage, you should stop at this point. Use
'ppp -background merlin' to bring up the link, and killall ppp
to stop it when you're done (you should also change the device
to whatever one you use with Sage).

If you're using Merlin, you have the opportunity to interface with
the pccard daemon and have the link be managed automatically for you
(bring it up when the card is inserted, kill it when it's removed).
You need two shell scripts: /etc/pccard_merlin:

#! /bin/sh

ppp -foreground merlin &
echo $! > /var/run/merlin.pid

exit 0


and /etc/pccard_merlin_remove:

#! /bin/sh

kill -1 `cat /var/run/merlin.pid`
rm -f /var/run/merlin.pid /etc/resolv.conf

exit 0

Last, but not least, add this entry to /etc/pccard.conf:

card "Novatel Wireless" "Merlin Type II Wireless IP Modem"
        config  auto "sio3" any
        insert logger -s Merlin inserted
        insert /etc/pccard_merlin
        remove logger -s Merlin removed
        remove /etc/pccard_merlin_remove

Make sure that the device driver config entry matches the device name
in /etc/ppp/ppp.conf.

