Linux - HardwareThis forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
SOLVED: Can't send data on serial port (recieving works)
I am trying to communicate with my GPS reciever (a Magellan SporTrak handheld) via the serial port. If I turn on the continuous reporting on the unit, I can read its output using either minicom or simply cat /dev/ttyS0.
However, I can't seem to send any commands to it. I get no error messages, just nothing happens. I get the exact same results on two different computers, running either Debian, Slackware, Ubuntu, DSL, or FreeBSD. On one of the computers, I managed to get Windows running and it works without a hitch there (except that I had a hard time finding a functioning terminal app), so I know the hardware is ok.
I have been using the serial port before on Linux (although it's been a couple of years now), and have no recollection of there being any special tricks involved. What can I be doing wrong?
--
uname -a
Code:
Linux godzilla 2.6.25-2-486 #1 Fri Jul 18 17:03:35 UTC 2008 i686 GNU/Linux
Yes, the sent data is correct. I have constructed text files with the proper NMEA sentences including \r\n eols. I used the same text files on the Windows machine, so I know they are correct as well.
You have output character substitution on - do you really want that? You can turn it off by requesting 'raw' mode:
stty -F /dev/ttyS0 raw
You can also send code (if it's not too long and inconvenient) via 'echo':
echo -e -n 'blah\n' > /dev/ttyS0
The only other thing I can think of is check the manual for peculiarities of the device; the 'send' and 'receive' rates need not be the same and some devices are peculiar - asking for an 'auto' report for example may send NMEA messages at 4800bps (maximum rate required to meet NMEA specs) while the input side of things runs at another speed. You might also need a slightly different config string when the device is spitting out automatic reports.
not as bad as my experiances with serial communication to GPS devises,
ive had to link RTS to CTS in the past as the GPS device diddnt do hardware flow control
Well, many GPS devices use NMEA-0183, which is not the same as EIA-232. It uses the same (or nearly so) over-the-wire protocol, but only has ground (typically the ships pseudo-ground, ie the minus pole of the battery), and data wires (each unit is either a listener or a talker).
My particular unit (as most hand-helds) is intended for communication with a PC, so has a more complete EIA-232 support, including speeds up to 19k2 baud, which is nice.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.