Skip to content

Conversation

@mattzzw
Copy link
Contributor

@mattzzw mattzzw commented Jan 14, 2026

This PR adds the capability to control a gpio pin defined in the target's platformio.ini by -D PIN_GPIO via command line.

gpio 1 will set the pin HIGH
gpio 0 will set the pin LOW

States are not persisted, rebooting resets the pin to LOW.
This could be useful to control other hardware next to the repeater, like e.g. starting a RPi next to the repeater.
Implementation should be straightforward for other targets.

@IoTThinks
Copy link

To turn on/off a fan in repeater?

Then why not "set gpio 1 on".
We can use for all available GPIOs.

So we do not need to set -D GPIO=1

@mattzzw
Copy link
Contributor Author

mattzzw commented Jan 15, 2026

To turn on/off a fan in repeater?

As I wrote above:
This could be useful to control other hardware next to the repeater, like e.g. starting a RPi next to the repeater.

Then why not "set gpio 1 on".

This PR expects one GPIO to be defined. There's probably a thousand ways to implement this.
I needed to be able to control one GPIO. Expanding this to multiple GPIOs for multiple targets was a bit beyond my scope and capabilities ;-)

@JDat
Copy link

JDat commented Jan 15, 2026

What if I want to control 5 GPIOs? Code and config must be more generic.

@mattzzw
Copy link
Contributor Author

mattzzw commented Jan 15, 2026

Feel free to expand on this PR. Should be more or less straight forward, depending on the availability of GPIOs on different targets.

@JDat
Copy link

JDat commented Jan 15, 2026

Can you make it already with multiple GPIO in one pull request, so no need to expand or submit code in future?

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.

3 participants