I think I did something similar to led_blink.py, the problem is that I obtain this error, the problem is that appears errors like the once below,
(FruitFlyIAvenv) root@rock-4c-plus:/home/rock/FruitFlyIA# python GPIO_test.py
Traceback (most recent call last):
File "GPIO_test.py", line 7, in <module>
chip = gpiod.chip(chip_name)
File "/home/rock/FruitFlyIA/FruitFlyIAvenv/lib/python3.8/site-packages/gpiod/libgpiodcxx/__init__.py", line 105, in __init__
self.open(device, how)
File "/home/rock/FruitFlyIA/FruitFlyIAvenv/lib/python3.8/site-packages/gpiod/libgpiodcxx/__init__.py", line 132, in open
chip_struct = func(device)
File "/home/rock/FruitFlyIA/FruitFlyIAvenv/lib/python3.8/site-packages/gpiod/libgpiod/__init__.py", line 1098, in gpiod_chip_open_lookup
chip = gpiod_chip_open_by_label(descr)
File "/home/rock/FruitFlyIA/FruitFlyIAvenv/lib/python3.8/site-packages/gpiod/libgpiod/__init__.py", line 1065, in gpiod_chip_open_by_label
chip_iter = iter(gpiod_chip_iter())
TypeError: iter() returned non-iterator of type 'NoneType'
That’s why I’m asking about version (or maybe I’m installing the wrong library). Because my pip gpiod it’s 1.5.4 and wiki says it’s deprecated and don’t have the gpiod.chip() method.
First off, which image you are using? BTW We don’t officially support Ubuntu so I’d suggest you use a recent Debian system instead.
Secondly, once you installed python3-libgpiod (and make sure you uninstall the one from pip), you should find a few samples under /usr/share/doc/python3-libgpiod/examples/. Please try if you can run those.