Well, tonight has been a world of pain of dependencies etc… and still I have failed.
Thanks @dillthedog for the tip about pip, that is where I needed to go.
In progressing down this route, I found the following:
gpiozero relies on RPi-GPIO.
RPi-GPIO relies on wheel, and once wheel is installed, still fails to install PRi-GPIO on the next dependency:
- unable to execute ‘arm-linux-gnueabihf-gcc’: No such file or directory
I then find I can’t just install arm-linux-gnueabihf-gcc either without a million other dependencies.
There’s got to be a better way, this has been a horrid experience.
All the systemd stuff of calling the python script with a unit file was straightforward, and seemed to want to work, but can’t as RPi-GPIO can’t easily be installed.
I even installed python-dev and setuptools as another shot in the dark, but still no joy.
osmc@osmc:~$ sudo pip install RPi.GPIO
Collecting RPi.GPIO
Using cached https://files.pythonhosted.org/packages/af/2f/407b6e4cc8a0bdf434825a160bba1807991886b63cce16a5f1a6e1f24cdf/RPi.GPIO-0.6.5.tar.gz
Building wheels for collected packages: RPi.GPIO
Running setup.py bdist_wheel for RPi.GPIO ... error
Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-J014FR/RPi.GPIO/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/tmpa0132xpip-wheel- --python-tag cp27:
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-armv6l-2.7
creating build/lib.linux-armv6l-2.7/RPi
copying RPi/__init__.py -> build/lib.linux-armv6l-2.7/RPi
creating build/lib.linux-armv6l-2.7/RPi/GPIO
copying RPi/GPIO/__init__.py -> build/lib.linux-armv6l-2.7/RPi/GPIO
running build_ext
building 'RPi._GPIO' extension
creating build/temp.linux-armv6l-2.7
creating build/temp.linux-armv6l-2.7/source
arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-Ub3vap/python2.7-2.7.13=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c source/py_gpio.c -o build/temp.linux-armv6l-2.7/source/py_gpio.o
unable to execute 'arm-linux-gnueabihf-gcc': No such file or directory
error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1
----------------------------------------
Failed building wheel for RPi.GPIO
Running setup.py clean for RPi.GPIO
Failed to build RPi.GPIO
Installing collected packages: RPi.GPIO
Running setup.py install for RPi.GPIO ... error
Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-J014FR/RPi.GPIO/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-4xuK6b-record/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build/lib.linux-armv6l-2.7
creating build/lib.linux-armv6l-2.7/RPi
copying RPi/__init__.py -> build/lib.linux-armv6l-2.7/RPi
creating build/lib.linux-armv6l-2.7/RPi/GPIO
copying RPi/GPIO/__init__.py -> build/lib.linux-armv6l-2.7/RPi/GPIO
running build_ext
building 'RPi._GPIO' extension
creating build/temp.linux-armv6l-2.7
creating build/temp.linux-armv6l-2.7/source
arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-Ub3vap/python2.7-2.7.13=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c source/py_gpio.c -o build/temp.linux-armv6l-2.7/source/py_gpio.o
unable to execute 'arm-linux-gnueabihf-gcc': No such file or directory
error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1
----------------------------------------
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-J014FR/RPi.GPIO/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-4xuK6b-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-J014FR/RPi.GPIO/
Giving up now, as sleep is required, but if @sam_nazarko or @oliv1 have any ideas too, please do suggest them.
I did start making a web page guide on how to do thihs… was just noting down my actions as I went along… had to go back to the top when I ran into the GPIO nonsense, but it may show you the hoops I jumpsed through to get ti close to working before I gave up:
http://scottbouch.com/osmc-gpio-guide.htm
Cheers, Scott.