Operating System - Linux
1827804 Members
2125 Online
109969 Solutions
New Discussion

capture data from Serial Port

 
SOLVED
Go to solution
Ron Bombard
Frequent Advisor

capture data from Serial Port

I'm trying to connect a RedHat7.3 box to my Avaya PBX via a serial cable. A port on the PBX outputs the Call Details to a serial printer. I'm trying to capture the data through a serial port on the linux box.

I can't seem to figure it out.
I've used a program "logserial" and it opens the port "/dev/ttyS0" no problem, but the PBX dosn't like it and deactivates its port.

Any ideas? I'm using a standard modem cable, should I be?

The phone guy told me that the port on the PBX was set to 9600,8,N,1.

Is there any other way to capture data from the serial port other than the program "logserial"??

Thanks for any insight.
Ron
Meddle not in the affairs of dragons... for you are crunchy and taste like chicken.
8 REPLIES 8
Ron Kinner
Honored Contributor
Solution

Re: capture data from Serial Port

Think you need a null modem cable. I would expect both devices to be DTE so you will need to reverse the transmit and receive and a couple of the control signals in order for them to talk.

Ron K
Marco Paganini
Respected Contributor

Re: capture data from Serial Port

Hello Ron,

We need more details on how is your setup. How does the PBX application work? Does it open the port and keeps it open?

Paga
Keeping alive, until I die.
Ron Bombard
Frequent Advisor

Re: capture data from Serial Port

I've tried adding a null-modem adapter inline to the device, still dosn't work. I've used a null-modem cable as well.

The Avaya tech didn't really know how the port worked. he thinks it opens then stays open as long as something is receiving data. If nothing is receiving data, "busys" the port out and keeps checking and will "release" the port if something starts receiving data.

I'm just confused. An okidata printer hooked up to it works fine. The printer is set to 9600,8,N,1, with the protocol X-ON/X-OFF. As soon as I plug it in, within a few seconds, it starts printing.

Oh, the software "logserial" defaults to Hardware handshaking. Is THAT X-ON/X-OFF? can never remeber...

Meddle not in the affairs of dragons... for you are crunchy and taste like chicken.
Ron Kinner
Honored Contributor

Re: capture data from Serial Port

Hardware handshaking? Not Hardware flow control? Whatever Xon Xoff is SW flow control not hardware. Hardware toggles control leads like DTR to tell the other end to stop.

Your best bet would be to go down to your friendly Radio Shack and buy one of those little inline detectors (less than $20) that shows the status of the important RS232 leads with LEDs and compare between the printer hookup and the HP. That will tell you which leads need to be where. It may be something simple like not having DTR up all the time.

Also look at:
http://www.tldp.org/HOWTO/Serial-HOWTO-10.html#set_serial

Especially the stty stuff.

Ron
benoit Bruckert
Honored Contributor

Re: capture data from Serial Port

Hi ron,
You can also try this software,
I used (i even make changes on it)
to make reverse Engeeniring on on a serial protocol.
http://www.azstarnet.com/~ymg/software.html

With it you can see all on the serial line...(it's a kind of tcpdump)

hope that help
Benoit
Une application mal pansée aboutit à une usine à gaze (GHG)
Rory R Hammond
Trusted Contributor

Re: capture data from Serial Port

Ron
You might try uucp cu or kermit to talk to the port.

You can log the the session by using the "script" command before starting kermit or cu log output to the.

the program pcomm might also work for you and I think it has logging. (I have used pcomm for years but thought I saw a linux version available.

Rory
There are a 100 ways to do things and 97 of them are right
Jarle Bjorgeengen
Trusted Contributor

Re: capture data from Serial Port

Hi,

what about using minicom, a terminal, and calling program that comes with RH Linux ?

Rgds Jarle
Ron Bombard
Frequent Advisor

Re: capture data from Serial Port

Well, finally it works. Many mistakes were made on my part. First, I didn't know that those 25pin to 9pin adapters crossed pins 2 & 3. So I was slapping one of those adapters on, then pluggin in a null-modem adapter ;)

Then, I've been mostly using Comm1 on the linux box, so I've been using the device "ttyS0". Makes sense? Well, I plugged the cable into Comm1, and used device "ttyS1" and it started working. Must be some screwed up piece of hardware.

Oh well... Now I'm using the software "Logserial" in daemon mode and its logging all data to a file. Works great.

Thanks for all the suggestions everyone!

Meddle not in the affairs of dragons... for you are crunchy and taste like chicken.