I've built a simple working python script to trigger my DLSR camera using GPIO pins to send a signal to an IR trigger. If I run the script manually, it works but octolapse seems to not have permission to run the script.
I found a couple of old posts about GPIO usage in this kind of way and they indicated that I should put the python script inside a .sh script and add my password(removed) at the start. So I did, like this:
You haven't told about your system, but I assume it is octopi.
You can omit writing your password thru customizing the sudo configuration.
Uncomment the line in /etc/sudoers.d/010_pi-nopasswd and the user pi can issue sudo with any command without password. If you don't want this, you can make a special definition for the camera script.
Make a new file e.g. /etc/sudoers.d/099_camera-no-password with the content
pi ALL=NOPASSWD: /home/pi/scripts/external-camera-trigger.py
As /home/pi/scripts/external-camera-trigger.py is writable by the user pi this adds no real security. The script executed as root should be owned by root and in a directory owned by root e.g. /usr/local/bin.
However, chmod +X doesn't do what you probably think
root@octopi:/tmp# touch example
root@octopi:/tmp# ls -l example
-rw-r--r-- 1 root root 0 Jun 12 12:40 example
root@octopi:/tmp# chmod +X example
root@octopi:/tmp# ls -l example
-rw-r--r-- 1 root root 0 Jun 12 12:40 example
root@octopi:/tmp# chmod +x example
root@octopi:/tmp# ls -l example
-rwxr-xr-x 1 root root 0 Jun 12 12:40 example