[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Data from a serial port



On 10/2/2014 8:24 PM, Ethan Rosenberg wrote:
> On 10/01/2014 03:20 PM, Dan Ritter wrote:
>> On Sat, Sep 27, 2014 at 11:26:48PM -0400, Ethan Rosenberg, PhD wrote:
>>> Dear List -
>>>
>>> I have an Avery Berkel POS  [Point Of Sale] scale which I wish to
>>> integrate into a POS system. The output is sent to a RS232 port. I
>>> do not know how to extract the data.
>>>
>>> Here is what I have about the RS232 port:
>>>
>>> ethan@meow:~$ dmesg | grep tty
>>> [    0.000000] console [tty0] enabled
>>> [    0.383854] 00:07: ttyS0 at I/O 0x3f8 (irq = 4, base_baud =
>>> 115200) is a 16550A
>>> [    0.404352] 0000:00:03.3: ttyS1 at I/O 0x1c90 (irq = 17, base_baud
>>> = 115200) is a 16550A
>>>
>>>
>>> root@meow:/home/ethan#  setserial -g /dev/ttyS[0123]
>>> /dev/ttyS0, UART: 16550A, Port: 0x03f8, IRQ: 4
>>> /dev/ttyS1, UART: 16550A, Port: 0x1c90, IRQ: 17
>>> /dev/ttyS2, UART: unknown, Port: 0x03e8, IRQ: 4
>>> /dev/ttyS3, UART: unknown, Port: 0x02e8, IRQ: 3
>>>
>>>
>>> More info from the manual --
>>>
>>> 9600 baud, 7 data bits, even parity, 1 stop bit
>>>
>>> Transmits weight and scale status whenever ASCII 'W'<CR> is sent by
>>> the POS terminal.
>>
>> Well, one option would be to install minicom (apt-get will find
>> it for you), set your default serial port to /dev/ttyS0, set it
>> at 9600,7,e,1. Then plug it in and see if tapping W gets you
>> a response.
>>
>> /dev/ttyS0 will look just like a file, if you're writing a
>> program, and you can read from it and write to it just like any
>> other file.
>>
>> -dsr-
>>
> Dan -
> 
> EXCELLENT!!
> 
> Minicom set up as  9600,7,e,1.
> Terminal ANSI
> No response from tapping W.
> 
> TIA
> 
> Ethan
> 
> 

In addition to Dan's comments - is your cable OK?  Do you need a
straight-through cable or a cross-over cable?  Does the terminal
require/honor DSR/TSR and RTS/CTS?  If so, are these lines active?

You may need a breakout box on the cable to see what's happening on the
lines.

Jerry


Reply to: