ASCII input from USB in Linux

nfamous

Member
Nov 26, 2004
171
0
0
I'm trying to hook a scale system up to our chem lab inventory computer, and the tech support from the manufacturer has been less than helpful. To quote them:

"The balance just outputs an ASCII text string in an RS232 format. They will work with any
generic communications program"

The system hooks up to the computer through USB, and creates a virtual rs232 serial port.

How can I get this to come in as keyboard input in red hat? The reason we purchased the scales was because it was advertised as being able to do that, with no mention of any communications program. I can get it working in windows, but so far, only by using a serial data logging program that listens to com port x (whatever the virtual port is registered as). grrrr.

Any ideas?
 

jiggahertz

Golden Member
Apr 7, 2005
1,532
0
76
Originally posted by: nfamous
I'm trying to hook a scale system up to our chem lab inventory computer, and the tech support from the manufacturer has been less than helpful. To quote them:

"The balance just outputs an ASCII text string in an RS232 format. They will work with any
generic communications program"

The system hooks up to the computer through USB, and creates a virtual rs232 serial port.

How can I get this to come in as keyboard input in red hat? The reason we purchased the scales was because it was advertised as being able to do that, with no mention of any communications program. I can get it working in windows, but so far, only by using a serial data logging program that listens to com port x (whatever the virtual port is registered as). grrrr.

Any ideas?

I believe you need to know the baud rate. To set up my usb gps mouse i do something along the lines of

> stty -F /dev/usb/tts/0 4800

where 4800 is te buad rate.

To echo the stream to your console try

> cat < /dev/usb/tts/0

 

nfamous

Member
Nov 26, 2004
171
0
0
Thank you, you are starting to point me in the right direction, I believe.

The device is being registered as /dev/usb/ttyUSB0. The cat command isn't working though. I just get a blank line. I think it might be because I'm not sure if the scale sends sends a newline character at the end of it's ASCII transmission.