Using TCL to communicate with Serial port in Windows
Posted on 2013-01-24
I am trying to use TCL to set a connection with a device on the serial port (using Windows) and to send commands to the device based on prompts given by the device on the serial port.
As the device boots up you can enter a mode to update the software by pressing the letter "P" as there is a prompt that gives you 2 seconds to press "P" to update sw. I am looking for the tcl commands that will allow me to read the informaion comming from the serial port and if it sees the request for "P" it will send "P" back over the serial port to the device.
I thought, as a test, I would write a script that would show what the com port is recieving.
So far I have tried this:
set com [open com1:a+]
fconfigure $com -mode 115200,n,8,1 -blocking 0 -translation auto -buffering line
set data [read $com]
all I get back is:
Again, my main goal is to send the device into sw update mode by sending "P" when prompted.
Any help would be appreciated, and thank you for your time.