I’m totally new with openHab and surely not a Linux guru… so I run into some trouble getting sensor data from a BME280, where I hope you can help me with.
Please excuse my English, it’s not my native tongue.
Info’s on my problem:
Pi4 with Buster
self installed openHab 2.5.4. with Zulu8
i would like to read out a BME 280 via a script (because i can then implement other things similar)
i tried to read the sensor via python script or this python script run via a shell script
both the *.sh or the *.py scripts are running and reading data if I (user pi) execute them
I found i need to whitelist EXEC commands -> done, i think it is working in principle
the script is owned by openhub and has -u rwx -g rx -o rx permissions
the user openhab is in the groups i2c, gpio, spi, input, tty
the script is executed every 60s
My problem is:
Instead of the string (i later want to read data out of it, but this is a task to be done in the future) i expect with the python script output (which is exactly the same as the output the shell script generates by executing the phython script), i get the following:
“Traceback (most recent call last): File “/var/lib/openhab2/bme280.py”, line 30, in bus = smbus.SMBus(1) # Rev 2 Pi, Pi 2 & Pi 3 uses bus 1 IOError: [Errno 13] Permission denied Traceback (most recent call last): File “/var/lib/openhab2/bme280.py”, line 30, in bus = smbus.SMBus(1) # Rev 2 Pi, Pi 2 & Pi 3 uses bus 1 IOError: [Errno 13] Permission denied”
So there seems to be a problem with the permissions… do you have an idea how i can resolve this? I tried to google it but fail to search for the fitting keywords.