R
rolfedh
I'll ask the questions first, and then show the code and examples
below:
waitfor is timing the script out. Is it because it isn't recognizing
that password input is complete? or is it because the device doesn't
issue a command prompt after the password is input? (The user has to
hit the Enter key to get the command prompt)?
I've interjected comments on the behavior of the script with <ROLFE-...
below.
I'm running the following script to log on to a peice of hardware:
require 'net/telnet'
tn = Net::Telnet.new('Host' => '192.168.47.150') { |str|
print str }
tn.login("myusername", "mypassword") { |str| print str }
This is how script displays in FreeRIDE:
Connected to 192.168.47.150.
WELCOME TO SYMMETRICOM NETWORK INTERFACE!
USER NAME: myusername
<ROLFE-It pauses here for a little while, and then continues with:>
PASSWORD: mypassword
NETWORK INTERFACE 192-8001 (c) 1998 - 2006 SYMMETRICOM
ALL RIGHTS RESERVED
LOGIN SUCCESSFUL!
c:/ruby/lib/ruby/1.8/net/telnet.rb:551:in `waitfor': timed out
while waiting for more data (Timeout::Error)
from c:/ruby/lib/ruby/1.8/net/telnet.rb:678:in `cmd'
from c:/ruby/lib/ruby/1.8/net/telnet.rb:725:in `login'
from c:/Documents and Settings/rdlugyhegwer/sampler.rb:4
If I log in using a terminal program, it looks like this:
WELCOME TO SYMMETRICOM NETWORK INTERFACE!
USER NAME: myusername
PASSWORD: *****
NETWORK INTERFACE 192-8001 (c) 1998 - 2006 SYMMETRICOM
ALL RIGHTS RESERVED
LOGIN SUCCESSFUL!
<ROLFE - the user must hit the ENTER key on this blank line to get the
command prompt>
GOODBYE.
Any suggestions? I've read a lot of the documentation online and tried
variations on the telnet.rb sourcecode. Your help would be very much
appreciated...
below:
waitfor is timing the script out. Is it because it isn't recognizing
that password input is complete? or is it because the device doesn't
issue a command prompt after the password is input? (The user has to
hit the Enter key to get the command prompt)?
I've interjected comments on the behavior of the script with <ROLFE-...
below.
I'm running the following script to log on to a peice of hardware:
require 'net/telnet'
tn = Net::Telnet.new('Host' => '192.168.47.150') { |str|
print str }
tn.login("myusername", "mypassword") { |str| print str }
This is how script displays in FreeRIDE:
Trying 192.168.47.150...ruby c:/Documents and Settings/rdlugyhegwer/sampler.rb
Connected to 192.168.47.150.
WELCOME TO SYMMETRICOM NETWORK INTERFACE!
USER NAME: myusername
<ROLFE-It pauses here for a little while, and then continues with:>
PASSWORD: mypassword
NETWORK INTERFACE 192-8001 (c) 1998 - 2006 SYMMETRICOM
ALL RIGHTS RESERVED
LOGIN SUCCESSFUL!
c:/ruby/lib/ruby/1.8/net/telnet.rb:551:in `waitfor': timed out
while waiting for more data (Timeout::Error)
from c:/ruby/lib/ruby/1.8/net/telnet.rb:678:in `cmd'
from c:/ruby/lib/ruby/1.8/net/telnet.rb:725:in `login'
from c:/Documents and Settings/rdlugyhegwer/sampler.rb:4
exit
If I log in using a terminal program, it looks like this:
WELCOME TO SYMMETRICOM NETWORK INTERFACE!
USER NAME: myusername
PASSWORD: *****
NETWORK INTERFACE 192-8001 (c) 1998 - 2006 SYMMETRICOM
ALL RIGHTS RESERVED
LOGIN SUCCESSFUL!
<ROLFE - the user must hit the ENTER key on this blank line to get the
command prompt>
quit
GOODBYE.
Any suggestions? I've read a lot of the documentation online and tried
variations on the telnet.rb sourcecode. Your help would be very much
appreciated...