erg
Posts: 19
Joined: Thu Oct 25, 2018 5:41 pm

pigpiod processor usage

Mon Sep 16, 2019 4:58 pm

Hello there,

I've been looking at the top output and noticed that pigpio consumes significant amount of processor power. It hovers from around 4.6% to 7% but spikes at around 15%.

I'm running it on raspberry pi 3B+ with 64bit kernel. Gentoo.

Is that normal? Could someone take a peak so that I could compare? I have no 32 bit system to check it or Raspbian, I'm curious.

Cheers

User avatar
joan
Posts: 14944
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: pigpiod processor usage

Mon Sep 16, 2019 5:43 pm

That sounds right.

I haven't done measurements for years (since the early Pis).

http://abyz.me.uk/rpi/pigpio/cif.html#gpioCfgClock

I think the time is mainly spent in checking for GPIO level changes.

erg
Posts: 19
Joined: Thu Oct 25, 2018 5:41 pm

Re: pigpiod processor usage

Tue Sep 17, 2019 5:58 pm

Thanks.

I was preoccupied there may be something wrong with my setup.

User avatar
joan
Posts: 14944
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: pigpiod processor usage

Tue Sep 17, 2019 6:26 pm

You can disable alerts processing. Use the -m option. http://abyz.me.uk/rpi/pigpio/pigpiod.html

I would suggest you do NOT do that except in extremis.

ryce358
Posts: 47
Joined: Wed Jun 17, 2020 11:06 am

Re: pigpiod processor usage

Thu Jul 09, 2020 11:32 am

Am I right in thinking that if I am using pigpio solely for an output (hardware PWM to be specific) then the -m flag is a reasonable thing to use in order to keep cpu usage down? Or is there the potential for exceptions or something else?

User avatar
joan
Posts: 14944
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: pigpiod processor usage

Thu Jul 09, 2020 11:35 am

If all you are doing is hardware PWM pigpio is a bit over the top. If you are not changing settings often you could start the daemon, set hardware PWM, then stop the daemon. The hardware PWM will continue without the daemon running.

Or just use wiringPi's gpio command.

ryce358
Posts: 47
Joined: Wed Jun 17, 2020 11:06 am

Re: pigpiod processor usage

Thu Jul 09, 2020 12:30 pm

I'm having issues with wiringpi. -m flag seems to be stable at the moment so I will keep that and look to work out my wiringpi issues later. Thanks joan.

Return to “Automation, sensing and robotics”