LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-15-2011, 05:06 AM   #1
ShwetaRuhela
LQ Newbie
 
Registered: Sep 2011
Posts: 3

Rep: Reputation: Disabled
Serial Port Problem


Hi,

I have serial port recognized in window as COM11.
I configured this as COM2 and i am able to communicate with this port via Hyperterminal/Realterm.

Same Port i want to access in Ubuntu.
I am using Ubuntu 10.04 LTS.

I testes both /dev/ttyS0 and /dev/ttyS1 with baudrate 9600 (or 115200) via minicom/gtkterm in loopback mode(keeping shorted RX and Tx lines in DB9 male connector). No one is responding.

I checked Serial ports using command...

>dmesg | grep ttyS

[ 1.870186] serial8250: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
[ 1.870461] 00:05: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A

Serial port is enabled. i have checked in BIOS information.

Device driver list for serial port is this...

8250_accent.ko 8250_boca.ko 8250_exar_st16c554.ko 8250_fourport.ko 8250_hub6.ko 8250_mca.ko jsm max3100.ko serial_cs.ko

USB to serial converter (/dev/ttyUSB0) work best with minicom.
But i want to use serial ports not USB.

How i can use my serial port?
plz help me...

Regards,
Shweta Ruhela
 
Old 09-15-2011, 11:02 AM   #2
jmulligan
LQ Newbie
 
Registered: Oct 2006
Posts: 4

Rep: Reputation: 1
How many serial ports does your system have? Is ttyS0 the only match to ttyS in the dmesg output? It is odd that your port comes up as COM11 under Windows, is this port on the motherboard?

Connecting the transmit and receive pins to one another may not be enough; you should be able to configure or disable hardware handshaking in minicom. Usually when you are wiring up a 3-wire cable for serial communications (Tx,Rx,ground), you connect various pins in the connector shell - I don't remember the details but you should be able to find them easily, things like CTS to DSR, etc. A breakout adapter with LED's that display the states of the various lines is useful in these situations...

good luck!
 
Old 09-15-2011, 11:06 AM   #3
Kruppt
LQ Newbie
 
Registered: May 2011
Posts: 8

Rep: Reputation: 3
Quote:
Originally Posted by ShwetaRuhela View Post
Hi,

I have serial port recognized in window as COM11.
I configured this as COM2 and i am able to communicate with this port via Hyperterminal/Realterm.

Same Port i want to access in Ubuntu.
I am using Ubuntu 10.04 LTS.

I testes both /dev/ttyS0 and /dev/ttyS1 with baudrate 9600 (or 115200) via minicom/gtkterm in loopback mode(keeping shorted RX and Tx lines in DB9 male connector). No one is responding.

I checked Serial ports using command...

>dmesg | grep ttyS

[ 1.870186] serial8250: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
[ 1.870461] 00:05: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A

Serial port is enabled. i have checked in BIOS information.

Device driver list for serial port is this...

8250_accent.ko 8250_boca.ko 8250_exar_st16c554.ko 8250_fourport.ko 8250_hub6.ko 8250_mca.ko jsm max3100.ko serial_cs.ko

USB to serial converter (/dev/ttyUSB0) work best with minicom.
But i want to use serial ports not USB.

How i can use my serial port?
plz help me...

Regards,
Shweta Ruhela
Install setserial.

Run command as below in root term.

[root@MS-7005-archbang ~]# setserial -g /dev/ttyS[0,1,2,3]

/dev/ttyS0, UART: 16550A, Port: 0x03f8, IRQ: 4
/dev/ttyS1, UART: unknown, Port: 0x02f8, IRQ: 3
/dev/ttyS2, UART: unknown, Port: 0x03e8, IRQ: 4
/dev/ttyS3, UART: unknown, Port: 0x02e8, IRQ: 3

Notice ttyS1-ttyS3 are not setup in my case.
Use setserial to setup/configure the ports you need to use.

As an Example, In my case, I would run command below in root terminal to enable/setup ttyS1:

setserial /dev/ttyS1 port 0x02f8 UART 16550A irq 3 Baud_base 115200

Add the line to your rc.local or equivalent script if you want it enabled upon bootup.
 
1 members found this post helpful.
Old 09-15-2011, 01:45 PM   #4
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,396
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
I prefer C-Kermit for testing serial port functionality.
Code:
(/home/theNbomr/) C-Kermit>set port /dev/ttyS0
(/home/theNbomr/) C-Kermit>set carrier-watch off
(/home/theNbomr/) C-Kermit>set handshake none 
(/home/theNbomr/) C-Kermit>set flow-control none
(/home/theNbomr/) C-Kermit>connect
Connecting to /dev/ttyS0, speed 9600
 Escape character: Ctrl-\ (ASCII 28, FS): enabled
