Skip to content
View in the app

A better way to browse. Learn more.

Armbian Community Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Help convert simple bash library to python class

Featured Replies

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 

  • Author

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.

  • Igor locked this topic
Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.