I need to read some data from a web server and output to a serial port on the local machine. I was attempting to use the following command:
Code:
wget -q -O/dev/ttyS0 http://<IP address>/<filename>.asp?LID=12345
But the device attached to the serial port (a plate embosser) acts as though there is an extra newline after each line of data.
It parses the data sent according to it's own format, which includes a format string in <> followed by a data block containing one data field per line, with the whole block surrounded by <>, for example:
Code:
<]01Y425X472 Y55X50F0 Y110X50F0 Y165X50F0 Y220X50F0 Y55X250F0 Y275X50F0 Y330X50F0 Y330X180F0 Y330X180F0 Y385X50F0 Y385X330F0 Y275X290F0 Y330X290F0>
<0501175
OX-31160/XCM6090
Y-BFW-7155-A34A-SH1
Y-7155-BFW-16
AREA Y
NONE
.
. .
. 1 OF 5
12345
.
.>
seems to output as though it were:
Code:
<]01Y425X472 Y55X50F0 Y110X50F0 Y165X50F0 Y220X50F0 Y55X250F0 Y275X50F0 Y330X50F0 Y330X180F0 Y330X180F0 Y385X50F0 Y385X330F0 Y275X290F0 Y330X290F0>
<0501175
OX-31160/XCM6090
Y-BFW-7155-A34A-SH1
Y-7155-BFW-16
AREA Y
NONE
.
. .
. 1 OF 5
12345
.
.>
I can verify that the web server is outputting the former (and it looks correct if I send the wget output to console).