[GUIDE] WiringPi and WiringPi-Python installation in a simple way

joshua.yang
Posts: 242
Joined: Fri Sep 22, 2017 5:54 pm
languages_spoken: Korean, English
ODROIDs: XU4, XU4Q + Cloudshell2, H2, N2
Has thanked: 2 times
Been thanked: 24 times
Contact:

[GUIDE] WiringPi and WiringPi-Python installation in a simple way

Unread post by joshua.yang » Fri Sep 06, 2019 2:21 pm

Hi all.

I know some people use WiringPi and its Python wrapper for their embedded projects.

But it would make us quite bothered to use because it needs self-building on the development device.

So we had to do like,
Cloning WiringPi from Git repository, moving to that directory, trying to build that, oh I almost forgot, I need some build packages. Downloading the packages then trying again.
Too inconvenient. :(

So we were going to try to publish those packages on the proper/access-convenient channel. And we just did it. :)
Now you can install WiringPi and WiringPi-Python using apt and pip.

Here is the guide.

- WiringPi
We've uploaded WiringPi onto our Ubuntu Launchpad so that you can register our PPA using add-apt-repository and download that using apt.
Launchpad: https://launchpad.net/~hardkernel/+archive/ubuntu/ppa

Code: Select all

sudo apt install software-properties-common
sudo add-apt-repository ppa:hardkernel/ppa
sudo apt update
sudo apt install odroid-wiringpi
If you want to develop with its libraries, install the extra packages.

Code: Select all

sudo apt install libwiringpi-dev libwiringpi2
- WIringPi Python Wrapper
I've uploaded our WIringPi Python wrapper onto my PyPI account so that you can download using pip.
PyPI: https://pypi.org/project/odroid-wiringpi/

Code: Select all

sudo apt install python python3 python-pip python3-pip
 
# Python 2
sudo python -m pip install odroid-wiringpi
# Python 3
sudo python3 -m pip install odroid-wiringpi
Just one thing about using this new WiringPi Python wrapper is that I changed module name from wiringpi to odroid-wiringpi to avoid unforeseen conflicts.
So, from the latest version (2.44.4.0), we should import the module like the below.

Code: Select all

import odroid-wiringpi as wpi
You still can build those projects yourself on your ODROID. :)
I have updated our Wiki page too: https://wiki.odroid.com/odroid-n2/appli ... o/wiringpi

Have fun with our WiringPi and its Python wrapper.
Any feedback would be welcomed.
These users thanked the author joshua.yang for the post:
tobetter (Fri Sep 06, 2019 2:22 pm)

Post Reply

Return to “Ubuntu (All Linux'es)”

Who is online

Users browsing this forum: No registered users and 1 guest