Skip to content

Add gpiod consumer label#282

Open
easytarget wants to merge 1 commit intokantlivelong:develfrom
easytarget:gpiolabel
Open

Add gpiod consumer label#282
easytarget wants to merge 1 commit intokantlivelong:develfrom
easytarget:gpiolabel

Conversation

@easytarget
Copy link

What does this PR do and why is it necessary?

Sets the GPIOD label (consumer field) when requesting GPIO pins (with the periphery library); by default the pin consumer is set to periphery while the pin is used. This change simply sets the consumer message to octoprint-[NAME] where 'NAME' is the printer name from the main OctoPrint settings.

How was it tested? How can it be tested by the reviewer?

Tested locally on my system, this trivial enough (arguments added on just two lines) that it can be reviewed and tested on any GPIOD enabled instance. Use gpioinfo | grep "\[used\]" to see the current list of used pins, status and consumer strings

Notes

This is trivial, and this plugin is currently stalled, but if anybody works on it again this would be a 'nice to have' change.

This is the result on my install

daisy@pi:~ $ gpioinfo /dev/gpiochip0 | grep line\ *8
	line   8:      "GPIO8" "periphery" output active-high [used]

becomes:

daisy@pi:~ $ gpioinfo /dev/gpiochip0 | grep line\ *8
	line   8:      "GPIO8" "octoprint-Daisy" output active-high [used]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant