1

According to https://raspberrypi.stackexchange.com/a/58825/42583, which is now nearly six years old,

one unique feature of pigpio is it times GPIO events at source so for any timing purpose pigpio is likely to be the most accurate.

In fact PIGPIO is what I've been using, and it indeed gave much better control of servos than whatever else I tried first.

Is it still the most accurate?

Daniele Procida
  • 405
  • 5
  • 17

2 Answers2

1

I'm not aware of any significant changes in the intervening years.

The sysfs interface has been deprecated in favour of the gpiochip interface. Any performance improvements seem to be marginal. gpiochip does provide GPIO event timestamps. Any improvement should be visible when used for decoding DHT11/22 signals. I measured little actual improvement in DHT11/22 decoding and pigpio still outperforms both sysfs andgpiochip in that regard.

joan
  • 71,024
  • 5
  • 73
  • 106
0

Accuracy is a meaningless concept here. All half dozen or so libraries in common use are accurate in that they do what they say on the box.

How they differ is in speed, overhead and convenience. E.g. pigpio uses a socket/pipe interface which imposes a significant overhead but allows the user access to functionality normally restricted to kernel code.

See Controlling Raspberry Pi GPIO with c and Python for a review I did 2 years ago.

In practice I use many depending on the task in hand. E.g. pigpio is good for servos because it uses hardware timers and is unaffected by other tasks.

Milliways
  • 59,890
  • 31
  • 101
  • 209