Solved

PHP Serial port + baud rate in linux

Posted on 2007-04-10
2
1,903 Views
Last Modified: 2007-12-19
Hi,

I am about to start writing a php script which accesses the serial port on my PC, (/dev/ttyS0) - however, I cannot seem to find out where to configure the baud rate before I open the stream?
any help will be appreciated!
0
Comment
Question by:skaap2k
2 Comments
 
LVL 48

Accepted Solution

by:
hernst42 earned 500 total points
ID: 18880957
AFAIk php does not support sending ioctl-commands to an open file-descriptior you will need to set thoses settings via external command. On linux use setserial like:

exec('setserial /dev/ttyS0 ..');
fopen('/dev/ttyS0');
0
 
LVL 5

Author Comment

by:skaap2k
ID: 18880976
Perfect! thanks :)
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

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

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to count occurrences of each item in an array.

821 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