![]() How to find the location of the Apache config file: You may find something like: export APACHE_RUN_USER=www-dataĬ) Add the User www-data to the dialout group: sudo usermod -a -G dialout www-dataĪs the Apache user has been added to the dialout group, the script should now be able to access the device. You may find something like: # These need to be set in /etc/apache2/envvarsī) Quit vim and search for APACHE_RUN_USER in /etc/apache2/envvars (if the above scenario applies): # open file in editor ![]() The third option, which is the option I implemented, adds the Apache user to the dialout group so that if the script is being run by Apache, then it can access the device.Ī) Find the location of your Apache config file, then search for the User setting within that file: # open file in editor This also sets permissions for world to read and write, which you may not want to do.įor more information about this approach, see these answers:Ġ3. Create a rule in /etc/udev/rules.d that will set the permissions of the device (a restart will be required): # navigate to rules.d directory Alter the permissions on /dev/ttyACM0 so that world has read and write priviliges (something you may not want to do) - although you may find they reset each time the device is plugged in eg: sudo chmod 666 /dev/ttyACM0Ġ2. I'm not an expert in the area, so please just use this information to support your own research.Ġ1. ![]() The following fleshes out some of the ideas in the first answer (I tried to add this content to that answer and accept it, but the edits were rejected).
0 Comments
Leave a Reply. |