LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Virtual Null Modem for Linux (https://www.linuxquestions.org/questions/linux-software-2/virtual-null-modem-for-linux-691596/)

adriangolding 12-18-2008 09:27 PM

Virtual Null Modem for Linux
 
i bought a null modem serial cable and tried to use it but it doesn't work (i tried minicom in linux-to-linux and hyperterminal in windows-to-windows setup).

so i was googling and found virtual null modems. anyone knows if theres a reliable and free implementation?

asymptote 12-19-2008 10:44 PM

I'm not familiar with the RS-232 other than seeing them on some machines - I consider this and terminology like DTE/DCE somewhat obsolete. Are you trying to connect to a network device like a switch or router? You do use minicom for that and I can tell you how.

jlinkels 12-20-2008 04:07 PM

What exactly are you trying to achieve? What devices do you try to connect. What kind of data you are trying to send? What are the connectors on both sides? (9-pin F, 9-pin M, 25 pin F/M? etc)

This might be both an application problem (the program which talks to the other program) or a hardware problem with missing handshake signals, or crossed Rx and Tx lines.

If you say you bought a null modem cable, I assume no handshake is needed (therefor it is called null modem) which leaves the eternal Tx/Rx line problem.

jlinkels

michaelk 12-20-2008 04:32 PM

Basically a NULL modem cable cross links the TX and RX lines (and depending on the cable hardware handshaking). It is need when DTEs i.e. computers are connected together. You need to make sure the serial port settings on each computer are configured the same i.e baud rate, stop bits, parity etc. No hardware handshaking is required. What you type on one computer will be displayed on the other. Unless you enable echo you will not see what you type.

A virtual serial port in a nut shell emulates hardware for communication between applications on the same computer.

As already post what are you trying to achieve?

Even though it is considered a legacy port in the desktop computer world I find it far from dead in the embedded and test equipment world.

asymptote 12-20-2008 11:34 PM

I'm not sure about the virtual thing but I can tell you this. I connect a PL-2303 usb-to-serial connector into my laptop and use that to communicate with network devices. It is a male-ending connection. When I plug in the PL-2303 there will be a message in syslog saying where it is assigned in /dev. The PL-2303 usually takes /dev/ttyS0. So I start minicom with root permissions and the -s option. I go to "Serial Modem Setup" and change the /dev/tty8 to /dev/ttyS0 and I change the baud rate to 9600.

Is that the type of information you're looking for? I hope it is.

adriangolding 12-22-2008 08:01 PM

tried null modem serial cable connection on minicom
 
hi guys,

thanks for the replies, i had some problems some time back and i posted in the hardware section: http://www.linuxquestions.org/questi...8/#post3370065

so i was trying to connect 2 PCs together via a null modem serial cable. the reason i need to get this to work is because some other person's research code i'm looking at produces debugging output on the serial port. but before that, i'm trying to get minicom to work on both computers. the connectors on both ends of the null modem serial cable are 9-pin F.

so, i made sure my serial ports are on in the BIOS, my dmesg | grep ttyS output from one side is :
serial8250: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
serial8250: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A
00:07: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
00:08: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A
0000:00:03.3: ttyS2 at I/O 0xec98 (irq = 201) is a 16550

the other side is similar, just that it has only ttyS0.

i executed minicom on both sides and set both sides with the same settings (baud rate etc) but whatever i type on either side does not appear on the other side.

does it mean that probably the cable i bought is physically broken?

thanks guys
-adrian

asymptote 12-27-2008 07:51 AM

I'm not sure that's what it means. This is going beyond my knowledge so I'm just going to give you some educated suggestions. I'm not sure that when you type on one machine you should see it on the other. For example, when I minicom to a router or switch, I can execute commands but if I have another machine minicom'ed into it I don't see those commands appearing. However, if I execute a command that should produce output, like making a configuration change, the resulting output of that command will appear on any machine that is connected and minicom'ed in. I know you're using another machine and not a router or switch but those are the instances where I have used minicom.

Can you execute a command on one of the machines that will produce output on the other? For example, the wall command?

2damncommon 12-27-2008 01:00 PM

Quote:

Originally Posted by adriangolding (Post 3384523)
...so i was trying to connect 2 PCs together via a null modem serial cable. the reason i need to get this to work is because some other person's research code i'm looking at produces debugging output on the serial port...
...i executed minicom on both sides and set both sides with the same settings (baud rate etc) but whatever i type on either side does not appear on the other side.

A serial connection needs a "server" and "client" so to speak.
To connect to one PC with minicom the other needs to be setup to receive serial connections.
If there is supposed to already be output on the serial line, just connect the 2 PCs and try "screen /dev/ttyS0". You may need to install screen, use the serial device of the computer running screen. Maybe that's all you need to see the output.

michaelk 12-27-2008 05:10 PM

The cable may or may not be wired for null modem. If you have some type of ohmmeter or cable testing device basically pin 2 on one end will wired to pin 3 on the other. A serial connection does not have to be server client. I use minicom and or hyperterminal between computers all the time and usually it is a no brainer to get working.

Unless you configure the serial port on one of the computers as a console device you will not be able to execute any commands from the other. Routers, managed switches and any similar serial device will echo back type characters but not in this instance unless minicom is configured to do so.

2damncommon 12-27-2008 05:25 PM

Quote:

Originally Posted by michaelk (Post 3388879)
A serial connection does not have to be server client. I use minicom and or hyperterminal between computers all the time and usually it is a no brainer to get working.

Between two Linux PCs I normally start a getty in inittab to allow a serial login on one PC and use whatever I wish to connect from the other.

How would I do it without doing that?

michaelk 12-27-2008 08:45 PM

Quote:

Between two Linux PCs I normally start a getty in inittab to allow a serial login on one PC and use whatever I wish to connect from the other.
Only if you want to configure a serial port as a console device. The OP only asked to test the cable and the serial ports of the computers.

2damncommon 12-27-2008 11:15 PM

Quote:

Originally Posted by michaelk (Post 3389022)
Only if you want to configure a serial port as a console device. The OP only asked to test the cable and the serial ports of the computers.

Quote:

Originally Posted by adriangolding (Post 3384523)
...the reason i need to get this to work is because some other person's research code i'm looking at produces debugging output on the serial port...

I understood the above as the primary reason and the testing of minicom as secondary to that.

So if he just wants to test the cable and serial ports how does he do that with just minicom?

michaelk 12-28-2008 08:45 AM

We really do not know this research tool functions but just writing data to the serial port does not mean it has to be configured as a console device.

Basically minicom on both computers is configure for the same serial port settings i.e baud rate, parity, stop bits etc (9600,8,N,1). What is typed on one computer should be displayed on the other.

Also since one computer has 3 serial ports are you sure you are using the correct connector?

2damncommon 12-28-2008 12:39 PM

Quote:

Originally Posted by michaelk (Post 3389384)
Basically minicom on both computers is configure for the same serial port settings i.e baud rate, parity, stop bits etc (9600,8,N,1). What is typed on one computer should be displayed on the other.

I would probably use echo to test ("ping") a serial port:
Next, you need to test your serial connection. On one node, which will be the receiver, type:
cat </dev/ttyS0
On the other node, type,:
echo hello >/dev/ttyS0
You should see the text on the receiver node.

Quote:

Originally Posted by michaelk (Post 3389384)
We really do not know this research tool functions but just writing data to the serial port does not mean it has to be configured as a console device.

I am assuming it is not a console but rather somehow just echoing output through the serial port.

Looks like the "cat" command should pick up the debugging output too.


All times are GMT -5. The time now is 03:37 PM.