From: Roger Alexander on
I have a telnet device that transfers files using YMODEM, and I would
like to use Expect to automate the process of initiating the transfer
on the device end and starting rz on the receiving end. There's an
example in Exploring Expect that is similar to what I'm trying to
accomplish, the differences being that the transfer is done via ZMODEM
over rlogin; also, the directions are reversed in that example from
what I am doing. Unfortunately, I cannot get my script to work.

The Expect script that I have written spawns telnet as one processes,
connects and logs in to remote device just file. I also get the file
transfer started on the device end, and detect the start of the
transfer on the receiving end. I then spawn a new process for rz end
of things. Unfortunately nothing happens beyond that point until the
transfer from the device end times out, at which point rz terminates
wihting having transfered the file. It seems that I cannot get the two
processes to communicate. My script is patterned on the Exploring
Expect example, adjusted to account for receiing instead of sending a
file and using telnet. The essence of the script is:

spawn telnet 10.221.10.100;
set sb $spawn_id

... login details omitted!

send "file read ldp_data.bin\r"

expect "#000 Ready to send file"

spawn rz --ymodem

interact -u $sb

expect "=>"

send "exit\r"

The login is successful and the remote device enters sending mode,
also rs spawns okay. At that point, nothing happens. What should then
happen is that the receiver sends <C> to the receiver, which instructs
the receiver to send the header. And indeed, the sender replies with
the header. But then, the receiver again sends <C> to the receiver,
and again, the sender transmits the header. The cycle then repeats
itself until the sender eventually aborts the transfer. It is as if
the receiver (i.e., sb) can talk to the sender, but not receive the
sender's replies. Via debugging with exp_internal, I know tha the
sender is getting the commands from the receiver and responding. Any
thoughts here?

Thanks,

Roger Alexander.