Solved
For anyone planning on reading on, here is the quick answer. The openhab user could access the user space of the pi user where I was writing the scripts.
The MCP3008 library was installed in /usr/local/blah blah blah
I added a folder and put my scripts in /usr/local/newFolder
As the openhab user and pi have access to that directory it can call the scripts with no issues.
Im not exactly a pro when it comes to linux or openhab so Im trying to get all my info right here.
I installed openhab2, set up a few things and items and sitemap following the tutorial, no problems there.
I have a python script to call an ADC over SPI and calculate a temperature value.
This works fine when run from the pi user without sudo.
I set up the exec binding but having various troubles. Lots or trawling through websites and forums (including this one) but I think I might have found the problem, but my lack of experience means I cant be sure/resolve it.
I set up a simple python script ~ print(“101”)
set up the thing and item string output and it gets back the value no problem.
When calling the python script that requires the SPI bus I get this error on the paperUI control webpage
Traceback (most recent call last): File “/home/pi/sensor/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 deniedTraceback (most recent call last): File “/home/pi/sensor/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
If im reading it right, I think the problem is that the user that is running openhab (as far as I can tell, ‘openhab’ is the user, but there is no user account for this, not like the ‘pi’ default account??), is not given permission to access the library for the SPI bus or the SPI bus itself?
the python script is located in the ‘pi’ home directory so I dont know if that has anything to do with it, I used an Adafruit program that came with the library in order to install the library so I dont know if its installed with permission for ‘pi’ to use but no one else?
If its just user permission can I save my python script in some directory that openhab can call without permission errors?
Im really stuck because the other exec things work fine, but the one I want (with SPI access) wont.
thanks