In my project I've connected a Raspberry Pi 2 and Arduino by serial USB. I would switch on some leds, by a php interface.
So, the PHP interface is ok, but when I chose the led to put on, nothing happens. The serial wired is ok because I can switch on the leds by using the IDE tool on the RPi 2.
The help PHP page is correctly reached.
After a lot of research, I think that the problem could be the permission settings. The php web interface, could use
/dev/ttyACM0 port, but maybe, it doesn't happens.
Considering the possible users like, www-data (Apache2), root and pi, after having seen some guides online, I'm confused. I can't understand wich user has to be enable in orther to use /dev/ttyACM0 port.
In conclusion, I attach the command used:
sudo chmod 777 /dev/ttyACM0
sudo usermod -a -G dialout www-data
sudo chown -R www-data:www-data /directory