that makes sense,
I tried it, first command returns ‘openhab is already a member of gpio’, second is the same error as shown in the first post.
Output below…
pi@raspberrypi:~ $ sudo adduser openhab gpio
The user openhab' is already a member of
gpio’.
pi@raspberrypi:~/sensor $ sudo -u openhab python sensor0.py
Traceback (most recent call last):
File “sensor0.py”, line 11, in
mcp=Adafruit_MCP3008.MCP3008(spi=SPI.SpiDev(SPI_PORT,SPI_DEVICE))
File “build/bdist.linux-armv7l/egg/Adafruit_GPIO/SPI.py”, line 42, in init
IOError: [Errno 13] Permission denied
I have a feeling the user openhab isnt given permission to access the file where the SPI library is, in this line??
File “build/bdist.linux-armv7l/egg/Adafruit_GPIO/SPI.py”, line 42, in init
IOError: [Errno 13] Permission denied
Im probably wrong but Im not experienced diagnosing these errors.
Thanks