You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
May be the following could be useful for someone...
I've set up OctoPrint onto my Banana Pi M2 Zero SBC and wanted to use any plugin
that can control GPIO pins. But the results of my investigation were very sad -
I didn't found anything that can work not only on RPi!
So, as I want to change this sorrowful world and due to this fact I'd improved source code
of OctoLight plugin enabling it to work with any modern SBC that's using mainline kernel.
It's quite easy! The thing is to reject using RPi GPIO library and switch to libgpiod.
Yeah, of course there are some little inconveniences related to this manner, but they are
reaaly piece of cake.
So, at first step we need 'gpio' user group:
sudo groupadd gpio
Second, it's neccessary to append this group to OctoPrint's service account ('pi' in my case):
sudo usermod -aG gpio pi
Third, we must assign proper user group and access rights to '/dev/gpiochip' devices at OS boot.
I'm doing it with help of udev:
sudo su -c 'cat <<EOF > /etc/udev/rules.d/99-gpio.rules
SUBSYSTEM=="gpio",GROUP="gpio",MODE="660"
EOF'
Fourth, it would be nice to install libgpiod itself and also its utilities:
sudo apt install gpiod
Fifth, In OctoPrint virtual python environment run:
pip install gpiod
At this point we are ready to use libgpiod in OctoPrint server environment.
As for me, I'd just installed OctoLight plugin and replaced octoprint_octolight/__init__.py
with following text (Voila! It works!):
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello!
May be the following could be useful for someone...
I've set up OctoPrint onto my Banana Pi M2 Zero SBC and wanted to use any plugin
that can control GPIO pins. But the results of my investigation were very sad -
I didn't found anything that can work not only on RPi!
So, as I want to change this sorrowful world and due to this fact I'd improved source code
of OctoLight plugin enabling it to work with any modern SBC that's using mainline kernel.
It's quite easy! The thing is to reject using RPi GPIO library and switch to libgpiod.
Yeah, of course there are some little inconveniences related to this manner, but they are
reaaly piece of cake.
So, at first step we need 'gpio' user group:
Second, it's neccessary to append this group to OctoPrint's service account ('pi' in my case):
Third, we must assign proper user group and access rights to '/dev/gpiochip' devices at OS boot.
I'm doing it with help of udev:
Fourth, it would be nice to install libgpiod itself and also its utilities:
Fifth, In OctoPrint virtual python environment run:
At this point we are ready to use libgpiod in OctoPrint server environment.
As for me, I'd just installed OctoLight plugin and replaced octoprint_octolight/__init__.py
with following text (Voila! It works!):
Beta Was this translation helpful? Give feedback.
All reactions