User Tools

Site Tools


arduino

Send data to arduino from web server

- Connect arduino via USB
- allow web server to use serial (add user www-data to group dialout)

sudo usermod -a -G dialout www-data
sudo usermod -a -G tty www-data

To send out data:

$fp = fopen("/dev/ttyUSB0", "w");
fwrite($fp, chr($message));
fclose($fp)
arduino.txt · Last modified: 2013/12/25 16:47 (external edit)