Find the answer to your Linux question:
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 ...
  1. #1
    Just 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?

  2. #2
    Linux Guru
    Join Date
    May 2011
    Posts
    1,813
    Have you set the baud rate on it yet?

    Check it with:
    Code:
    stty -F /dev/ttyS1
    Set it with, e.g.:
    Code:
    stty -F /dev/ttyS1 115200

  3. #3
    Just Joined!
    Join Date
    Sep 2011
    Posts
    10
    I didn't configure it, but did a
    Code:
    stty </dev/ttyS1
    and got a baud rate of 9600.

  4. #4
    Linux 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

  5. #5
    Just Joined!
    Join Date
    Sep 2011
    Posts
    10
    Yes, that works fine.

  6. #6
    Linux 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?

  7. #7
    Just 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.

  8. #8
    Just 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...

  9. #9
    Linux 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?

  10. #10
    Just 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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •