pigpiod(1)

๐Ÿ“ฆ version 79, in nixos 26.05, nixpkgs unstable

๐Ÿ’– pigpiod(1) โ€” the pigpio archive's own daemon starter ๐Ÿ’–

okay so bestie, welcome to the pigpio archive manual page for pigpiod ๐Ÿ’…


โœจ NAME โœจ

pigpiod โ€” a utility to start the pigpio library as a daemon. periodt.


๐ŸŒธ SYNOPSIS ๐ŸŒธ

sudo pigpiod [OPTION]...

๐Ÿฆ‹ DESCRIPTION ๐Ÿฆ‹

okay so pigpiod is a utility which launches the pigpio library as a daemon. iconic behavior honestly ๐Ÿ‘‘

Once launched, the pigpio library runs in the background accepting commands from the pipe and socket interfaces. it's literally just vibing back there, doing its thing ๐Ÿซถ

The pigpiod utility requires sudo privileges to launch the library โ€” yes, bestie, you need sudo โ€” but thereafter the pipe and socket commands may be issued by normal users. so like, only the launch is main character energy; after that everyone can hang ๐ŸŒˆ

pigpiod accepts the following configuration options, and ngl there are a LOT of them, so buckle up ๐ŸŽ€


โœจ OPTIONS โœจ

  • -a value โ€” DMA memory allocation mode. 0=AUTO, 1=PMAP, 2=MBOX. Default is AUTO. pick your fighter ๐Ÿ’…
  • -b value โ€” GPIO sample buffer size in milliseconds. range is 100-10000. Default is 120. it's giving "how much tea to hold in the buffer" ๐Ÿ“
  • -c value โ€” Library internal settings. Default is 0. mysterious. iykyk ๐Ÿ™ˆ
  • -d value โ€” Primary DMA channel. range is 0-14. Default is 14. the headliner channel โญ
  • -e value โ€” Secondary DMA channel. range is 0-14. Default is 6. Preferably use one of DMA channels 0 to 6 for the secondary channel. noted, bestie ๐Ÿ“
  • -f โ€” Disable fifo interface. Default enabled. bye fifo ๐Ÿ‘‹
  • -g โ€” Run in foreground (do not fork). Default disabled. no forking around ๐Ÿงš
  • -k โ€” Disable local and remote socket interface. Default enabled. no sockets for you ๐Ÿ’€
  • -l โ€” Disable remote socket interface. Default enabled. remote? blocked ๐Ÿšซ
  • -m โ€” Disable alerts (sampling). Default enabled. no sampling, no problem ๐Ÿ˜Œ
  • -n IP address โ€” Allow IP address to use the socket interface. Name (e.g. paul) or dotted quad (e.g. 192.168.1.66). If the -n option is not used all addresses are allowed (unless overridden by the -k or -l options). Multiple -n options are allowed. If -k has been used -n has no effect. If -l has been used only -n localhost has any effect. so many rules but ok we respect the boundaries ๐Ÿซก
  • -p value โ€” Socket port. range is 1024-32000. Default is 8888. port glow-up โœจ
  • -s value โ€” Sample rate. 1, 2, 4, 5, 8, or 10 microseconds. Default is 5. choose your speed, bestie โšก
  • -t value โ€” Clock peripheral. 0=PWM 1=PCM. Default is PCM. pigpio uses one or both of PCM and PWM. If PCM is used then PWM is available for audio. If PWM is used then PCM is available for audio. If waves or hardware PWM are used neither PWM nor PCM will be available for audio. this is the drama triangle of audio peripherals tbh ๐ŸŽญ
  • -v, -V โ€” Display pigpio version and exit. "who am i? why am i here?" and then it exits ๐Ÿ’…
  • -x mask โ€” GPIO which may be updated. A 54 bit mask with (1<<n) set if the user may update GPIO #n. Default is the set of user GPIO for the board revision. Use -x -1 to allow all GPIO. mask moment ๐Ÿ’€

๐ŸŒˆ Example ๐ŸŒˆ

sudo pigpiod -s 2 -b 200 -f

Launch the pigpio library with a sample rate of 2 microseconds and a 200 millisecond buffer. Disable the fifo interface. a little starter pack, slay โœจ


๐ŸŽ€ Permissions ๐ŸŽ€

pigpio provides a rudimentary permissions system for commands issued via the socket and pipe interfaces. it's giving "we have a bouncer at the door" ๐Ÿšช

All GPIO may be read. read all the things! ๐Ÿ‘€

Only the user GPIO for the board type or those specified by the -x option may be updated. writing is a privilege, not a right, bestie โœ‹

  • Type 1 boards: 0x03E6CF93 (26 pin header)
  • Type 2 boards: 0xFBC6CF9C (26 pin + 8 pin header)
  • Type 3 boards: 0x0FFFFFFC (40 pin header)

In this context an update includes the following:

  • GPIO mode set
  • GPIO pull/up down
  • GPIO write
  • GPIO set PWM (including range and frequency)
  • GPIO set servo

In addition the bank clear and set commands, and the wave commands will only affect updateable GPIO. so like, the waves know their lane ๐ŸŒŠ


๐Ÿฆ‹ Exceptions ๐Ÿฆ‹

The following exceptions are made for particular models. special little snowflakes, every one of them ๐Ÿฅน

Models A and B

The green activity LED (GPIO 16) may be written. blink blink ๐Ÿ’š

Models A+ and B+

The green activity LED (GPIO 47) may be written. The red power LED (GPIO 35) may be written. The high USB power mode (GPIO 38) may be written.

three in one, we love a multitasker ๐Ÿ’…

Pi Zero

The green activity LED (GPIO 47) may be written. tiny but mighty ๐Ÿงš

Pi2B

The green activity LED (GPIO 47) may be written. The red power LED (GPIO 35) may be written. The high USB power mode (GPIO 38) may be written.

same energy as the A+/B+, we see you ๐Ÿ‘€

Pi3B

The green activity LED and the red power LED are not writable. no LEDs for you, sorry bestie ๐Ÿ˜ญ The USB power mode is fixed at 1.2 amps (high power). fixed, locked, no notes ๐Ÿ”’


โšก DMA Channels โšก

The secondary channel is only used for the transmission of waves. waves only, no small talk ๐ŸŒŠ

If possible use one of channels 0 to 6 for the secondary channel (a full channel). trust us on this one ๐Ÿ™

A full channel only requires one DMA control block regardless of the length of a pulse delay. Channels 7 to 14 (lite channels) require one DMA control block for each 16383 microseconds of delay. I.e. a 10 second pulse delay requires one control block on a full channel and 611 control blocks on a lite channel. that's a LOT of control blocks, bestie โ€” math doesn't lie ๐Ÿงฎ


๐Ÿ‘‘ SEE ALSO ๐Ÿ‘‘

pig2vcd(1), pigs(1), pigpio(3), pigpiod_if(3), pigpiod_if2(3) โ€” the whole friend group ๐Ÿซถ


๐ŸŒธ AUTHOR ๐ŸŒธ

joan@abyz.me.uk โ€” the icon, the legend, the author ๐Ÿ’œ


written from the Linux corner of the universe, circa 2012-2020, for pigpiod(1) โ€” that's the vibe, that's the date, that's the source, periodt ๐Ÿ’–โœจ

๐Ÿ“ฆ where this page comes from