Answer the question
In order to leave comments, you need to log in
Why is php not working?
Arduino Uno is connected to the server via UART. Everything is configured so that when executing a command in ssh
echo "1" > /dev/ttyS0 the
LED turns on.
And the php script can't turn on the LED.
<?php
exec('echo "1" > /dev/ttyS0');
?>
Why?
Answer the question
In order to leave comments, you need to log in
most likely not enough rights. what user and what permissions on /dev/ttyS0?
exec('echo "1" > 1.txt');
set it to 1.txt in the folder where the script is right 777
if it works, then you need to figure out the rights,
and if it doesn’t work, then you need to give PHP the ability to call system functions.
Turn on error reporting and try to open the port:
error_reporting(E_ALL);
fopen('/dev/ttyS0', 'w');
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question