Skip Menu |

This queue is for tickets about the Net-CLI-Interact CPAN distribution.

Report information
The Basics
Id: 103227
Status: resolved
Priority: 0/
Queue: Net-CLI-Interact

People
Owner: OLIVER [...] cpan.org
Requestors: steve.kersley [...] keble.ox.ac.uk
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 2.200002
Fixed in: (no value)



Subject: Parameters passed to 'cu' on Linux prevent serial connection
Date: Tue, 31 Mar 2015 14:30:26 +0000
To: "bug-Net-CLI-Interact [...] rt.cpan.org" <bug-Net-CLI-Interact [...] rt.cpan.org>
From: Steve Kersley <steve.kersley [...] keble.ox.ac.uk>
Hi Oliver, The 'serial' transport is failing to connect to serial ports from Linux [using Ubuntu 14.04, with the distribution package of 'cu' - also using the distribution packages for net-appliance-session (v 4.131260); net-cli-interact (v 2.133420) etc which are a few minor versions behind, but have checked and the specific code looks the same in current version] I'm calling Net::Appliance::Session->new() passing in: { transport => 'Serial', personality => 'ios', do_login => 0, connect_options => { device => '/dev/ttyUSB0' } } ..but it fails to connect: [ 0.048308] tr creating Net::Telnet wrapper for cu [ 0.055333] tr connecting with: cu --parity=none '-l /dev/ttyUSB0' '-s 9600' [ 0.196861] du SEEN: cu: open (/dev/ /dev/ttyUSB0): No such file or directory From testing on the command line cu fails with the above error if there is a space between -l and /dev/..., and if the parameter is enclosed in quotes (as seen in the debug log). Serial.pm does explicitly put a space between -l and whatever device has been specified - if I remove that space then it appears to connect (my script then fails for other reasons not yet investigated, but never mind...). Cannot say whether this change would break on other OSes however. All the best, Steve.
Hi Steve, Many thanks for reporting this. It looks like you've already poked around and found Serial.pm :-) I suspect that the root of the problem is in the concat operator "." making -l and -s one option together with their value, which is wrong. Using the list operator "," is probably smarter. Would you be willing to try changing the "." for a "," in those two lines (and perhaps remove the whitespace after the option flag as well)? regards, oliver. On Tue Mar 31 10:30:50 2015, steve.kersley@keble.ox.ac.uk wrote: Show quoted text
> Hi Oliver, > The 'serial' transport is failing to connect to serial ports from > Linux [using Ubuntu 14.04, with the distribution package of 'cu' - > also using the distribution packages for net-appliance-session (v > 4.131260); net-cli-interact (v 2.133420) etc which are a few minor > versions behind, but have checked and the specific code looks the same > in current version] > > I'm calling Net::Appliance::Session->new() passing in: > { > transport => 'Serial', > personality => 'ios', > do_login => 0, > connect_options => { > device => '/dev/ttyUSB0' > } > } > > ..but it fails to connect: > > [ 0.048308] tr creating Net::Telnet wrapper for cu > [ 0.055333] tr connecting with: cu --parity=none '-l /dev/ttyUSB0' > '-s 9600' > [ 0.196861] du SEEN: > cu: open (/dev/ /dev/ttyUSB0): No such file or directory > > From testing on the command line cu fails with the above error if > there is a space between -l and /dev/..., and if the parameter is > enclosed in quotes (as seen in the debug log). Serial.pm does > explicitly put a space between -l and whatever device has been > specified - if I remove that space then it appears to connect (my > script then fails for other reasons not yet investigated, but never > mind...). Cannot say whether this change would break on other OSes > however. > > All the best, > Steve.
-- regards, oliver.
hi Steve, Thanks for the bug report, I've patched the code for my suggested fix for the next release. -- regards, oliver.