Solved

Using TCL to communicate with Serial port in Windows

Posted on 2013-01-24
1
1,179 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This Windows batch file is useful for organizing image files from a digital camera or other source, but can have many other uses.  It simply renames the file(s) to match their create date.  For example, if you took a picture today at 1:40pm and the …
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 …
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…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

705 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