我正在使用Expect处理嵌入式系统的U-boot。 但是,我的脚本在某些时候没有发送命令。 这是我的剧本
#!/usr/bin/expect
set scriptaddr "0x32000000"
spawn screen /dev/ttyUSB1 115200
expect "Hit any key to stop autoboot:"
send "\r"
puts "Start flashing"
send "tftp $scriptaddr recovery_files/install.scr \r"
sleep 2
send "source 0x32000000\r"
## here start the flashing process which takes 15 mins
## this is the part where not working ##
expect "(Please reset your board)"
sleep 3
send "reset\r"
这是控制台上显示的最后一部分,哪个等待用户键入“重置”
#################################################################
#################################################################
###
2 MiB/s
done
Bytes transferred = 7333121 (6fe501 hex)
Uncompressed size: 168820224 = 0xA0FFE00
MMC write: dev # 0, block # 3940352, count 329727 ... 329727 blocks written: OK
============ INSTALLATION IS DONE =============
(Please reset your board)
machine#
我犯了任何错误吗?请协助,谢谢!
答案 0 :(得分:1)
默认情况下,预期将有10秒的超时。
解决方案:if($qur)
{
// new mobileno
//add it will take
}
else
{
// repeated i will not accept, you put mobileno exist.
}