Jump to content

Recommended Posts

Posted

I finally found an official source code on the download page of OrangePI that has a version of wiring pi with support for the Orange PI 5 - unfortunately that code is not on the github of orangepi yet. What would be the best way to get this code and the gpio tool into armbian? Build a PPA and package for that one? I don't mind forking their repo and adding the mods but I'm not familiar with generating debian packages.

 

Posted

thanks very much.  My skill set as a programmer is limited so I would need some guidance on installation, code samples are very helpful. 

 

Jim Peterson

Posted
6 hours ago, jimmm said:

My skill set as a programmer is limited so I would need some guidance on installation, code samples are very helpful. 

In that case, I'd recommend a raspberry pi board or arduino for getting familiar with GPIO - the Orange Pi 5 is pretty much bleeding edge, and all the GPIO stuff is rather experimental. Probably going to be different in few months but right now the GPIO support is quite limited. Also most of the GPIO tools were designed originally for the RPi board.

Posted

I am competent with raspberry pi 4 gpio my request is for the gpio library that works with orange pi and the syntax that is used

 

thanks again

jim p

 

Posted

I have noy yet played aroud with GPIO on the Banan Pi 5, but for the Banan PI Zero I gave up on trying to use a working Python library and resorted to using the command line tools to get some basic functionality. I ended up calling the commands from Python code.
 

import os
stream = os.popen('gpio mode <PIN> input')
stream = os.popen('gpio read <PIN>')
output = stream.read()
print(output)


I can see that Banan Pi 5 has also gpiodetect, gpiofind,  gpioget,   gpioinfo,    gpiomon,  gpioset commands, so probably something like this might work.
 

root@loovsys:~# gpiodetect 
gpiochip0 [gpio0] (32 lines)
gpiochip1 [gpio1] (32 lines)
gpiochip2 [gpio2] (32 lines)
gpiochip3 [gpio3] (32 lines)
gpiochip4 [gpio4] (32 lines)
gpiochip5 [rk806-gpio] (3 lines)

root@loovsys:~# gpioget gpiochip0 2
1
root@loovsys:~# gpioget gpiochip0 3
0


I hope this will give some ideas to the direction that you can explore and report back how it goes. 

Posted (edited)
14 minutes ago, JiM022 said:

What about this repo

This repo is missing the support for OPI 5. You have to download the code from the link I posted above to get the GPIO working. I started working on a ppa repo and cloning their repo but did not finish that stuff yet... not too familiar with the debian packaging system

Edited by OttawaHacker
Posted
17 hours ago, jimmm said:

I am competent with raspberry pi 4 gpio my request is for the gpio library that works with orange pi and the syntax that is used

Btw the library above is the same as the RPI4 one... All the GPIO tools seem to be forks of the rpi ones.

Posted

Here's a quick and dirty way to get the deb packages:

 

Step 1: install debhelper

sudo apt-get install debhelper

 

Step 2: get the wiringOP source code from the google drive and unpack it

 

Step 3: unfortunately, the source code needs two fixes

 

in debian/wiringpi.install remove the following lines:

debian/tmp/usr/man     usr/share
README.TXT             usr/share/doc/wiringpi
 

in devLib/Makefile change the following line:

INCLUDE        = -I.

to

INCLUDE        = -I. -I../wiringPi

 

Step 4: build the binary packages:

from within the "wiringOP" folder run

dpkg-buildpackage -b

 

This will give you the following files in the ".." folder:

libwiringpi2_2.26~iwj_arm64.deb
libwiringpi-dev_2.26~iwj_arm64.deb
wiringpi_2.26~iwj_arm64.deb
 

Step 5: install those using dpkg

dpkg -i libwiringpi2_2.26~iwj_arm64.deb libwiringpi-dev_2.26~iwj_arm64.deb wiringpi_2.26~iwj_arm64.deb

 

This is a quick hack to get you the packages you need. With python I can't help you, since it lacks the debian folder and Python and me are not on friendly terms. 😉

 

Also: I did not test, if the packages works in any way. And the way the packages are built is definitely not for distribution, as they lack the proper cleanroom build.

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