kantlivelong / OctoPrint-PSUControl

Smart control of your power supply via GPIO, GCODE Command, System Command, or variety of sub-plugins.
GNU Affero General Public License v3.0
203 stars 113 forks source link

need help with setting up gpio in octoprint docker #270

Open imstupidwithlinux opened 1 year ago

imstupidwithlinux commented 1 year ago

My octoprint install is running inside a docker container and recently I've built a relay into my psu to switch it on and off but when typing kn the correct gpio pin it doesn't do anything, homebridge inside a docker container works without any problems and can switch the relay

garismaatti commented 11 months ago

Not sure if helps in your case, but managed to get my setup working by:

  1. Installing also https://github.com/kantlivelong/OctoPrint-PSUControl-RPiGPIO plugin
  2. Giving docker container access to GPIO pins by mounting '/dev/gpiomem' device similar to example $ docker run --device /dev/gpiomem -d whatever (from https://stackoverflow.com/a/48234752)
  3. Setting PSU control to use RPi-GPIO plugin
  4. Setting RPi-GPIO plugin to control correct pin on raspberry pi3

And I highly recommend to follow your octoprint container logs while debuging.