James Gray wrote:
Hi All,
I have a serial-based weather station (LaCrosse 2300) and occasionally
it spits the dummy. Probably more to do with the USB->RS232 adapter
than the weather station, but I've found if I unplug the serial cable
from the weather station and plug it back in, everything magically
springs back to life.
So I'm trying to see if sending a break to the serial port will reset
the line like my manual cable pulling exercise (after all, unplugging
a serial cable by definition is a "BREAK" right?). So how about it
folks? Anyone know a neat way to send a serial "BREAK" to a serial
device in bash/c/c++/perl (no python on the system I'm working with).
I've tried:
echo "?BREAK?" > /dev/cua.Serial0 [1]
as root, but no joy. Any pointers gladly accepted :)
It is more likely that the physical break is resetting some of the
control lines such as cts/rts or dtr. There is a very good perl package
called Device::SerialPort that allows full control of the serial port.
--
Mark Pearson BSc (Computing)
Technical Support, Dept Nuclear Medicine
Concord Hospital, Hospital Road, Concord, NSW 2139, Australia
Phone:+61-2-97676339 or +61-297677450; FAX:+61-2-97677451
--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html