Pages: [1]   Go Down
Author Topic: Arduino control via tethered usb via webserver overview  (Read 1324 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 49
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I spent many many hours trying to piece together enough info to be able to control my arduino over via usb serial via a web page. I will outline the steps to hopefully help some one else !

Keep in mind this is all for Mac, specifically osx 10.6

1) enable PHP and apache
http://www.coolestguyplanet.net/how-to-install-php-mysql-apache-on-os-x-10-6/

2) get the php serial class script

Scroll down to "Project Name: Arduino Serial LED Via PHP"
http://missionduke.com/wordpress/arduino-projects/

or
http://www.phpclasses.org/package/3679-PHP-Communicate-with-a-serial-port.html

modify the serialledcontrol.php file for your baud rate and your communication port address
these 2 lines...
 $serial->deviceSet("/dev/cu.usbserial-A4001234"); //SET THIS TO WHATEVER YOUR SERIAL
 $serial->confBaudRate(9600); //Baud rate: 9600

The lines such as these actually determine what data is being sent
 $serial->sendMessage("1\r");

Put serialledcontrol.php and php-serial.class.php in the /user/Sites/ folder

http://192.168.0.XXX/~user/serialledcontrol.php

The arduino should now receive the characters sent from the serialledcontrol.php

Also I have the arduino serial monitor open and you can see responses in the serial window!

There was talk that the arduino may reboot before/during/after the serial port opens/closes ... I cant confirm at this time ...

Have fun :-)

« Last Edit: March 22, 2012, 01:39:10 am by hotshotharry » Logged

Pages: [1]   Go Up
Jump to: