Communicating with Serial Port


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Communicating with Serial Port
# 1  
Old 03-14-2008
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
# 2  
Old 03-14-2008
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
# 3  
Old 03-14-2008
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.
# 4  
Old 03-15-2008
Quote:
Originally Posted by netsavant
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.
# 5  
Old 03-15-2008
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.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Communicating with ethernet to serial LED sign - is this feasible?

I have a london-electronics LED sign I picked up on eBay which I would like to display custom messages on programmatically. It is working ok. Opening it up, it has an ethernet to serial connection currently plugged in and a serial connection currently unplugged internally (same connectors).... (9 Replies)
Discussion started by: windswept321
9 Replies

2. 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

3. 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

4. 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

5. AIX

how to know my serial port is communicating and running fine

i want to know that my serial port ( pci slot with 2 port ) is working fine and communicating is there any way to know the serialport is working and communicating? please help (3 Replies)
Discussion started by: pchangba
3 Replies

6. 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

7. 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

8. Solaris

Serial Port Datalogger

Hi, I'm using Solaris workstation with 5.4 OS. I was wondering if there's a way that I could log the data incoming and outgoing on a certain serial port. Thanks in Advance! (1 Reply)
Discussion started by: uryuu
1 Replies

9. Programming

Telling apart serial from // port

I'm writing a journal_write() function and I want it to: - be a possible drop in replacement for write() - write entries to the journal ;-) Could be a regular file (journal.txt), a serial printer or a // printer. - handle printer status if needed. fstat() tells weather or not we're dealing with... (2 Replies)
Discussion started by: starless
2 Replies

10. UNIX for Dummies Questions & Answers

serial port configuration

I am having trouble with a device connected through a serial port on my sun workstation ( I am running solaris 7). The seriel device works on an identical workstation running the same o/s version but when I move it to the initial workstation it doesn't work. I am using an rs232 serial cable and... (1 Reply)
Discussion started by: Henrik
1 Replies
Login or Register to Ask a Question