Solved

Using TCL to communicate with Serial port in Windows

Posted on 2013-01-24
1
1,097 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

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

Suggested Solutions

Over the years I've spent many an hour playing on hardened, DMZ'd servers, with only a sub-set of the usual GNU toy's to keep me company; frequently I've needed to save and send log or data extracts from these server back to my PC, or to others, and…
Recently, an awarded photographer, Selina De Maeyer (http://www.selinademaeyer.com/), completed a photo shoot of a beautiful event (http://www.sintjacobantwerpen.be/verslag-en-fotoreportage-van-de-sacramentsprocessie-door-antwerpen#thumbnails) in An…
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…

856 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