The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
Google UNIX.COM


UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
urgent......Serial port arunchaudhary19 Linux 16 11-02-2007 02:42 AM
Serial Port Datalogger uryuu SUN Solaris 1 09-26-2007 02:22 AM
serial port signal ppass SUN Solaris 0 02-04-2005 07:11 AM
Serial port communication Aretha UNIX for Dummies Questions & Answers 1 01-25-2002 05:44 PM
socket on serial port kintoo High Level Programming 2 07-31-2001 12:44 AM

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-14-2008
Registered User
 

Join Date: Mar 2008
Posts: 3
Communicating with Serial Port

I am using system running on red hat linux 4.
I had connected health measuring machine to the serial port and configured it
[root@localhost ~]stty -F /dev/ttyS0 9600 -parenb cs8 -cstopb
this machine requires a command to be passed to it for giving output. I am unable to pass command hexa format(0x68) to the machine.
So when i used cat not getting any output from the port. Please help me on this.
[root@localhost ~]cat /dev/ttyS0 > /opt/srldata.txt
[ctrl-c]
i had tried to pass command using echo
[root@localhost ~]echo "0x68" > /dev/ttyS0
but dont know how to get the output.
I need to collect values from the port and display it on web page using PHP on Linux. Please any Linux/Unix Gurus help me to sort this out.

Thanks in advance
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 03-14-2008
zazzybob's Avatar
Registered Geek
 

Join Date: Dec 2003
Location: Melbourne, Australia
Posts: 2,100
Try using something like minicom to communicate with the device over the serial connection. I believe that RHEL4 has a minicom RPM on the OS media.

Cheers,
ZB
Reply With Quote
  #3 (permalink)  
Old 03-14-2008
Registered User
 

Join Date: Mar 2008
Posts: 3
my system has minicom 2 version. I had openend minicom and configured it to 9600 8N1 and restarted it. but it is showing offline. Pls hlp. How can i call this minicom from PHP code.
Reply With Quote
  #4 (permalink)  
Old 03-14-2008
Registered User
 

Join Date: Mar 2008
Posts: 3
Quote:
Originally Posted by netsavant View Post
my system has minicom 2 version. I had openend minicom and configured it to 9600 8N1 and restarted it. but it is showing offline. Pls hlp. How can i call this minicom from PHP code.
I had tried in several ways but could not make this work. pls help.
Reply With Quote
  #5 (permalink)  
Old 03-15-2008
jgt jgt is offline
Registered User
 

Join Date: Apr 2007
Location: 44.21.48N 80.50.15W
Posts: 348
From what I have read about minicom, it is a terminal emulation program.
So if you want to connect to another Linux/Unix system via a serial port then you can do that.
The setup that you have (I presume) requires that you communicate with a device over a serial port that does does not have a keyboard.
You will have to write (presumably in C) a device handler, that sends hex 68 to the machine, and then listens on the port for the response.
Usually equipment like this is sold with API software, or has a website that you can use to download software, to solve the problem that you are having.
Reply With Quote
Google UNIX.COM
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 02:35 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0