Jump to content

WiringOP & Python on OrangePi 5 plus


Timur Timaev

Recommended Posts

Hello everyone!
 

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

Quote

Note that wiringOP has been pre-installed in the linux image released by Orange Pi. Unless the code of wiringOP is updated, there is no need to re-download, compile and install, just use it directly.

The storage path of the compiled wiringOP deb package in orangepi-build is:

orangepi-build/external/cache/debs/arm64/wiringpi_x.xx.deb

 

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:

Screenshot2023-12-13at01_43_10.thumb.png.5f4bfd89c422ba42d595596f34d0aafe.png

 

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines