# Serial port problems [unsolved]

## btsht23

Heyho,

I am experiencing some problems trying to use my serial port. I just don't get any input from /dev/ttyS0 - it behaves like nothing was connected to it.. although setserial -a /dev/ttyS0 says:

```
/dev/ttyS0, Line 0, UART: 16550A, Port: 0x03f8, IRQ: 4

Baud_base: 115200, close_delay: 50, divisor: 0

closing_wait: 3000

Flags: spd_normal skip_test
```

"dmesg | grep ttyS" returns:

```
serial8250: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A

00:0a: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
```

Does anyone know what I could change to get my serial port working?

Thank you for your help  :Smile: 

Best greez

betasheetLast edited by btsht23 on Tue Dec 26, 2006 8:05 pm; edited 1 time in total

----------

## NeddySeagoon

btsht23,

Whats connected to your serial port ?

can you talk to it with minicom ?

Be aware of the handshake settings, you may need to try all three.

----------

## btsht23

Hi NeddySeagoon,

I tried to use the port with my new USV system, and I also tried a infrared trans- and receiver which should normally send back the bytes to the port sent to him. These to things are functioning with my windows system...

I just don't get any input / reponse from the hardware I connect to the port.

I tried to talk to the infrared trans/receiver by using minicom, but didn't get any response, too. Which handshake settings do you talk about / where can I change them?

Could this all be a kernel configuration / driver problem?

Thanks for your help.

betasheet

----------

## NeddySeagoon

btsht23,

Its flow control, rather than handshake.

You probably want flow control set to none.

Its here Comp

```
│ A -    Serial Device      : /dev/ttyS0                                │

Port│ B - Lockfile Location     : /var/lock                                 │

    │ C -   Callin Program      :                                           │

    │ D -  Callout Program      :                                           │

    │ E -    Bps/Par/Bits       : 115200 8N1                                │

    │ F - Hardware Flow Control : No                                        │

    │ G - Software Flow Control : No   
```

 You also need these setings to be correct

```
                    │   Speed          Parity          Data  │               

               Press│                                        │               

                    │ A: 300           L: None         S: 5  │               

                    │ B: 1200          M: Even         T: 6  │               

                    │ C: 2400          N: Odd          U: 7  │               

                    │ D: 4800          O: Mark         V: 8  │               

                    │ E: 9600          P: Space              │               

                    │ F: 19200                      Stopbits │               

                    │ G: 38400                         W: 1  │            

                    │ H: 57600                         X: 2  │            

                    │ I: 115200        Q: 8-N-1              │            

                    │ J: 230400        R: 7-E-1              │   
```

----------

## btsht23

Well, when I tried to use the infrared rec./trans., I used the same settings I used with my windows pc:

     Speed: 2400

     Parity: none

     Data: 8

     Stopb.: 1

     Hardw.&Softw. Flowcontr.: No

I don't think that there's something wrong...

Do you know which options I should enable in my kernel in order to use the serial port?

Thanks  :Smile: 

betasheet

----------

## NeddySeagoon

btsht23

```

  │ │    <M> 8250/16550 and compatible serial support                            │ │  

  │ │    <M>   8250/16550 PCI device support                                     │ │  

  │ │    (4)   Maximum number of 8250/16550 serial ports                         │ │  

  │ │    (4)   Number of 8250/16550 serial ports to register at runtime          │ │  

  │ │    [ ]   Extended 8250/16550 serial driver options 
```

works for me.

It gives  

```
8250                   22436  0 

serial_core            21888  1 8250
```

in lsmod

To get the serial port registers directly, you need other options, the able allow you to send and receive charaters to /from other serial devices.

If you have /dev/ttyS0 pointing to a real device file, your kernel is OK.

There was a problem a while ago with circular symlinks and no real device file at all for serial ports.

If you have that, delete all the symlinks in the circle and kick udev with udevstart.

It only needs to be fixed once.

----------

## btsht23

Hmm,

my kernel config looks quite the same, and the two modules are loaded, too. I also found an option for serial I/O support, which I tried to enable, too.

The port just behaves like before  :Sad: 

My /dev/ttyS0 points to the correct device, I think, because it is listed by "dmesg | grep ttyS" (see first post)...

Thanks for your help.

betasheet

----------

## NeddySeagoon

btsht23,

I am never sure about the symlinks without looking like this

```
$ ls /dev/ttyS* -l

crw-rw---- 1 root tty 4, 64 Dec 27 09:45 /dev/ttyS0

crw-rw---- 1 root tty 4, 65 Dec 27 09:45 /dev/ttyS1

crw-rw---- 1 root tty 4, 66 Dec 27 09:45 /dev/ttyS2

crw-rw---- 1 root tty 4, 67 Dec 27 09:45 /dev/ttyS3
```

which is correct.

It also raises the question about your group membership. You either need to be root or in the tty group to use the serial ports.

Your previous posts looked like the kernel was talking to the hardware.

You can get my kernel.config here if you want to compare it with your own.

----------

## btsht23

Hi NeddySeagoon,

thanks for your help. But I still didn't solve that problem... "ls /dev/ttyS* -l" looks the same with my machine. I tried this all by using roots account, so I don't think this could be a permissions problem. I also looked through your kernel.config but couldn't locate the problem though.

Don't know what to do  :Sad: 

betasheet

----------

## NeddySeagoon

btsht23,

Invest in a loopback connector (or make one if you have the tools and parts in your 'gander box')

Then minicom can talk to itself via the serial port.

With a null modem cable, you can connect the two serial ports together and run two instances of minicom and talk backwards and forwards.

As you say, its not a permissions issue as you were testing as root.

----------

## 21109

I now have exactly the same problem.

Just installed gentoo on my new laptop, but the f*** serial port will not work on gentoo.

Its also detected via bootup, setserial looks good, but also no connection.

I also tested via a loopback connector... no response.

minicom always says its offline.

Did anyone found a solution for this problem yet?

Alex

----------

## nojoopa

I also had/have (it's been a while since I tried) some problems with the serial port in Gentoo. 

I tried to communicate with a microcontroller (9600 bps) using minicom, "cat /dev/ttyS0" etc and nothing seemed to work. After some tinkering I figured out that the actual serial speed was the (default) 115200 bps even though I changed it to 9600 using "setserial" and minicom's settings. Then I tried to use this program (with "#define BAUDRATE B9600") and it worked! Using Ctrl-C to exit the program leaves the serial speed to 9600 (tested with "cat /dev/ttyS0"), although "setserial -ga /dev/ttyS0" still reports the speed to be 115200.

I suggest you try to run the "Non-Canonical Input Processing" program example first and then your application. I hope this helps. A real fix to the problem would be nice :)

----------

## andip

hi guys,

i got what seems to be the exact same problem as the OP here. one curious thing though.. minicom does not seem to see anything now, but it did earlier today, before i reinstalled my laptop. 

this makes me pretty sure there's nothing wrong with my hardware.

does anyone have any suggestions on how to search for the reason to this problem?

edit : im pretty sure i'm now running a newer version of minicom than i was before, but my portage-tree only has one option atm.

----------

