LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 05-05-2005, 04:20 PM   #1
Nalorin
Member
 
Registered: Mar 2005
Location: C-eh?-N-eh?-D-eh?
Distribution: 2.6.11-1.14_FC3
Posts: 58

Rep: Reputation: 15
serial port (ttyS1) - Sending commands via terminal... HELP!!!


hey, guys... I need some help, here

I am currently working for a university, trying to program in Perl/Tk a gui that will control this device.

Now the problem: I can't figure out, for the life of me, how to send commands directly through the serial port. The device that I'm programming for takes as input a string (for example "p" for pressure) and it's supposed to return a string that will tell the setting that it's at (eg, ABCDeE FHGIeJ)

ABCD-is a multiplier, and E is the exponent
FHGJ- is a multiplier, and J is the exponent


so when I send "p" I am supposed to get letters like that back... then I need to program to interpret them... that's not the hard part, getting it to take the input and spill back output IS the hard part.

First off, is there any way that I can echo or print or something directly to the device, through serial (just one letter, or so). Second, is there a way that I can get it's response back (even if only to the terminal window). Thirdly, how do I do it?. Lastly, Please Keep it simple.... i'm quite new to this...


*edit* by the way - in case you didn't know, it is RS-232 serial port through a 15-pin D-sub connector (9 pin serial on computer, 15-pin serial on device

Last edited by Nalorin; 05-05-2005 at 04:51 PM.
 
Old 05-05-2005, 05:41 PM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 24,707

Rep: Reputation: 5591Reputation: 5591Reputation: 5591Reputation: 5591Reputation: 5591Reputation: 5591Reputation: 5591Reputation: 5591Reputation: 5591Reputation: 5591Reputation: 5591
To test the device you can use minicom or

http://sourceforge.net/projects/gcomm/

I found a perl program for testing the serial port that probably could be adapted.
http://ftdi-usb-sio.sourceforge.net/#3
 
Old 08-21-2005, 10:22 PM   #3
mjrich
Senior Member
 
Registered: Dec 2001
Location: New Zealand
Distribution: Debian
Posts: 1,046

Rep: Reputation: 45
Nalorin,

Other than using Minicom (et al.) to communicate directly to the device, what did you find to be the best way to send & receive data directly through the port ? Echoing text to the port works, but a bit unreliably methinks.

We are doing something similar at our university with a remote device hooked up to a GPRS terminal.

Cheers,

mj
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
shell script: sending data through the serial port funkymunky Programming 2 06-09-2004 11:47 PM
serial port terminal lectraplayer Linux - Newbie 15 02-21-2004 10:51 PM
Sending commands and viewing replies from a serial-attached appliance bgianardo Programming 3 01-19-2004 11:00 AM
Digiboard accel4r sending modem commands to terminal lansman Linux - Newbie 0 04-06-2003 09:58 AM
Terminal on serial port sourceman Linux - General 0 08-06-2002 04:21 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 06:16 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration