LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-18-2008, 09:27 PM   #1
adriangolding
LQ Newbie
 
Registered: Nov 2008
Posts: 3

Rep: Reputation: 0
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?
 
Old 12-19-2008, 10:44 PM   #2
asymptote
Member
 
Registered: Mar 2008
Posts: 236

Rep: Reputation: 37
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.
 
Old 12-20-2008, 04:07 PM   #3
jlinkels
LQ Guru
 
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195

Rep: Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043
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
 
Old 12-20-2008, 04:32 PM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,745

Rep: Reputation: 5924Reputation: 5924Reputation: 5924Reputation: 5924Reputation: 5924Reputation: 5924Reputation: 5924Reputation: 5924Reputation: 5924Reputation: 5924Reputation: 5924
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.

Last edited by michaelk; 12-20-2008 at 04:38 PM.
 
Old 12-20-2008, 11:34 PM   #5
asymptote
Member
 
Registered: Mar 2008
Posts: 236

Rep: Reputation: 37
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.
 
Old 12-22-2008, 08:01 PM   #6
adriangolding
LQ Newbie
 
Registered: Nov 2008
Posts: 3

Original Poster
Rep: Reputation: 0
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
 
Old 12-27-2008, 07:51 AM   #7
asymptote
Member
 
Registered: Mar 2008
Posts: 236

Rep: Reputation: 37
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?
 
Old 12-27-2008, 01:00 PM   #8
2damncommon
Senior Member
 
Registered: Feb 2003
Location: Calif, USA
Distribution: PCLINUXOS
Posts: 2,918

Rep: Reputation: 103Reputation: 103
Quote:
Originally Posted by adriangolding View Post
...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.
 
Old 12-27-2008, 05:10 PM   #9
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,745

Rep: Reputation: 5924Reputation: 5924Reputation: 5924Reputation: 5924Reputation: 5924Reputation: 5924Reputation: 5924Reputation: 5924Reputation: 5924Reputation: 5924Reputation: 5924
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.
 
Old 12-27-2008, 05:25 PM   #10
2damncommon
Senior Member
 
Registered: Feb 2003
Location: Calif, USA
Distribution: PCLINUXOS
Posts: 2,918

Rep: Reputation: 103Reputation: 103
Quote:
Originally Posted by michaelk View Post
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?
 
Old 12-27-2008, 08:45 PM   #11
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,745

Rep: Reputation: 5924Reputation: 5924Reputation: 5924Reputation: 5924Reputation: 5924Reputation: 5924Reputation: 5924Reputation: 5924Reputation: 5924Reputation: 5924Reputation: 5924
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.
 
Old 12-27-2008, 11:15 PM   #12
2damncommon
Senior Member
 
Registered: Feb 2003
Location: Calif, USA
Distribution: PCLINUXOS
Posts: 2,918

Rep: Reputation: 103Reputation: 103
Quote:
Originally Posted by michaelk View Post
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 View Post
...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?
 
Old 12-28-2008, 08:45 AM   #13
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,745

Rep: Reputation: 5924Reputation: 5924Reputation: 5924Reputation: 5924Reputation: 5924Reputation: 5924Reputation: 5924Reputation: 5924Reputation: 5924Reputation: 5924Reputation: 5924
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?
 
Old 12-28-2008, 12:39 PM   #14
2damncommon
Senior Member
 
Registered: Feb 2003
Location: Calif, USA
Distribution: PCLINUXOS
Posts: 2,918

Rep: Reputation: 103Reputation: 103
Quote:
Originally Posted by michaelk View Post
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 View Post
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to handle kernel NULL pointer dereference at virtual address 00000000 hallimanju Linux - Software 3 06-18-2010 02:14 AM
yellowdog linux pppd + macos 6 + null modem frieza Linux - Networking 0 01-20-2007 02:28 PM
Unable to handle kernel NULL pointer dereference at virtual address 00000000 geniuspraju Linux - Kernel 3 11-08-2006 10:48 AM
Unable to handle kernel NULL pointer dereference at virtual ...? severedhead Linux - Software 0 07-12-2002 04:46 PM
Null modem networking Linux/Win98 vector Linux - Networking 1 03-28-2002 12:57 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:01 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration