From 726c32e5f65b26f0db17fc4f5dd53f1d52f12ca2 Mon Sep 17 00:00:00 2001 From: Stefan Kalkowski Date: Wed, 3 Dec 2014 10:53:07 +0100 Subject: [PATCH] run: relax IP power plug recognition + serial EOF * To communicate with IP power plug devices from Koukaam, to remote control power supply of test boards, don't parse minor versions, but support different IP power plugs * TCL's expect may report an EOF when reading from the spawned serial terminal, especially when using 'socat' to stream serial over TCP/IP, although the spawned child is still running and delivering content. This problem is clearly not dependent on the characters send, but possibly due to strange pipe signals. When piping the serial output through 'tr' the problem vanishs. --- tool/run | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tool/run b/tool/run index 8eef5db70..8372823a0 100755 --- a/tool/run +++ b/tool/run @@ -791,7 +791,7 @@ proc power_plug_connect {} { spawn telnet $server_ip 1234 set connection_id $spawn_id - expect -i $connection_id "KSHELL V1.3" + expect -i $connection_id "KSHELL V1.*" send -i $connection_id "login $user_name $password\n" expect -i $connection_id "250 OK" @@ -887,7 +887,9 @@ proc spawn_serial { wait_for_re timeout_value kernel_msg } { jtag_load } - eval spawn $serial_cmd + # pipe the serial output through 'tr', sometimes expect steps out due to + # unexpected pipe behaviour and reports EOF although the pipe is still active + eval spawn sh -c \"$serial_cmd | tr a a\" set serial_spawn_id $spawn_id set timeout 210