lanefu Posted March 17, 2021 Share Posted March 17, 2021 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 Link to comment Share on other sites More sharing options...
tparys Posted March 18, 2021 Share Posted March 18, 2021 Serious question. The sysfs gpio export interface is deprecated since 4.8, and you guys run bleeding edge kernels for your SBCs. Why do you want this? Also, the newer gpiod interface already has a native python interface. Is there need to reinvent the wheel here? 1 Link to comment Share on other sites More sharing options...
lanefu Posted March 18, 2021 Author Share Posted March 18, 2021 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 comment Share on other sites More sharing options...
lanefu Posted March 18, 2021 Author Share Posted March 18, 2021 Alternatively we could use the sweet ArmbianIO libraries made by @sgjava and plug into some jhipster generated boilerplate and have something pretty awesome as well. That would take care of rest and swagger etc Link to comment Share on other sites More sharing options...
lanefu Posted March 18, 2021 Author Share Posted March 18, 2021 More background on initiative here: https://armbian.atlassian.net/browse/AR-689 1 Link to comment Share on other sites More sharing options...
Halolo Posted June 25, 2021 Share Posted June 25, 2021 On 3/17/2021 at 8:37 PM, tparys said: Also, the newer gpiod interface already has a native python interface. Is there need to reinvent the wheel here? I have used gpiod on a personal project, so I wrote a limited python class + flask API: https://github.com/lanefu/sbc-gpio-pcf857x/pull/2 It is limited to the use case I saw in the bash library Link to comment Share on other sites More sharing options...
Recommended Posts