Results 1 to 10 of 10
Hi,
I just bought a serial header for my board and tried to test it through basic serial communication.
What happens is that any 'echo 123 > /dev/ttyS1' command will ...
- 09-29-2011 #1Just Joined!
- Join Date
- Sep 2011
- Posts
- 10
Can't write to serial port
Hi,
I just bought a serial header for my board and tried to test it through basic serial communication.
What happens is that any 'echo 123 > /dev/ttyS1' command will get nothing on the serial terminal connected to it (Putty, on Windows).
On the other hand, reading from it (with cat /dev/ttyS1) works fine.
Using the board's own serial port (/dev/ttyS0) everything works fine.
I checked the /dev/ttyS* permissions and they have rw.
I'm using Squeeze with kernel 2.6.36.
Can you tell me anything to check?
- 09-29-2011 #2Linux Guru
- Join Date
- May 2011
- Posts
- 1,813
Have you set the baud rate on it yet?
Check it with:
Set it with, e.g.:Code:stty -F /dev/ttyS1
Code:stty -F /dev/ttyS1 115200
- 09-29-2011 #3Just Joined!
- Join Date
- Sep 2011
- Posts
- 10
I didn't configure it, but did a
and got a baud rate of 9600.Code:stty </dev/ttyS1
- 09-29-2011 #4Linux Guru
- Join Date
- May 2011
- Posts
- 1,813
Does your echo command work as expected with the onboard serial port?, e.g.:
Code:echo 123 > /dev/ttyS0
- 09-29-2011 #5Just Joined!
- Join Date
- Sep 2011
- Posts
- 10
Yes, that works fine.
- 09-29-2011 #6Linux Guru
- Join Date
- May 2011
- Posts
- 1,813
If the char device is correct (right maj/min numbers, etc.) and has the write permissions, then you got me.
Anything in dmesg?
Have you put a voltmeter on the pins of the serial cable itself and rung them out, to make sure all the wires are good?
- 09-29-2011 #7Just Joined!
- Join Date
- Sep 2011
- Posts
- 10
Well, I haven't checked the cable pins, but I have tried with two different ones.
Probably, I'll have to check the header pins with a voltimeter.
- 09-29-2011 #8Just Joined!
- Join Date
- Sep 2011
- Posts
- 10
Still didn't get around to find myself a voltmeter....
But I noticed that my FTDI USB-Serial converter lits up the RX light when I do the 'echo 123 > /dev/ttyS1', so something is going on in there...
- 09-30-2011 #9Linux Guru
- Join Date
- May 2011
- Posts
- 1,813
So what are you trying to do with this serial port? Can you run a null modem cable b/t it and your Windows PC , enable serial login on your Linux box and see if your Windows box can log in (via putty , hyperterm, etc.) in that direction?
- 09-30-2011 #10Just Joined!
- Join Date
- Sep 2011
- Posts
- 10
I'm testing it, as I want to connect a serial LCD screen to that port.
So, this is still a testing phase on that port.


Reply With Quote
