I was struggling to make wiring work on OrangePi 5 Plus armbian. Tried everything and came up with a solution that worked for me.
I was constantly getting these errors:
wiringPiSetup: mmap (PWM) failed: Operation not permitted
wiringPiSetup: mmap (GPIO) failed: Operation not permitted
I'm on 23.8.2.
1. Install armbian and update apt
sudo apt update
2. As stated in OrangePi5Plus wiki page I got .deb installer for wiringPi on OrangePi
Now here's the link to this file:
https://github.com/orangepi-xunlong/orangepi-build/blob/next/external/cache/debs/arm64/wiringpi_2.51.deb
3. The most important step was described here: https://github.com/Joshua-Riek/ubuntu-rockchip/issues/273
echo "BOARD=orangepi5plus" | sudo tee /etc/orangepi-release
Somehow this solves the issue. No idea how these things work tbh...
4. Check if pins are detected via
gpio readall
or add sudo
sudo gpio readall
You should get a table with all the pins and numbers like this:
5. Install wiringop-python just as stated in the manual: http://www.orangepi.org/orangepiwiki/index.php/Orange_Pi_5_Plus#How_to_install_wiringOP-Python
# get the dependencies
sudo apt-get update
sudo apt-get -y install git swig python3-dev python3-setuptools
# clone wiringOP-python repo, the branch should be "next" and NOT "main" or "master"
git clone --recursive https://github.com/orangepi-xunlong/wiringOP-Python -b next
cd wiringOP-Python
git submodule update --init --remote
python3 generate-bindings.py > bindings.i
sudo python3 setup.py install
The wiringOP-Python should be working now.