[squeak-dev] raspberry question

tim Rowledge tim at rowledge.org
Thu Apr 27 23:59:44 UTC 2017


> On 27-04-2017, at 11:51 AM, Denis Kudriashov <dionisiydk at gmail.com> wrote:
>> WiringPi (www.wiringpi.com) is a decent library to make it easier for Ardunio habitués to adapt. It provides a lot of good stuff and I used it for some time in the early days of the ScratchGPIO work. Where it falls down is Gordon’s insistence on rather aggressively exiting the process when errors occur. Eventually that got a bit annoying.
> Yes, I was also surprized. But there is env variable to disable this behaivour

Well, yes, supposedly. Now it must be at least a year since I looked at the wiringPi code so I’m potentially out of date, but it didn’t actually do what one would need back then.

> 
> The library I moved over to, and that is used in the HardwarePeripherals package for Pi, is pigpio (http://abyz.co.uk/rpi/pigpio/). It is a fair bit more sophisticated and offers both locally bound and daemon versions of the core - I use the daemon because that avoids the all-too-common problem of ALSA screwing up interrupt handling. It also allows for the daemon to be running on a *different* Pi, giving remote control for free.
> Pigpio has a lot of clever stuff that gets down to the gpio hardware better than wiringPi. Both are installed by default on Raspbian so it is no problem to choose either for any project you are considering.

And… 

> 2017-04-27 20:51 GMT+02:00 Denis Kudriashov <dionisiydk at gmail.com>:
> The library I moved over to, and that is used in the HardwarePeripherals package for Pi, is pigpio (http://abyz.co.uk/rpi/pigpio/).
> 
> By the way what complexity these libraries solve. GPIO interaction looks like simple file access. Am I wrong?
> 

It isn’t horribly complex but it’s not trivial either. There are ways to drive the GPIO pins quite directly via device registers, or via file system calls. The most flexible  (and probably slowest, admittedly) is via the pigpiod daemon because you don’t need to use `sudo`. Except, for bizarre reasons no one has been able to explain to me, when using xrdp to access the desktop. 

Both libraries provide a lot of helpful support in different ways. WiringPi adds sort of device drivers for popular (read “chips Gordon knows about”) devices so that it is easy to control an ADC etc. Pigpio provides some neat sound output via pins stuff, i2c & SPI handling, pwm driving (useful for servos for your robotics projects) and some event trigger stuff I never got to use. By and large you get faster response to problems and questions from joan than Gordon, largely because the latter has got deep into break baking and has less time to pay attention. Both are good resources, depending upon your needs.

tim
--
tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim
Useful random insult:- Suffers from Clue Deficit Disorder.




More information about the Squeak-dev mailing list