in reply to How to send long sting Device::SerialPort
numbers up to 8 are sent, nothing after that
That implies that your UART (or UART emulation) has a hard limit buffer of 15 -- strange in this day and age, but not impossible -- in which case, perhaps it will like it better if you only send a max of 15-bytes at a time.
Try adding your own write method wrapper that breaks the string up into 15-byte chunks. Eg.
sub myWrite { my( $port, $data ) = @_; for my $chunk ( unpack '(a15)*', $data ) { $port->write( $chunk ); sleep 0.1; ## may not be necessary; or maybe 0.001 is enough; +experiment. } } ... # $ob->write( "$string\n"); myWrite( $ob, $string );
Of course, if you have time to waste, you could subclass Device::Serial and override write ...
|
|---|