Migrating to Pi 5, trouble with pigpiod

It looks like pigpiod is no longer supported on the Raspberry Pi 5. I currently use node-red-node-pi-gpio to do PWM, which relies on pigpiod. What is the recommended alternative?

Some discussion here:

Note sure if it helps - I've gone back to a 4 while things settle on the 5 boards (and I thought Buster was bad!).

Thanks for the link. I tried the recommendation given by cymplecy to remove python3-rpi.gpio (it didn't exist) and the RPi.GPIO node, and to install rpi-lgpio (it was already installed). So nothing has changed.

Just a bit confused by your post, so just to clarify, are you saying that my method still works on a Pi5?

I can't start pigpiod on a pi5 running bookworm, so I took the steps you described and it still doesn't work. This is not so surprising because, as I mentioned, the package you suggested removing didn't exist and the one you said to add was already installed.

I'm using node-red-node-pi-gpiod, which requires pigpiod to be running. I have it configured to communicate via the loopback address on port 8888. Since pigpiod won't start, the node displays ECONNREFUSED 127.0.0.1:8888.

As I think was mentioned in that thread - Pigpiod doesn't work on a Pi5 and last time I looked into it - it is never going to :frowning:

So unfortunately you'll either need to use <Pi5 hardware or switch to using the new lgpio method :frowning:

Understood. There's no going back to <Pi5, in my case, so I'll get started with lgpio. Thank you.

@dceejay In the previous discussions you mentioned about modifying the install script for a Pi5, but couldn't find the source ?

I believe this is the repo if that's any help GitHub - waveform80/rpi-lgpio: A compatibility shim for lgpio emulating the RPi.GPIO API

Yes I do recall that. It did seem that lipid was the answer, but I can’t recall how far we got with trying to find a generic solution that wouldn’t break existing users as there were too many possible combinations of processor hardware, os 32 or 64 bit and versions thereof and then nodejs versions on top.

1 Like

I have modify "nrgpio.py" in "~/.node-red/node_modules/node-red-node-pi-gpio"

quick and dirty:
first import gpiozero at top of the python code of "nrgpio.py":

# Import library functions we need
import gpiozero

Then modify PWM-section:

    if cmd == "pwm":
        #print("Initialised pin "+str(pin)+" to PWM")
        try:
            freq = int(sys.argv[3])
        except:
            freq = 100

                                                #GPIO.setup(pin,GPIO.OUT)
        p = gpiozero.PWMLED(pin,frequency=freq) #GPIO.PWM(pin, freq)
        p.value = 0.01                          #p.start(0)

        while True:
            try:
                data = raw_input()
                if 'close' in data:
                    sys.exit(0)
                p.value = float(data)/100         #p.ChangeDutyCycle(float(data))
            except (EOFError, SystemExit):        # hopefully always caused by us sigint'ing the program
                p.release()
                sys.exit(0)
            except Exception as ex:
                print("bad data: "+data)

I control two fans for my powerinverter and two fans for the batterychargers of my solarsystem via PWM. After updating to bookworm they want work. I found this solution for me. Hope it will help someone else.

Sorry for my english text. I'm from Germany and not often write in english. Hope you understand.

3 Likes