Permissions Issues

I downloaded the provided code and I can run it without issue…as root. For some reason when I try to run as the user which I installed the software as, I get a big stack of permission issues.
File “./”, line 15, in
File “/usr/lib/python2.7/dist-packages/automationhat/”, line 234, in off
File “/usr/lib/python2.7/dist-packages/automationhat/”, line 273, in write
File “/usr/lib/python2.7/dist-packages/automationhat/”, line 259, in setup
File “/usr/lib/python2.7/dist-packages/automationhat/”, line 354, in setup
_ads1015 = ads1015(smbus.SMBus(1))
IOError: [Errno 13] Permission denied

I did a little digging with trying to open up permissions on the files inside the automationhat folder, but to no avail. Are there some external root level dependencies your code expects? Do I need to be able to sudo without password or something?

The code expects your user to have access to /dev/i2c-1 which has been standard on Raspbian for years. You can configure accordingly with udev/groups or add your user to the i2c group if one exists on your distribution.

Okay, I’ll extend the code to execute a system call and check that permission, offering up a more explicit error message in the event that device is not accessible to the current user, like you are currently doing with permission on the /dev/input/event* files. Thanks.