• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer

KaliTut

Kali Linux tutorial and Linux Tips

  • Home
  • Raspberry Pi
  • Privacy Policy
  • About us
  • Affiliate disclaimer

How to install pigpio on raspberry pi

November 26, 2017 by Kalitut

Control and program Raspberry Pi pigpio (shell/bash)

raspberry pi pigpio

Compared to controlling and programming the GPIOs via “sysfs”, “pigpio” on the command line is a simplification. The command line tool “pigs” also supports the programming of a GPIO as PWM and servo.
“pigpio” is also the preferred method for controlling and programming the GPIOs on the command line.

install pigpio on raspberry pi

If not already installed, the installation of “pigpio” is done with the following command.

sudo apt-get install pigpio

The control of the GPIOs is done with the command line tool “pigs”. For this to work, you must first start the pigpio daemon.

sudo systemctl start pigpiod

If you want the daemon to start automatically at system startup, then execute the following command.

sudo systemctl enable pigpiod

Then you can configure the individual GPIOs.

Configure raspberry pi GPIO as input or output
Here we select the GPIO 17 (pin 11) and GPIO 18 (pin 12) as examples to configure them as output and input. For this the BCM numbering of the chip is used. So the number of the GPIO and not the pin.

  • Raspberry Pi GPIO assignment

If the GPIO 17 is to be configured as output, the following command applies.

pigs modes 17 w

By default, the output gets the state “low” or “0”.

If the GPIO 18 is to be configured as an input, the following command applies.

pigs modes 18 r

State of a GPIO output set
Basically you can only set outputs. To set the state of a GPIO output to “high”, the following command is sufficient.

pigs w 17 1

To set the state of a GPIO output to “low” the following command is sufficient.

pigs w 17 0

Determine / read GPIO status
To determine the state, ie “high” or “low”, at a GPIO, the following command is sufficient. The GPIO can be both an input and an output.

pigs r 18

The output “1” stands for “high” or “0” for “low”.

Troubleshooting
When executing the pigs commands, the error message “socket connect failed” appears. This does not mean that the pigpiod daemon is not running. You have to start it yet.

Commands to control “pigpiod”
Start pigpio daemon automatically at system startup:

sudo systemctl enable pigpiod

Disable system startup:

sudo systemctl disable pigpiod

Start pigpio daemon:

sudo systemctl start pigpiod

Stop pigpio daemon:

sudo systemctl stop pigpiod

Show status of the pigpio daemon:

sudo systemctl status pigpiod
Post Views: 104

Filed Under: Raspberry Pi Tagged With: raspberry pi pigpio

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

Follow us

  • Facebook
  • Twitter
  • YouTube

Categories

  • algorithm
  • Android Ai coding
  • Android pentesting tools
  • Arduino
  • Artificial Intelligence
  • Books
  • ChatGPT Prompt
  • Darknet
  • database
  • General
  • Github Tools
  • Hacking
  • Kali Linux
  • Linux
  • Linux Commands
  • Network Administrator
  • Penetration Testing
  • Penetration Testing Tools
  • PowerShell
  • Raspberry Pi
  • resources
  • Review
  • Termux
  • Tutorials
  • Ubuntu
  • Uncategorized
  • Video Tutorials
  • vmware
  • WiFi Adapter
  • WiFi Pentesting
  • Wireless Router
  • Wireshark

Recent Posts

  • Transforming Photos with ChatGPT Prompt : A Cinematic Double Exposure in a Post-Apocalyptic World
  • Stryker Android App: Your Mobile Pentesting Powerhouse
  • Alfa awus036ach review
  • Alfa AWUS1900 for Wireless Penetration Testing
  • How to Run DeepSeek AI Locally on Kali Linux – Step-by-Step Guide

Footer

Kalitut

Kalitut.com goal is to share the knowledge for free, help you find the best tools on the web and provides tutorials

Find us on social media

  • Facebook
  • Pinterest
  • Reddit
  • Twitter
  • YouTube

Copyright © 2025

  • Home
  • About us
  • Privacy Policy
  • Affiliate disclaimer