Type the escape character followed by C to get back,
or followed by ? to see other options.
Use your loopback jumpers, and type some keys. If the port is functional, you should see the keystrokes echoed to the terminal.
--- rod.
 
Old 09-16-2011, 03:22 AM   #5
ShwetaRuhela
LQ Newbie
 
Registered: Sep 2011
Posts: 3

Original Poster
Rep: Reputation: Disabled
Hi,

Thanks for reply.

I checked my serial port via window 7. There are two RS232 "High speed PCI serial ports".
These were pluged in my PC via PCI peripheral controller from Mos chip technology manufacturer (Part No MCS9865).

In window when driver is installed, they took their port number COM10 and COM11 by default.
We can change port number. So i changed COM11 into COM2 because COM2 was not in use.

In window there IO range starts from 0x0D30 to 0x0D27, and interrupt numbers assigned are 17 and 18.

Plz guide me further how i can enable these serial ports in Ubuntu?

first i know i need to installed its driver in linux.

Many thanks for being towards solving this problem.

Regards,
Shweta Ruhela
 
Old 09-16-2011, 04:54 AM   #6
ShwetaRuhela
LQ Newbie
 
Registered: Sep 2011
Posts: 3

Original Poster
Rep: Reputation: Disabled
Hi,

My problem has solved Now!

I first downloaded driver for "PCI to Peripheral controller" for MCS9865 from link "http://www.asix.com.tw/products.php?op=pItemdetail&PItemID=125;74;111&PLine=74".

After having installed driver i was able to see device file in dmesg as well as setserial command.

>dmesg | grep 'tty'

[ 0.000000] console [tty0] enabled
[ 0.297632] serial8250: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
[ 0.297914] 00:05: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
[ 307.471066] 0000:04:00.0: ttyD0 at I/O 0xd030 (irq = 17) is a mcs9865-serial
[ 307.471276] 0000:04:00.1: ttyD1 at I/O 0xd020 (irq = 18) is a mcs9865-serial
[ 307.484367] No of Errors In ttyD0 brake=0 frame=0 parity=0 overrun=0
[ 319.843703] No of Errors In ttyD1 brake=0 frame=0 parity=0 overrun=0

Then i set terminal as per my communication requirement.
This work best.

Thanks a lot

Regards,
Shweta Ruhela
 
Old 09-16-2011, 11:48 AM   #7
Kruppt
LQ Newbie
 
Registered: May 2011
Posts: 8

Rep: Reputation: 3
Talking

Quote:
Originally Posted by ShwetaRuhela View Post
Hi,

My problem has solved Now!

I first downloaded driver for "PCI to Peripheral controller" for MCS9865 from link "http://www.asix.com.tw/products.php?op=pItemdetail&PItemID=125;74;111&PLine=74".

After having installed driver i was able to see device file in dmesg as well as setserial command.

>dmesg | grep 'tty'

[ 0.000000] console [tty0] enabled
[ 0.297632] serial8250: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
[ 0.297914] 00:05: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
[ 307.471066] 0000:04:00.0: ttyD0 at I/O 0xd030 (irq = 17) is a mcs9865-serial
[ 307.471276] 0000:04:00.1: ttyD1 at I/O 0xd020 (irq = 18) is a mcs9865-serial
[ 307.484367] No of Errors In ttyD0 brake=0 frame=0 parity=0 overrun=0
[ 319.843703] No of Errors In ttyD1 brake=0 frame=0 parity=0 overrun=0

Then i set terminal as per my communication requirement.
This work best.

Thanks a lot

Regards,
Shweta Ruhela
Ah, you installed a PCI card.
I had to install one myself in a E521.
Threw me off there a bit,
as these PCI cards (MCS) show up as /dev/ttyD[0,1,2,etc] devices,
and not /dev/ttyS[0,1,2,3] devices depending on how many com ports are available on card.
Glad you resolved the problem.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Serial port problem balaqemu Programming 4 08-29-2011 01:45 PM
Is a USBtty (USB serial port) treated the same as tty (normal serial port) in C? spudgunner Programming 1 11-12-2010 02:19 PM
serial port problem! kievari Programming 3 02-08-2010 06:27 PM
Serial port problem! instcode Ubuntu 3 01-06-2007 12:19 AM
Serial port problem floydes Programming 1 10-14-2004 12:50 PM


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

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration