That is because Expect is not designed to co-operate with a program like Minicom.
Minicom is a full screen application. The application uses special codes to place certain information on the screen. And it puts the information in the place where it is appropriate, not even in a specila sequence. I assume it uses the ncurses library, much the same as cfdisk or midnight commander. That means it outputs a lot of escape codes which are just rubbish in your Expect session.
Expect OTOH expects (no pun intended) strictly a stream I/O. Like you use in a telnet session. You send something, the remote site answers with a nice string, often terminated with CRLF.
So if you want to send something, forget about Minicom and go for Expect all the way. It means that you cannot use Minicom to handle the interface to the serial communication layer. But Expect can do that. You must open a device to which Expect can talk. Plenty examples in the Expect documentation. I would not be surprised if TCL provides high level libraries.
jlinkels
|