in reply to need to capture serial port output
example running of script:
What this does is take Standard Input from the serial port, tee puts a copy in input.txt, then pipes the data to your script, and finially all script output is sent through tee which logs it to a file again then out the serial port.# tee input.txt</dev/ttyS0 | perl-prog.pl | tee output.txt >/dev/ttyS0
When you write your perl script you just have to treat it like a user was typing in the data. Great when developing, as you just run the program and type in what you want. You let Linux handle all the IO to the serial port.
Here's the actual start job from an old script:
By linking tee to SMDRdbctee it's easy to see when doing ps.# start job SMDRdbctee harris.in < /dev/ttyr0a | SMDRdbc interfce | SMDRdbctee har +ris.out > /dev/ttyr0a &
But in recent years I also moved onto Expect also for this type of work. ronzo
|
|---|