How do i turn on gpio at connect

What is the problem?

i want to be able to have a gpio turn on at connect and off at disconect

What did you already try to solve it?

searched forum /google

Have you tried running in safe mode?

WRITE HERE

Did running in safe mode solve the problem?

WRITE HERE

Systeminfo Bundle

You can download this in OctoPrint's System Information dialog ... no bundle, no support!)

WRITE HERE

Additional information about your setup

OctoPrint version, OctoPi version, printer, firmware, browser, operating system, ... as much data as possible

i want to be able to have a gpio turn on at connect and off at disconect
any help would be much apreciated. thanks
martin

You should have found this:

hi i looked there and did try gpio controll and octo relay but they cant start gpio on connect
couldnt find any others.
martin

The plugin https://github.com/kantlivelong/OctoPrint-GCodeSystemCommands can be used to define GCODE commands that execute system commands.

In the OctoPrint Settings, GCODE Scripts, After serial connection... and Before serial connection you can add the GCODE commands you created with the plugin.

I'll leave the writing of system commands to toggle a GPIO pin as an exercise for the OP.

There may be a better way but this should work.

1 Like

thank you
system commands to toggle a GPIO pin on was ( gpio -g write 24 1)
the 24 being the gpio pin and the 1 for on off is the same but 0 at the end.
thanks
martin

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.