LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   writing to /reading from serial port (https://www.linuxquestions.org/questions/programming-9/writing-to-reading-from-serial-port-4175418770/)

abd_bela 07-26-2012 07:21 AM

writing to /reading from serial port
 
1 Attachment(s)
Hi every body

I hope find an answer thanks a lot.

I have written 2 small programs for writing on serial port S0 and another for reading from the port S1.
My machines have 2 physical serial port.
I connect the S0 to S1 via a crossed cable.

On one machine the programs ran perfectly,
when I tried them on another machine, exactly same machine running same system ( linuxMint),
in same conditions, they didn't.


the writing program to port S0 ran but the reading from S1 !!!
the situation is like no physical connection on 2 port exits!!! It is of course;


Very strange, so may be the I have to do something to activate the ports ???
Why it run on one case and not on another!!!

the programs are attached
thanks a lot for any idea.

regards

NevemTeve 07-26-2012 09:09 AM

try this (as root):
Code:

dmesg | grep ttyS
on my PC:

Code:

[    0.214607] 00:0c: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
[    0.234844] 0000:00:03.3: ttyS1 at I/O 0x2450 (irq = 17) is a 16550A



All times are GMT -5. The time now is 12:19 PM.