Skip to contentSkip to conversation

serial communication problems

DISCUSSION Deepak Gupta 1 participant 1 message May 30, 2002 1 message not in the archive TTY layer and serial drivers

lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive

The stty settings are OK, I believe. Here is the output of "stty -a -F /dev/ttyS0"

speed 9600 baud; rows 0; columns 0; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>; eol2 = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0;
-parenb -parodd cs8 -hupcl -cstopb cread clocal -crtscts -ignbrk -brkint
ignpar -parmrk -inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel
-opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0
ff0
-isig -icanon -iexten -echo echoe
echok -echonl -noflsh -xcase -tostop -echoprt
echoctl echoke

Any idea what else could be wrong?

Deepak

-----Original Message-----
From: Stuart MacDonald [mailto:[email protected]]
Sent: Wednesday, May 29, 2002 7:18 PM
To: Deepak Gupta
Subject: Re: serial communication problems

From: "Deepak Gupta" <[email protected]>

Quoted 4 lines

The problem is that when the vendor software sends a command to a lock it replies obediently but when my program writes exactly the same sequence of bytes to the serial line, I don't get a response (the protocol says that the lock will not respond unless it gets a valid command).

Check your tty layer settings with stty when your program has the port open. You'll need CLOCAL to be set....

Quoted 3 lines

Incidentally I opened up the 232-485 converter box and saw that it uses only the TX, RX, SG, RTS and CTS lines on the RS232 side. So it cannot be a matter of DTR or some other signal.

..because 485 doesn't have the same signal set. Also check CREAD. You'll likely want to set the tty layer into "raw" mode so that your commands don't get character-processed.

..Stu