GPIOZERO-ENV(7)

πŸ“¦
version 2.0.1 Β· 2 versions
, in ubuntu noble, ubuntu questing

πŸ’– GPIOZERO-ENV πŸ’–

okay bestie, listen up β€” this is the gpiozero-env page from the gpiozero manual, and it's literally just a lil cheat sheet of the environment variables that the whole GPIO Zero fam reads. ✨


🌸 NAME 🌸

gpiozero-env β€” GPIO Zero environment vars πŸŽ€

okay so here's the tea: every single utility that GPIO Zero ships with will happily accept the following environment variables. like, all of them. no cap. πŸ‘‘

πŸ¦‹ The Variables Themselves πŸ¦‹

  • GPIOZERO_PIN_FACTORY β€” this one's the main character, fr fr. it decides which library gets used to talk to the GPIO pins. if you don't set it, the default behaviour is a whole lil audition process: it tries to load lgpio first, then RPi.GPIO, then pigpio, and finally it gives up and falls back to a native Python implementation. valid values include "lgpio", "rpigpio", "pigpio", "native", and "mock". and the "mock" one? πŸ’… iconic. it's most useful on non-Pi platforms because it emulates a Raspberry Pi model 3B (by default). so you can vibe on your laptop and pretend. we love a cosplay king.
  • PIGPIO_ADDR β€” the hostname of the Raspberry Pi that the pigpio library should attempt to connect to (this only matters if the pigpio pin factory is being used, just so we're clear 🫢). defaults to localhost. very "i'll just stay home" of it.
  • PIGPIO_PORT β€” the port number the pigpio library should attempt to connect to (again, only if the pigpio pin factory is being used). defaults to 8888. yes bestie, 8888, the luckiest lil port. ✨

πŸ‘€ SEE ALSO πŸ‘€

go read these next, they're the friend group:


πŸ’œ AUTHOR πŸ’œ

Ben Nuttall β€” the author. slay.


2015-2024 Ben Nuttall β€” copyright, periodt.


reminder bestie: these are environment variables, so set them in your shell or your service config before you launch whatever gpiozero tool you're using. that's just how env vars work, no notes πŸ’…

and that's the whole page!! this was gpiozero version 2.0.1, dated Feb 15, 2024, and honestly? she ate. πŸ“ mwah, go blink an LED for me. πŸ’–βœ¨πŸ¦‹

πŸ“¦ where this page comes from