serial communication problems
Hi,
I have a strange problem with the serial line communication in Linux (RH 7.2, kernel 2.4.7-10). We have some electronic locks that are controlled by a PC. The locks are connected by a RS485 twisted pair (multidrop) and this line terminates in a 485-232 converter box which is connected via the serial line to a PC. The lock vendor has supplied a Windows software to program the locks which works fine on this PC. He has also given me the protocol that is followed between the PCs and the locks. I am trying to write my own Linux based software for programming the locks.
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). I know the locks use 9600 baud, 8 bits, no parity, 1 stop bit and I am using the same. I also tried with and without hardware flow control (RTS/CTS) but no luck. I know that the command I send is right since I used another PC to listen to what the vendor software writes on the serial line and it matches the protocol description that I have.
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.
Please help.
Deepak Gupta
Quoted 22 lines · Deepak Gupta
Hi,
I have a strange problem with the serial line communication in Linux (RH 7.2, kernel 2.4.7-10). We have some electronic locks that are controlled by a PC. The locks are connected by a RS485 twisted pair (multidrop) and this line terminates in a 485-232 converter box which is connected via the serial line to a PC. The lock vendor has supplied a Windows software to program the locks which works fine on this PC. He has also given me the protocol that is followed between the PCs and the locks. I am trying to write my own Linux based software for programming the locks.
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). I know the locks use 9600 baud, 8 bits, no parity, 1 stop bit and I am using the same. I also tried with and without hardware flow control (RTS/CTS) but no luck. I know that the command I send is right since I used another PC to listen to what the vendor software writes on the serial line and it matches the protocol description that I have.
Quoted 4 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.
I had a similar problem a few days ago.
Old software worked, new one did not.
So I also used a third PC to look what the others talk. I noticed the same as you.
Solution was that RTS had to be set active.
Quoted 8 lines
Please help.
Deepak Gupta
-
To unsubscribe from this list: send the line "unsubscribe linux-serial" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Gerald Emig
--
EMIG Software Tel. 06858-6197, Mobil: 0163-4751706
Engelstr. 17 Fax. 0721-151-348672
66564 Ottweiler-Fürth http://sites.inka.de/heisch
Germany e-mail: [email protected]
-
To unsubscribe from this list: send the line "unsubscribe linux-serial" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
RTS is active as reported by /proc/tty/driver/serial. In fact all three of RTS, CTS, and DTR are shown active.
What else could be wrong?
Deepak
-----Original Message-----
From: Gerald Emig [mailto:[email protected]]
Sent: Wednesday, May 29, 2002 7:37 PM
To: Deepak Gupta
Cc: [email protected]
Subject: Re: serial communication problems
Quoted 22 lines · Deepak Gupta
Hi,
I have a strange problem with the serial line communication in Linux (RH 7.2, kernel 2.4.7-10). We have some electronic locks that are controlled by a PC. The locks are connected by a RS485 twisted pair (multidrop) and this line terminates in a 485-232 converter box which is connected via the serial line to a PC. The lock vendor has supplied a Windows software to program the locks which works fine on this PC. He has also given me the protocol that is followed between the PCs and the locks. I am trying to write my own Linux based software for programming the locks.
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). I know the locks use 9600 baud, 8 bits, no parity, 1 stop bit and I am using the same. I also tried with and without hardware flow control (RTS/CTS) but no luck. I know that the command I send is right since I used another PC to listen to what the vendor software writes on the serial line and it matches the protocol description that I have.
Quoted 4 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.
I had a similar problem a few days ago.
Old software worked, new one did not.
So I also used a third PC to look what the others talk. I noticed the same as you.
Solution was that RTS had to be set active.
Quoted 8 lines
Please help.
Deepak Gupta
-
To unsubscribe from this list: send the line "unsubscribe linux-serial" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Gerald Emig
--
EMIG Software Tel. 06858-6197, Mobil: 0163-4751706
Engelstr. 17 Fax. 0721-151-348672
66564 Ottweiler-Fürth http://sites.inka.de/heisch
Germany e-mail: [email protected]
-
To unsubscribe from this list: send the line "unsubscribe linux-serial" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html