I have a device (A) that receives packed (unknown interface) RS-232 data, and decodes it to display ASCII text on an LED. I have a recording of that data sent from PC (B) that I sniffed using RealTerm on my Laptop. Let's say we don't know how PC (B) is configured, only the data it sends.. I'm trying to send the same data to the device from PC (C) but the device is unresponsive.
I sniffed the data from PC (B) using B9600, 7 data bits, 1 stop bit, Even parity, no Flow Control; it sent packets in a chunk of X Bytes to update the screen from its COM port. All I know.
On PC (C) I'm running a C program on Linux and talking over USB 2.0 externally converted to RS-232. I've connected to the port and sent X data on the wire, sniffed the data as before and the stream LOOKs exactly the same as from PC (B) on RealTerm, however the device (A) doesn't respond (it is powered and the connection is fine). I assume that while I may be reading the data the same maybe I'm sending it incorrectly...
I'm no expert so I'm poking around. How do I further debug this aside from trying different bit/parity/etc?
My configuration is:
1) open() with "/dev/ttyUSB#", RDWR, NOCTTY, NONBLOCK
2) Set termios i and ospeed to B9600
3) Set termios c_iflags with |= CS7, PARENB, CREAD and &=~ CSTOPB and a few other guesses
4) tcsetattr with TCSANOW
5) Write data out with write()
I sniffed the data from PC (B) using B9600, 7 data bits, 1 stop bit, Even parity, no Flow Control; it sent packets in a chunk of X Bytes to update the screen from its COM port. All I know.
On PC (C) I'm running a C program on Linux and talking over USB 2.0 externally converted to RS-232. I've connected to the port and sent X data on the wire, sniffed the data as before and the stream LOOKs exactly the same as from PC (B) on RealTerm, however the device (A) doesn't respond (it is powered and the connection is fine). I assume that while I may be reading the data the same maybe I'm sending it incorrectly...
I'm no expert so I'm poking around. How do I further debug this aside from trying different bit/parity/etc?
My configuration is:
1) open() with "/dev/ttyUSB#", RDWR, NOCTTY, NONBLOCK
2) Set termios i and ospeed to B9600
3) Set termios c_iflags with |= CS7, PARENB, CREAD and &=~ CSTOPB and a few other guesses
4) tcsetattr with TCSANOW
5) Write data out with write()