GPIO config from config.txt on Balena

There’s a new(ish) GPIO config setup you can do on raspberry pi as discussed here:
https://forums.raspberrypi.com/viewtopic.php?f=117&t=208748

For example you add to the config.txt:

      # Set GPIO12 to be an output set to 1
      gpio=12=op,dh

Is it possible to add these to device/fleet configuration somehow?

I looked in the docs but couldn’t see anything specific to this only the dtparam and dtoverlay stuff.

Thanks :pray:

Would BALENA_HOST_CONFIG_gpio with value set to 12=op,dh work?

Thanks for this @shawaj does this work for you? We are internally testing!

We will keep you updated!

1 Like

Thanks Marc!

1 Like

@mpous the page here shows RESIN_HOST_CONFIG_gpio as a valid parameter but I just wondered how to use it.

Would the value just be set to "12=op,dh" in my above example?

While I don’t have a pi4 to test it atm, I would expect it to work exactly like you describe.

Did you test it?

1 Like

Thanks @aethernet - I’ll test it this evening if I can and report back :blush:

@aethernet - doh! Just realised there is an option in configuration screen that says:

Allows GPIO pins to be set to specific modes and values at boot time.

Which corresponds to RESIN_HOST_CONFIG_gpio! Not sure how I missed that before.

I can confirm that what I posted above had the expected results. Should have tried it first but maybe this might be helpful for others in any case :wink:

That’s an excellent news!