Sponsored Content
Top Forums Shell Programming and Scripting Tcl: How to communicate serial port remotely Post 302466587 by allenxiao7 on Tuesday 26th of October 2010 06:21:08 PM
Old 10-26-2010
Tcl: How to communicate serial port remotely

Hi all:

i wanna automate a test written in Tcl, but stuck in serial communication.

I had 2 PC, one is my local Windows machine, the other one is my test Linux server. The Linux box is connected to the test board via serial port. So I wanna send commands and get output through the serial port.

So i wrote a Tcl script, and wanna call the scripts in Windows, remotely connect to the Linux server and talk to the test device via serial port. It failed so far. I used 'Open' in tcl to create a serial connection in Linux.

Code:
 ex. set fh [open /dev/ttyS0 RDWR] 

what I learn the reasons why this may not work are that (in my option):

first, fh is a file descriptor if one open a file (in linux, all devices represent a file), so u cant monitor a live test, instead read a file line by line after a numbers of seconds. I doubt there is no eof in /dev/ttyS0, which means even u can read from it, if no incoming output, u can still read an empty string without issuing an error.

second, since i remotely connect to linux box from window pc, tcl interpreter is confused by which serial port i was trying to open, (windows? or Linux? I am using a virtual Linux in Windows to call the script, connect to the Linux sever, trying to communicate the device connected to there.)

I hope everyone understand my situation, and my purposes now.

I really appreciate all your suggestion regarding how to remotely commnucate serial port in Tcl.
 

10 More Discussions You Might Find Interesting

1. Solaris

Communicate Serial Modem using non-Root user

Hi, I'm having a issue on communicating the serial GSM modem in Sun Solaris 5.9 To implement such connectiom, i'm using the "tip -115200 /dev/term/a" command and i successfully get the "connected" status And then i send a "AT" message and receive "OK" response from the modem :D Anyhow,... (0 Replies)
Discussion started by: darontan
0 Replies

2. Solaris

Serial port issue

Hi, I am working with Sun Solaris 9 Sparc,Sun-Blade-100.In my application,I need to monitor the UPS using Serial port. When I am using JRE 1.4 in my application,I am able to monitor it but when I am upgrading the JRE version from 1.4 to JRE1.6. I am not able to monitor the UPS.It is showing the... (1 Reply)
Discussion started by: smartgupta
1 Replies

3. Solaris

Serial port not found

Hi, I am working with solaris 9,SUN-Blade-100 and I want to communicate with the Serial port.To check whether the port is working or not.I write code and when I execute the file,then I got the output-- According to this,serial port is not found.can anyone please tell me how to configure the... (1 Reply)
Discussion started by: smartgupta
1 Replies

4. Programming

Programming serial port

Hello! Can someone advice me which method I will use if I want to communicate with device via RS232 serial port with this requirements: 1. Serial port is opened in non-canonical mode. 2. All the time I need to check is there something to read. 3. If I have to write something I need to write it... (6 Replies)
Discussion started by: jvrlic
6 Replies

5. Programming

How to tell if a string to serial port has been sent

I have a need to determine when a string has been completely sent via a serial port from a standard 'C' application. The code is as follows: SerialPort_Send = open (pPortString, O_WRONLY | O_NOCTTY | O_NONBLOCK); write (SerialPort_Send, pCommandString, strlen (pCommandString)); ... (2 Replies)
Discussion started by: ExDes
2 Replies

6. Shell Programming and Scripting

Need help with serial port

Hi, I have a external board connected to my serial port. I need to execute "shutdown -r now" command when system boot up. When system boots up it requires a username ans password. Then I need to run my command. I can use rc script but that is rebooting system before it asks for username and... (0 Replies)
Discussion started by: charlie.arya
0 Replies

7. Solaris

How to enable Serial port on ILOM, when Network Port is enabled in parallel

Hi Everyone, In my environment, I have few T5220. On the iLOM Management Card, I have both Network and Serial port are cabled, I don't have any issues while I try to connect using Network Management port, but when I try to connect the serial port for the same server which is actually connected... (3 Replies)
Discussion started by: bobby320
3 Replies

8. Solaris

Using PC serial port from ReflectionX

I am using ReflectionX on a windows PC to run an application on a Solaris box. The application uses the serial port and expects a definition like: /dev/ttyb Is there a way to use the PC serial port through ReflectionX? PC is running Windows-XP Solaris Box is: Sun Microsystems sun4u... (1 Reply)
Discussion started by: deanjennings
1 Replies

9. Web Development

Setup Serial Port

I need to set a serial port to 9600 7E1. How do I accomplish this? I've tried every combination, with no luck. (6 Replies)
Discussion started by: Meow613
6 Replies

10. Solaris

Cabling and adapters to communicate to service processor serial port from Windows PC with USB port.

Hello, I have an unloaded T5140 machine and want to access the ILOM for the first time and subsequently the network port after that., and then load Solaris 10 the final January 2011 build. The first part is what confuses me -the cabling. I am coming from a Windows machine (w/appropriate... (5 Replies)
Discussion started by: joboy
5 Replies
dc(7)							 Miscellaneous Information Manual						     dc(7)

NAME
dc - serial line/mouse/keyboard SYNOPSIS
controller dc0 at ibus0 slot 0 vector dcintr DESCRIPTION
The dc serial line controller provides DECstation 2100, DECstation 3100, DECstation 5000, and DECstation 5100 computer systems with key- board, mouse, and serial communications interfaces. The serial communications interfaces on the DECstation 2100 and DECstation 3100 provide partial modem control. The serial communications interfaces on the DECstation 5000 provide full modem control. The device special file /dev/tty01 on a DECstation 5100 provides full modem control, while the remaining ports provide no modem control at all. All serial commu- nications interfaces operate at baud rates from B50 to B9600, excluding B200. The dc ports are used as follows: Usage Graphics device keyboard at 4800 BPS Mouse or tablet at 4800 BPS Communications port 1 (w/modem control)/local terminal Communications port 2 (w/modem control)/local terminal On all systems except the DECstation 5100, serial port 2 is used for the system console port in server (that is, non-graphics) configura- tions. On DECstation 5100s, the serial port labeled 3 on the back of the system is always the system console port. The serial system con- sole port always operates at 9600 BPS, 8-bits, no parity; modem control is not supported. RESTRICTIONS
Data communications equipment attached to the console serial port in server configurations must be set to 9600 BPS, 8-bits, no parity. The scc driver enforces this restriction. FILES
console terminal local terminal local terminal local terminal (DECstation 5100 only) RELATED INFORMATION
console(7), devio(7), tty(7), MAKEDEV(8) delim off dc(7)
All times are GMT -4. The time now is 08:17 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy