Skip to content

Add gpio access and control #37

Open
@LongLiveCHIEF

Description

@LongLiveCHIEF

On a test of the OctoPrint PSU control plugin via docker, I believe it is necessary to enable and document a few things related to using GPIO for our users.

The following 2 docker container settings are required for gpio dependent plugins to work:

  • cap-add SYS_RAWIO
  • --device /dev/mem

Additionally, the gpio device tree needs to be made writeable, and any pins that are controlled by octoprint plugins need to have corresponding INPUT/OUTPUT modes set, and the pin number registered in the /sys/class/gpio device tree.

This can be done manually with the gpio ubuntu package available from the wiringpi package in the default ubuntu registry.

I'm not sure if these plugins use this program, as I can't remember if I had to set things up manually the first time I installed PSU Control on a normal Octopi Raspbian image.

Tasks:

  • determine best practice for adding gpio channel manipulation so that the users have easiest possible experience when using plugins that utilize gpio controls
  • add any updates needed to Dockerfile or entrypoint script based on the determined best practice
  • determine if gpio plugins will automatically control pin mode if the appropriate system devices and packages are present, or if these need to be set manually

Documentation:

  • add docs about any necessary host commands/configs
  • docker-compose settings for cap_add and --device /dev/mem
  • any downstream Dockerfile changes needed to support gpio control if turns out that's the best practice

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions