http://qs1969.pair.com?node_id=259489

BronzeWing has asked for the wisdom of the Perl Monks concerning the following question:

Greetings, fellow monks.
I'm having an unusual (judging by the google results) problem with the Win32::SerialPort module. Following is the error, and the relevant code.

The error:

Missing REQUIRED setting for BAUD at Foo.pm line 35 write_settings failed, closing port at Foo.pm line 35 Failed to write settings at Foo.pm line 35.

The code: (Foo.pm lines 26-35)

my $Serial = new Win32::SerialPort('COM1') or die "Serial port died"; $Serial->baudrate(115200); $Serial->parity('none'); $Serial->databits(8); $Serial->stopbits(1); $Serial->handshake('none'); $Serial->buffers(4096, 4096); $Serial->error_msg(1); $Serial->user_msg(1); $Serial->write_settings || die "Failed to write settings";

The error shows up after booting the computer, and after using any program that communicates with the serial port at a different baud rate. I can only seem to resolve it by running something that opens the serial port at my preferred baud rate (115200), such as setting it in HyperTerminal.

Have any of you had any experience with this error? Can I do whatever HyperTerminal and the other programs do to make the baud rate valid? Am I just missing a line somewhere? Thanks.

-BronzeWing