Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Serial port access with PHP
Old 03-03-2010, 09:35 AM Serial port access with PHP
Novice Talker

Posts: 7
Trades: 0
Hi everyone,

1- serial port access can be done with php?
2- usb port access can be done with php?
how? Do you have the source code?
yorgi17 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 03-03-2010, 10:54 AM Re: Serial port access with PHP
mik
mik's Avatar
Experienced Talker

Posts: 31
Location: United Kingdom
Trades: 0
Not directly, you would have to write an exec() function or develop a PHP extension.
mik is offline
Reply With Quote
View Public Profile
 
Old 03-04-2010, 12:49 PM Re: Serial port access with PHP
nayes84's Avatar
Extreme Talker

Latest Blog Post:
Difference between ASP And JSP
Posts: 232
Name: John
Location: Tokyo
Trades: 0
I guess fopen can be used since serial port is mounted probably to /dev/ttyS0
try the following code
PHP Code:
$fp=fopen('/dev/ttyS0','rw');
//write to serial port
fwrite($fp,'some data');

//read from serial port
$str=fread($fp);

//close stream
fclose($fp); 
Note: you must have root access to be able to use serial port
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE

if(I'm("Helpful")) Add_Talkupation("nayes84");
nayes84 is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Serial port access with PHP
 

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 On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.83502 seconds with 12 queries