Jump to content

How to use wiringpi python for banana pi cm4 io?


Recommended Posts

unable to access gpio using wiringpi python. I have tried steps available on banana pi wiki. but it throws error "/dev/gpiomem" is not available and then "This board is not odroid".

 

did anyone successfully implemented this?

 

Link to comment
Share on other sites

WiringPi is deprecated, must be some other high level lib that works with mainline kernel. Also you usually can't use applications designed for vendor proprietary kernel with mainline derived kernel. Check this instead:

 

Link to comment
Share on other sites

The distribution of my choice offers me ready-made binary packages out-of-the-box. However, I have to install the Python 3 bindings separately. I know that the command line tools are apparently also available out-of-the-box in Armbian, but I don't know if the Python 3 bindings are also packaged separately.

Link to comment
Share on other sites

10 hours ago, Igor said:

Should we install this by default?

I'm not sure who really needs the python bindings.
Users keep talking about WiringPi not working for their device, but they don't say what functionality they want to use with it. In the isolated cases where they do, it is such trivial applications that can be conveniently operated with the available command line tools. So no need to involve any programming activities.

 

And the same is true for the Sysfs API fraction. The existing command line tools cover the entire Sysfs spectrum and even go beyond.

 

For example, I would like to see how someone implements this one-liner with the sysfs:

gpioset --toggle 100ms,100ms,100ms,100ms,100ms,300ms,300ms,100ms,300ms,100ms,300ms,300ms,100ms,100ms,100ms,100ms,100ms,700ms --consumer panic con1-08=active

I'm curious about the precise timing to generate such a blinking pattern.

 

Or retrieving a pin for three keystrokes and resulting script execution:

gpiomon --num-events=3 --edges=rising con1-08 && bash-script

 

For the users who actually need more complex implementations and have the necessary coding skills, I think they should also be able to install the bindings with:

sudo apt install python3-libgpiod

And maybe someone wants to use C++ or Rust.

 

But first and foremost, people seeking help should learn to describe the basic problem they are trying to solve, rather than asking for help as they think it can be solved.
I don't usually respond to requests that don't match this, because nothing is more annoying than realizing that you have wasted unnecessary time on a solution when it could otherwise have been solved more appropriately.

 

And look, what was the immediate response to my given reference in response to a direct question?

On 3/4/2024 at 10:50 AM, Maverick said:

will it work with python?

In the case of such NOOBs, further engagement is usually not conducive.

Link to comment
Share on other sites

10 hours ago, usual user said:

Users keep talking about WiringPi not working for their device

 

10 hours ago, usual user said:

But first and foremost, people seeking help should learn to describe the basic problem they are trying to solve, rather than asking for help as they think it can be solved.
I don't usually respond to requests that don't match this, because nothing is more annoying than realizing that you have wasted unnecessary time

 

IMO, probably just some simple on/off commanding from known (Python) environment is the key?

 

"WiringPi" association / brand name / keyword just don't want to die off :( Yes, its on the level "OS is not working" without telling anything, not even where, what image, what hw. Additional  details: "Logs? Why do you need that???"

 

I could not agree more. IMO commercialization-consumerism of Linux, where RPi (and clones) played critical role, is the reason why we are seeing this. Often its discouraging when you help someone with a usable instructions or tip, but then you realize he is a decade away from understanding what you are telling him ...

Link to comment
Share on other sites

Thanks for the response guys. and let me tell you the exact reason why I am seeking help for Wiring pi. So basically we have developed baseboard for banana pi cm4 which has on board:

 

WS2812B LEDs

Real-time clock (RTC)

RF transceiver

IR transceiver

XBee module

SD card slot

MPU6030 motion sensor.

 

WiringPi's extensive Python libraries offer a convenient way to interact with these peripherals. While Raspberry Pi/Other supported board  enjoys mature GPIO (support through WiringPi, similar functionality remains limited for Banana Pi CM4.

I am Seeking Guidance, Not a Complete Solution, Let me  clarifies my objective:

My aim to gain knowledge and navigate the process independently.

Sharing my findings and experiences with the community is intended.

 

I welcome any insights or alternative solutions that the community might possess. I appreciate the previous responses and support.

 

Again I require assistance in utilizing WiringPi for  Banana Pi CM4.

Limited GPIO support on Banana Pi CM4 hinders the direct use of WiringPi.

I am seeking guidance and knowledge to overcome this obstacle.

 

Thank you again. 

Link to comment
Share on other sites

4 hours ago, Maverick said:

So basically we have developed baseboard for banana pi cm4 which has on board:

 

WS2812B LEDs

Real-time clock (RTC)

RF transceiver

IR transceiver

XBee module

SD card slot

MPU6030 motion sensor.

 

and a DTS was created?

Link to comment
Share on other sites

8 hours ago, Maverick said:

I require assistance in utilizing WiringPi for  Banana Pi CM4.

Read what the original author posted.

 

8 hours ago, Maverick said:

Limited GPIO support on Banana Pi CM4

Banana Pi CM4 has full generic GPIO support in mainline kernel ready to use. With libgpiod, all the necessary Python 3 bindings are available, so start writing your planned application. Since you have even developed the board yourself, you also have the necessary knowledge of which of the approximately 100 GPIO-capable pins you have wired where.

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