New pigpio - GPIO wrapper for Raspberry Pi

@Jeff_Borghoff,

Could the following command be entered in the Raspberry Pi terminal:

If pigpiod is running, then the bottom line should say something like pigpiod.service: Succeeded.

pigpiod can be manually enabled with the following command (then retry the status pigpiod command)

Does this work on the Pi?

Hello Jeff,

I reinstalled my Raspberry Pi 4B with the new operating system and there is an additional step to reload the daemon with the following command: ‘sudo systemctl daemon-reload’

Here are the modified quickstart steps that work on my 4B Pi:

• New MicroSD (32GB) formatted
• Install Imager and follow directions
• Raspberry Pi OS is now installed
• sudo apt-get update //(This updates the install files)
• sudo apt-get upgrade //(This command performs updates on apps)
• sudo apt-get dist-upgrade //Updates the OS distribution
• sudo rpi-update //Updates the firmware
• Reboot needed
• Install library (sudo apt-get install libunwind8) (should be installed)
• The pigpio is automatically installed and is bundled with the Raspbian Operating System
• Run the command ‘sudo systemctl enable pigpiod’ to start the daemon after rebooting
• Run ‘sudo systemctl daemon-reload’ to reload the boot programs
• Check to make sure it works with ‘sudo service pigpiod service’
• Download Eugene’s free library at Github: https://github.com/eugenedakin/pigpio-GPIO
• Drag and Drop the class into your project
• Add an LED and resistor to Pin #18
• Compile Example5-2
• sudo chmod +x Example5-2
• sudo ./Example5-2
• LED turns on and off when pushing buttons

Edit: I’ll update the book with an update when this works on your Raspberry Pi.

3 Likes

Hello, @Eugene_Dakin, thank you for your help. I’ve followed these instructions and I still see pigpiod: unrecognized service

image

sudo systemctl start pigpiod

1 Like

Hello @DerkJ, that does not seem to work.

pi@raspberrypi:~ $ sudo systemctl start pigpiod
pi@raspberrypi:~ $ sudo service pigpiod service
pigpiod: unrecognized service
pi@raspberrypi:~ $

no response means it’s started
check it with
systemctl status pigpiod

this will never work:
sudo service pigpiod service
you can’t call service at then end.
sudo service pigpiod start/status/stop
any of the slash items can be used.

1 Like

You are better off using “systemctl” for everything even webservices your create for example with systemd unit files.

1 Like

@Eugene_Dakin In the book I Wish I Knew How to… Program Raspberry Pi 4B Electronics with Xojo on page 84 wiring pi needs changing to pigpio?

Thanks @Gary_Scott,

I missed a few of these when changing from wiring pi to pigpio. I have made these changes for the next free update.

Thank you.

@DerkJ, is the Raspberry Pi working for you?

Here are the modified quickstart steps that work on my 4B Pi:

• New MicroSD (32GB) formatted
• Install Imager and follow directions
• Raspberry Pi OS is now installed
• sudo apt-get update //(This updates the install files)
• sudo apt-get upgrade //(This command performs updates on apps)
• sudo apt-get dist-upgrade //Updates the OS distribution
• sudo rpi-update //Updates the firmware
• Reboot needed
• Install library (sudo apt-get install libunwind8) (should be installed)
• The pigpio is automatically installed and is bundled with the Raspbian Operating System
• Run the command ‘sudo systemctl enable pigpiod’ to start the daemon after rebooting
• Run ‘sudo systemctl daemon-reload’ to reload the boot programs
• Check to make sure it works with ‘sudo systemctl status pigpiod’
• Download Eugene’s free library at Github: https://github.com/eugenedakin/pigpio-GPIO
• Drag and Drop the class into your project
• Add an LED and resistor to Pin #18
• Compile Example5-2
• sudo chmod +x Example5-2
• sudo ./Example5-2
• LED turns on and off when pushing buttons

Edit: Thanks for your help Derk.

@Eugene_Dakin yes on different ways: we’ve build almost the unimaginable with the Raspberry Pi. By now we use ligpiod (the native GPIO control in linux these days).

Systemctl is what ae use on a daily basis. It gives full services control over the system and self created service (unit) files.

More info on libgpiod
https://github.com/brgl/libgpiod/blob/master/README

1 Like

I’ll start a new topic to ask/compare libgpiod - it sounds very interesting :slight_smile:

1 Like

Eugene and Derek, I’m still not seeing positive results. I’ve followed the new steps.

pi@raspberrypi:~ $ sudo systemctl enable pigpiod
pi@raspberrypi:~ $ sudo systemctl daemon-reload
pi@raspberrypi:~ $ sudo systemctl status pigpiod
● pigpiod.service - Daemon required to control GPIO pins via pigpio
Loaded: loaded (/lib/systemd/system/pigpiod.service; enabled; vendor preset: enabled)
Active: active (running) since Wed 2020-12-16 14:53:17 EST; 4min 16s ago
Main PID: 19261 (pigpiod)
Tasks: 4 (limit: 4915)
CGroup: /system.slice/pigpiod.service
└─19261 /usr/bin/pigpiod -l

Dec 16 14:53:17 raspberrypi systemd[1]: Starting Daemon required to control GPIO pins via pigp
Dec 16 14:53:17 raspberrypi systemd[1]: Started Daemon required to control GPIO pins via pigpi
lines 1-10/10 (END)

Hi Jeff,

I must be not explaining something correctly, as it shouldn’t be this hard. Are you available for a zoom meeting so that we can chat about this in real time? I am available for the next 6 hours (its 1:25 pm in my time zone).

1 Like

It was a pleasure to talk with you @Jeff_Borghoff,

In summary, the new version of the Raspberry Pi doesn’t show the last lines in a terminal. The Ctrl+C keys can be pressed to return the terminal back to a terminal prompt and show the entire message.

Glad to see that your Raspberry Pi is working :slight_smile:

3 Likes

Am I the only one that reads “pigpio” as “pig - pie - oh” instead of “pie - gee - pee - eye - oh”?

5 Likes

It says active running. So it’s working.
Just make sure you use the terminate function before closing or it won’t release the gpio usage after you close your app.

Thank you for your help @Eugene_Dakin

1 Like

@DerkJ, the terminate function?

LOL, I hadn’t thought about pronouncing it that way :slight_smile: