Shop OBEX P1 Docs P2 Docs Learn Events
Echoing a string to a RS232 com port with Linux — Parallax Forums

Echoing a string to a RS232 com port with Linux

BlackCowBlackCow Posts: 4
edited 2008-08-20 19:12 in General Discussion
So I took a 9 pin comport connector and soldered wires to pin 3 for transmit 2 for recive and 5 for ground. I eventually want to get it talking to my stamp micro controller.

So I have it hooked up to a computer running Ubuntu Linux. I drug out my dads old oscilloscope to test to see if I get an output through the wire.

To test it I typed in a terminal,

echo "hello world" > /dev/ttys0



and I get this error,
bash: ttys0: Input/output error



I also tried ttys1 to make sure I had the right com port. Does anyone here know what I am doing wrong?

Comments

  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2008-08-20 03:15
    I think you need to capitialize the "S" in "ttyS0".

    -Phil

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    'Still some PropSTICK Kit bare PCBs left!
  • BlackCowBlackCow Posts: 4
    edited 2008-08-20 03:26
    Phil Pilgrim (PhiPi) said...
    I think you need to capitialize the "S" in "ttyS0".

    -Phil

    Ok so I used ttyS0 instead and I hit return with no errors but im also not getting anything across the wire :-/
    I'm trying to use something called PySerial which uses python to talk to the com port but im not having much luck with that.

    Has anyone here done this before who could tell me what I need to do?

    Post Edited (BlackCow) : 8/20/2008 3:33:31 AM GMT
  • FranklinFranklin Posts: 4,747
    edited 2008-08-20 03:31
    Well, to start I'd fire up a terminal program like minicom and try talking to the port. If that does not work check your wiring. Remember if you talk from the pc to the stamp you need to use a level converter to reduce the +/- 12v signals to +5v

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2008-08-20 11:27
    You need to install Linux Minicom or other serial terminal software to properly interface.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    It's sunny and warm here. It is always sunny and warm here.... (unless a typhoon blows through).

    Tropically, G. Herzog [noparse][[/noparse] 黃鶴 ] in Taiwan
  • BlackCowBlackCow Posts: 4
    edited 2008-08-20 19:12
    Ah it was a weiring problem, sloppy soldering caused a short.

    echo "string" > /dev/ttyS0 and the program Minicom both show something on the oscilloscope. Thanks for your help!
Sign In or Register to comment.