A Step-by-Step Guide to Verifying the Installation of pigpio on Your Raspberry Pi

If you’re a newbie or an experienced user looking for a quick and easy way to check if you have the pigpio library installed on your Raspberry Pi, this article will guide you through the process. …


Updated August 17, 2023

Need help with your Raspberry Pi?
Contact Me!

Do you love silly Raspberry Pi Projects?
Check out my this YouTube Channel!


If you’re a newbie or an experienced user looking for a quick and easy way to check if you have the pigpio library installed on your Raspberry Pi, this article will guide you through the process.

pigpio is an important library for controlling GPIO pins and interfacing with hardware components on the Raspberry Pi platform. It provides a range of features such as PWM control, servo control, pulse generation, and more. If you’re using Python to program your Raspberry Pi, pigpio is an essential tool to have in your arsenal.

To check if pigpio is installed on your Raspberry Pi, follow these steps:

  1. Open a terminal window by clicking on the “Terminal” icon in the menu bar or pressing Ctrl+Alt+T.
  2. Type pigpiod and press Enter to start the pigpio daemon. The daemon is responsible for managing access to the GPIO pins. If it’s not already installed, you’ll see an error message saying “command not found.” In this case, you can install pigpio using the following command:
sudo apt-get update && sudo apt-get install pigpio
  1. Once pigpio is installed, start the daemon again by typing pigpiod in the terminal and pressing Enter. If everything is working correctly, you should see a message indicating that the daemon has started successfully:
sudo pigpiod
  1. To verify that pigpio is running, type the following command:
ps aux | grep pigpiod

This will display all running processes related to pigpiod, including the process ID (PID). If you see an output similar to this, it means pigpiod is running:

root       923  0.0  0.1   6876   652 ?        Ss   10:34   0:00 /usr/bin/pigpiod 
pi        955  0.0  0.0   44244   792 pts/0    S+   10:34   0:00 grep --color=auto pigpiod
  1. If you’re using Python to interact with pigpio, you can import the library in a Python script or the interactive shell to check if it’s installed correctly. Open a new terminal window and type python to start the Python interpreter:
python
  1. In the Python shell, type the following command to try importing pigpio:
import pigpio

If you don’t get any errors, it means pigpio is installed and ready to use on your Raspberry Pi. If you see an error message similar to “No module named pigpio,” then you need to install the library first using the command we mentioned in step 2.

That’s it! You now know how to check if pigpio is installed on your Raspberry Pi and can start using it for GPIO control and hardware interfacing projects. If you want to learn more about pigpio, visit the official website at http://abyz.co.uk/rpi/pigpio/.