Help convert simple bash library to python class


lanefu
 Share

1 1

Recommended Posts

We're using this library as the base to automating testing via power control in some of our SBC test farms.

 

https://github.com/lanefu/sbc-gpio-pcf857x/blob/main/lib/gpio.sh

 

It would be great to convert this in to a simple python3 class.    Given we use this with various SBCs, I would recommend using https://docs.python.org/3/library/subprocess.html#module-subprocess to continue to exec via the gpio shell command other than a native python gpio library.

 

extra credit: create a REST API via flask

extra extra credit: Add Swagger interface to REST API

extra extra extra credit: react interface to REST API :P 

Link to post
Share on other sites

Armbian is a community driven open source project. Do you like to contribute your code?

Was trying to keep things simple and quick when asking for help.  I figured the underlying components in the class cloud be retrofitted to a better gpio solution in the future.

 

Totally up for libgpiod seems like its come along quite a bit since I last used it. (No pullup or pulldown suppoty at the time.)  Would it play nice with my i2c expander?

 

10 hours ago, tparys said:

Is there need to reinvent the wheel here?

 

Whatever can be delivered fastest that is reliable.  If using the sysfs gpio commands from my script minimal gpio knowledge is really need by the developer.

Link to post
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...
 Share

1 1