Solved

Using TCL to communicate with Serial port in Windows

Posted on 2013-01-24
1
1,075 Views
Last Modified: 2013-01-28
Hello,

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.

For example,

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]

puts "$com"


all I get back is:
file6355a8

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.
0
Comment
Question by:DivergentUser
1 Comment
 
LVL 51

Accepted Solution

by:
ahoffmann earned 500 total points
ID: 38820162
expect is your friend http://wiki.tcl.tk/201
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How to remove superseded packages in windows w60 or w61 installation media (.wim) or online system to prevent unnecessary space. w60 means Windows Vista or Windows Server 2008. w61 means Windows 7 or Windows Server 2008 R2. There are various …
Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question