GPIO Python library known to work with the ALL-H3/5-CC boards?

What GPIO Python library is known to work with the ALL-H3/5-CC boards?
We are using Raspbian and none seem to work, or complain that they don’t work with that CPU architecture

Please use the proper Linux gpio interface via python3-gpiod. This works across all devices and is the upstream standard.
See examples here: examples « python « bindings - libgpiod/libgpiod.git - C library and tools for interacting with the linux GPIO character device

You can grab the chip and line numbers from our wiring tool lgpio command.

Tried installing, but got:

pi@raspberrypi:~ $ python3 -m pip install -U --user pip gpiod
ERROR: Exception:
Traceback (most recent call last):
File “/usr/lib/python3.10/site-packages/pip/_internal/cli/base_command.py”, line 173, in _main
status = self.run(options, args)
File “/usr/lib/python3.10/site-packages/pip/_internal/cli/req_command.py”, line 203, in wrapper
return func(self, options, args)
File “/usr/lib/python3.10/site-packages/pip/_internal/commands/install.py”, line 266, in run
session = self.get_default_session(options)
File “/usr/lib/python3.10/site-packages/pip/_internal/cli/req_command.py”, line 74, in get_default_session
self._session = self.enter_context(self._build_session(options))
File “/usr/lib/python3.10/site-packages/pip/_internal/cli/req_command.py”, line 88, in _build_session
session = PipSession(
File “/usr/lib/python3.10/site-packages/pip/_internal/network/session.py”, line 289, in init
self.headers[“User-Agent”] = user_agent()
File “/usr/lib/python3.10/site-packages/pip/_internal/network/session.py”, line 132, in user_agent
linux_distribution = distro.linux_distribution() # type: ignore
File “/usr/lib/python3.10/site-packages/pip/_vendor/distro.py”, line 125, in linux_distribution
return _distro.linux_distribution(full_distribution_name)
File “/usr/lib/python3.10/site-packages/pip/_vendor/distro.py”, line 681, in linux_distribution
self.version(),
File “/usr/lib/python3.10/site-packages/pip/_vendor/distro.py”, line 741, in version
self.lsb_release_attr(‘release’),
File “/usr/lib/python3.10/site-packages/pip/_vendor/distro.py”, line 903, in lsb_release_attr
return self._lsb_release_info.get(attribute, ‘’)
File “/usr/lib/python3.10/site-packages/pip/_vendor/distro.py”, line 556, in get
ret = obj.dict[self._fname] = self._f(obj)
File “/usr/lib/python3.10/site-packages/pip/_vendor/distro.py”, line 1014, in _lsb_release_info
stdout = subprocess.check_output(cmd, stderr=devnull)
File “/usr/lib/python3.10/subprocess.py”, line 420, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
File “/usr/lib/python3.10/subprocess.py”, line 524, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command ‘(‘lsb_release’, ‘-a’)’ returned non-zero exit status 1.
Traceback (most recent call last):
File “/usr/lib/python3.10/runpy.py”, line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File “/usr/lib/python3.10/runpy.py”, line 86, in _run_code
exec(code, run_globals)
File “/usr/lib/python3.10/site-packages/pip/main.py”, line 31, in
sys.exit(_main())
File “/usr/lib/python3.10/site-packages/pip/_internal/cli/main.py”, line 70, in main
return command.main(cmd_args)
File “/usr/lib/python3.10/site-packages/pip/_internal/cli/base_command.py”, line 98, in main
return self._main(args)
File “/usr/lib/python3.10/site-packages/pip/_internal/cli/base_command.py”, line 214, in _main
self.handle_pip_version_check(options)
File “/usr/lib/python3.10/site-packages/pip/_internal/cli/req_command.py”, line 143, in handle_pip_version_check
session = self._build_session(
File “/usr/lib/python3.10/site-packages/pip/_internal/cli/req_command.py”, line 88, in _build_session
session = PipSession(
File “/usr/lib/python3.10/site-packages/pip/_internal/network/session.py”, line 289, in init
self.headers[“User-Agent”] = user_agent()
File “/usr/lib/python3.10/site-packages/pip/_internal/network/session.py”, line 132, in user_agent
linux_distribution = distro.linux_distribution() # type: ignore
File “/usr/lib/python3.10/site-packages/pip/_vendor/distro.py”, line 125, in linux_distribution
return _distro.linux_distribution(full_distribution_name)
File “/usr/lib/python3.10/site-packages/pip/_vendor/distro.py”, line 681, in linux_distribution
self.version(),
File “/usr/lib/python3.10/site-packages/pip/_vendor/distro.py”, line 741, in version
self.lsb_release_attr(‘release’),
File “/usr/lib/python3.10/site-packages/pip/_vendor/distro.py”, line 903, in lsb_release_attr
return self._lsb_release_info.get(attribute, ‘’)
File “/usr/lib/python3.10/site-packages/pip/_vendor/distro.py”, line 556, in get
ret = obj.dict[self._fname] = self._f(obj)
File “/usr/lib/python3.10/site-packages/pip/_vendor/distro.py”, line 1014, in _lsb_release_info
stdout = subprocess.check_output(cmd, stderr=devnull)
File “/usr/lib/python3.10/subprocess.py”, line 420, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
File “/usr/lib/python3.10/subprocess.py”, line 524, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command ‘(‘lsb_release’, ‘-a’)’ returned non-zero exit status 1.

The error tells you what went wrong. It’s expecting something from lsb_release -a and that command returns a non-zero value. Run lsb_release -a and see what is wrong.

pi@raspberrypi:~ $ lsb_release -a
Traceback (most recent call last):
File “/usr/bin/lsb_release”, line 25, in
import lsb_release
ModuleNotFoundError: No module named ‘lsb_release’

I tried
pi@raspberrypi:~ $ python3 -m pip install -U --user lsb_release
and got an almost identical error


File “/usr/lib/python3.10/subprocess.py”, line 420, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
File “/usr/lib/python3.10/subprocess.py”, line 524, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command ‘(‘lsb_release’, ‘-a’)’ returned non-zero exit status 1.

And:

pi@raspberrypi:~ $ sudo apt install lsb-release
Reading package lists… Done
Building dependency tree
Reading state information… Done
lsb-release is already the newest version (9.20161125+rpi1).
lsb-release set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

Where did you get the image from? It seems there’s some corruption since lsb_release is a basic function that’s supported in all Raspbian versions.

https://drive.google.com/drive/folders/1d77GtcYZjacrRsoCT8K-gL5thVSE9G6Z?usp=sharing
via
https://libre.computer/products/all-h3-cc/

Of course it might be corrupted somehow.
Sounds like reinstall is needed.
The only “work” done to it was another developer getting node.js to work.

Ah, that explains it. Those images are out of date. Please do not use those anymore. Run Ubuntu or port Raspbian from a Raspberry Pi using libretech-raspbian-portability. We will re-release the Raspbian images later next week.

Please let us know with post.
I was just about to reinstall the old image.

We have the beta of the new Raspbian images here: Index of /ci/raspbian/bullseye/

You need to export VENDOR=libre-computer and export BOARD=all-h3-cc-h5 for the wiring tool until we update the bootloader.