[NTLUG:Discuss] Reading raw serial input?

George Lass George.Lass at osc.com
Mon Sep 17 09:40:04 CDT 2001


As I recall, Caller ID is transmitted @ 1200 Buad using the old Bell 202
modem
standard.

George

Steve Baker wrote:
> 
> Elequin wrote:
> >
> > I'm new to anything involving serial ports or parallel ports in linux,
> > so please forgive the newbie question.  (Hell, it took me an hour to
> > figure out what device to use in minicom to connect serial to my cisco!)
> > Anyway, I have this cute little device called a Sohotools Connect-ID
> > that basically listens on the phone line and collects caller-ID
> > information, and then reports it to a piece of Windows software via
> > serial port.  I hooked it up via serial to one of my linux boxes and
> > opened up minicom and then placed a call to my home phone.  All it did
> > was spit out a bunch of garbage.  It apparently reports name and number
> > info, plus maybe a timestamp.
> 
> Well, if you are seeing garbage in Minicom, you probably just have the
> wrong baud rate.  If you don't know what rate this Connect-ID box uses,
> that's a very likely possibility - you'll have to cycle through all of
> them to find out what it's using.  I'd start at 9600 baud and work up...
> but telephony signalling rates are quite low - so maybe this box works
> at a much lower baud rate.
> 
> Another possibility is that it has a parity-check bit on each character.
> you can configure Minicom to enable either odd-parity, even-parity or
> no-parity.  The default is likely to be 'N81' mode (No parity, 8 data bits,
> 1 stop bit), perhaps you need 'E71' or 'O71'.  If the box is sending data
> with parity and you view it with parity turned off then about half of the
> characters would come through looking OK and the other half would be garbage.
> 
> Yet another possibility (a MUCH nastier one) is that it may not send the
> data in ASCII.  It might be sending the phone number as a binary integer
> in the first few bytes then the timestamp as some binary number and the
> letters of the name as 0==A, 1==B or something.  That's pretty unlikely,
> but it's certainly possible.
> 
> >  Are there any utils available to read raw serial port input?
> 
> Not as such - but you don't need any special utility.
> 
> One of UNIX's more powerful concepts is that "Everything is a file".
> 
> The serial port is nothing special in UNIX/Linux: /dev/ttyS0 and /dev/ttyS1
> look just like infinitely large files to most applications.  If you have
> the right baud rate, etc, then you should be able to display what's coming
> from the serial port just by writing:
> 
>    cat /dev/ttyS0
> 
> ...although you may have to use the 'stty' program to set the right parameters
> to the port and you may need to be 'root' or at least to 'chmod a+rw /dev/ttyS0'
> to give yourself access privilages to that port.
> 
> You can then do things like:
> 
>   cat --show-nonprinting /dev/ttyS0
> 
> ...which will show those garbage characters as ^X and so on so you know what
> they are.
> 
> However, I would continue playing with Minicom, tweaking the settings until
> you see good data before going on to this next step.  Minicom is much more
> friendly to the novice than 'stty' when it comes to playing with serial port
> parameters.
> 
> ----------------------------- Steve Baker -------------------------------
> Mail : <sjbaker1 at airmail.net>   WorkMail: <sjbaker at link.com>
> URLs : http://web2.airmail.net/sjbaker1
>        http://plib.sf.net http://tuxaqfh.sf.net http://tuxkart.sf.net
>        http://prettypoly.sf.net http://freeglut.sf.net
>        http://toobular.sf.net   http://lodestone.sf.net
> 
> _______________________________________________
> http://www.ntlug.org/mailman/listinfo/discuss



More information about the Discuss mailing list