新版樹莓派3的系統可能不再兼容wiringpi-python,運行會提示:
Unable to determine hardware version. I see: Hardware? : BCM2835
- expecting BCM2708 or BCM2709.
If this is a genuine Raspberry Pi then please report this
to projects@drogon.net. If this is not a Raspberry Pi then you
are on your own as wiringPi is designed to support the
Raspberry Pi ONLY.
這是因為wiringpi-python庫還沒更新導致的,因此需要手動安裝wiringpi-python,感謝neuralpi為我們提供修改版的wiringpi-python
安裝之前,需要先安裝swig2.0和python-dev
sudo apt-get install swig2.0 python-dev
接下來安裝wiringpi-python:
git clone --recursive https://github.com/neuralpi/WiringPi-Python.git
cd WiringPi-Python/WiringPi
sudo ./build
cd ..
swig2.0 -python wiringpi.i
sudo python setup.py install
sudo python3 setup.py install