fix file permissions issue openhab execbinding

i have experienced permission issue while trying to use openhab with exec binding
first of all you can always check the permissions by “sudo -u”.
For example

sudo -u openhab /usr/bin/python /home/pi/testscript.py

to guarantee fixing the permissions issue of openhab, i did a couple thing, all of them were needed
you should also do these steps

1-) copy your scripts to /etc/openhab2 folder, and use them there if possible
2-) grant scripts permissions like this

sudo chown openhab testscript.py
sudo chmod 777 testscript.py
sudo chmod a+x testscript.py

3-) edit config file and change user and usergroup to root from openhab

sudo nano /etc/default/openhab2
OPENHAB_USER=root
OPENHAB_GROUP=root

4-) add openhab user to sudoers

sudo adduser openhab sudo

5-) open this file with

sudo visudo

and edit this like the example below

openhab ALL = NOPASSWD: /usr/bin/python, /usr/bin/sh

6-) restart openhab service after all these steps

sudo service openhab2 restart

Orangepi Zero pyA20 Installation Error

I was trying to install pyA20 python module for orange pi zero (ubuntu server os)
i had this error

python arm-linux-gnueabihf-gcc exit status 1 orangepi

and people always say “you should install python-dev” on all the forums
i had damn python-dev installed 🙂 it was so annoying to see a non-working solution everywhere
anyway, i wanned to share my solution

For me removing the libi2c-dev package solved the problem.

sudo apt-get remove libi2c-dev