I'm trying to grant access for students in my research lab to run programs that access the GPIO pins without giving them sudo access. I'm using the Jessie distribution which should eliminate the need for this level of permission, but I've encountered an unexpected problem: The system won't allow the students to import certain classes from my PWM driver without sudo access!
Here's the error I keep receiving:
File "filename", line 17, in <module>
from Adafruit_PWM_Servo_Driver import PWM
File "/home/user/Adafruit_PWM_Servo_Driver.py", line 11, in <module>
File "/home/user/Adafruit_PWM_Servo_Driver.py", line 35, in PWM
general_call_i2c = AdafruitI2C(0x00)
File "/home/user/Adafruit_I2C.py", line 4, in __init__
self.bus = smbus.SMBus (busnum if busnum >= 0 else Adafruit_I2C.getPiI2CBusNumber())
PermissionError: [Errno 13] Permission denied
I've attempted to rectify the problem by changing permissions to all the files indicated using chmod, but this did not correct things. When you run the program with sudo, this problem doesn't occur. What do I need to do to allow the users to call these particular classes without sudo access?
Thanks for your help!