New pigpio - GPIO wrapper for Raspberry Pi

Hello everyone,

A new pigpio wrapper has been created for use with Xojo 2019 r3.1 (API 2), Buster (Raspberry Pi OS), and uses pigpio (wiringPi is deprecated). This wrapper is free and is located at the GitHub location: Eugene Dakin pigpio-GPIO .

This is an aid for those who are developing electronics for the Raspberry Pi an their associated electronics.

Special mention for previous data was with the original work for the first Raspberry Pi wiringPi code to Xojo library was with Paul Lefebvre ( ). Another library was created by Ulrich Bogun ( ) and has been instrumental with the creation of this library.

Teaser: A new Raspberry Pi book has been created and will be released in the next week or two. The book has many examples that exclusively uses the new pigpio wrapper.


Hi Eugene,
This is all great and I am sure its going to be of good use to many.

May I ask, is there any plan for the many people who are not users of API2 to benefit from this project, ie everyone who does not have 19r3 or the very many who choose not to use anything beyond 19r1.

And may I ask very specifically, why API1 is not a consideration in the project currently and, if there are some major limitations in API1 that would render the new project unusable?

Finally, does the tantalizing teaser for the new book allow me to ask if any of it includes API1 code or is it limited in scope and usability by offering API2 only code examples.

Sadly if the answers to API1 compatibility is ‘no’ then I am going to be left out in the cold along with a lot of other people, which will be a shame.

Many Thanks


Hi Mark,

Good questions! Let me answer each one.

Yes, those who do not use API2 can use this project. The pigpio library can be used in both Xojo API1 and Xojo API2. The parts of code which are API2 are portions of code which are Xojo-specific, such as
Listbox1.DeleteAllRows has been changed to Listbox1.RemoveAllRows. Electronics code such as Call pi.gpio_write(MOSIPin, pi.PI_HIGH) is the same for both API1 and API2.

The previous Raspberry Pi books all worked with API1, and there were three major changes: 1) Raspberry Pi OS, 2) Xojo API2, and 3) pigpio (wiringPi deprecation). I updated all of the code for these 3 changes. The API1 code has been written in previous books, and the examples use the same electronics with updated code. There is not any major limitations specifically to API1. The only reason why API1 was not considered is that this Xojo code has been written in previous books.

There is a major limitation that Xojo does not support interrupts, and that was a topic brought up in earlier discussions, and this is not specific to API1 or API2.

I converted all of the API1 code to API2 in this book. When I updated the code to Xojo API2, there was a Message box that constantly reminded me that the conversion is only one-way, meaning I can’t convert back to API1.

Most of the programs lightly use the GUI. The one example program that is more complicated graphically is Example 25-1 which connects to a gyro, accelerometer, and magnetometer which uses dial-gauges. This GUI code is also included in previous editions of the book.

Yes, converting code to API2 has been difficult, and the largest issues have been workarounds for interrupts. This is due to Xojo’s implementation of not updating the GUI with external methods - it was very challenging.

The good news is that wiringPi seems to work with the GPIO for now. Since this library is deprecated, then its a matter of time until some issue happens. I guess the same can be said for Xojo’s API1, as its a matter of time until something becomes outdated and then doesn’t work. Similarly, the same can be said for older versions of the Raspberry Pi OS, as it will eventually become out-of-date. I wish there was a better option, and I wanted to update all aspects of the book at once, as there were others who had the latest versions of the OS, API2, and pigpio which were left out in the cold too.

OK, its too late now for me to fully comprehend the text, and I am sad to say I have not got the hang of the quote buttons yet, so do please forgive me for being forumlexic.

The answer in your first quote (sorry I can only reference it like that) suggests that it removes API1 code rather than has both available, except where the call is the same for both API.

This suggest to me, as a user of API1, that it is being dropped in favour of API2 simply because it is ‘depreciated’ and not because it is a technical hurdle, API1 as far as I know is going to be with us for a very significant time, unless you would like to tell us something to counteract the company stated resolution regarding API1.

“There is a major limitation that Xojo does not support interrupts, and that was a topic brought up in earlier discussions, and this is not specific to API1 or API2.”

thats how I am quoting, sorry!
ok, so why say this at all, Xojo not supporting interrupts has nothing, as you say, to do with anything, it is a non Xojo problem.

Perhaps it is apparent why I am asking the questions, to be honest my only point is really:- has there been a VERY specific choice made by yourself, or sponsors, that would lead to the removal of reference to API1, have you considered that there are an ENORMOUS number of API1 users that you are removing from the potential market for your book?

Your final paragraph which includes this:-
“I guess the same can be said for Xojo’s API1, as its a matter of time until something becomes outdated and then doesn’t work”

WHAT THE FECK! it better not be the case, or the user base for the last 20 years has just been dropped off a cliff and we are all cast into the ‘who cares about the old customer’ pile.

Please at least consider that there are a very many non API2 users in this universe, how many API2 ONLY users are in the market for a book?

by the way, your post looked like an advert to me when I saw it, whether that has any importance I don’t know nor expect you to care.

also please remember (I have read the forum guidelines, and got a badge for it(whatever that means)) my response to you is neither personal, political nor aggressive.
I really want to know why the feck API1 is not still at the party, pisses me right off, in a PC applicable way, not.

Hi Mark,

Its all good, and I am still getting used to the forum :slight_smile: All I am doing is updating the code to the newest versions. There isn’t a technical hurdle for API1, and to my understanding API1 is going to be with us for a significant time. LOL, I am not privileged to anything that Xojo is doing, as you likely know much more than I do about it.

The previous wiringPi with previous versions of API1 were more stable with interupts than with pigpio with API2. It seems like the problem for interupts is getting worse. I am not sure if its a an API1 issue, API2 issue or Xojo update issue, but interupts are less stable. Could it be API2? Sure, or maybe not. I am just providing more information, thats all. :slightly_smiling_face:

The only thought was that I was updating the book to the latest version. Since wiringPi is still working and API1 still works, then the previous books can continue to be used as the code works as of today.

You and I are on the same page. One of the reasons why I am going to update the books to API2 is that updates are being performed on API2. Similar to you, I didn’t like to see 10 years of some work become obsolete, and I am sure that Bob would have preferred continuing to have his training videos online. The API1 books will continue to be available.

Yep, I get it. There is some project code that I can’t update or clients want the performance increased. I am actually curious as to what the ratio of API1 to API2 number is? I have absolutely no information about this.

The Teaser part was definitely an Advert. The pigpio wrapper was to let the community freely use the wrapper. Could advertising that the wrapper is free be considered an advert? Yea, I guess it could. What would be another way to announce free stuff to the community? Thoughts?

Very cool. Thanks for confirming your tone. After reading your comment I treated your comments like a good friend having a good discussion. No offense taken.

I did some back-of-the-napkin calculations for supporting API1. Here is my rough-flawed-thoughts:

I have roughly written 20 books for Xojo. Lets say it takes 2-4 months to update one book (lets use 3 months to make it easy on me). 20 books to API2 that contains the current data at 3 months each is 60 months or 5 years, which is 2025. Updates to API2 have minimal new content. There are many other books that I would like to write with new content, and this takes roughly 6 months to a year for each one. Canvas automation is one that I would like to write, as an example. There are books (such as Excel 2016) which have new content for Office 2019 and likely 2022, and I haven’t even started on those updates yet. LOL. :slightly_smiling_face:

As I write this response, it looks like API1 will be around for a while. It will take time for API2 to get momentum and it looks like it is here to stay. I waited about a year before I even thought about updates since there were too many changes to the language. I am not ignoring API1, as my books are still around. By the time 2025 appears, there will likely be more programmers using API2 than API1.

Would I like to return to API1, heck ya! Will it happen, likely not. Sorry, the writing seems to be on the distant wall that API2 is going to be here for the long-term. This is my humble opinion.

Thanks for your comment, as my responses are neither personal, political, or aggressive. These responses are more like sharing a friendly beer with a friend at the corner tavern. :beer:

As a Xojo newbie I can say that I am definitely looking forward to your books being rewritten to account for API2.

1 Like

Take my money!

1 Like

I bought your earlier book, which was great - I very much look forward to this upcoming one! (even though I’m still on 2019r1 for the foreseeable future)

1 Like

It’s out now!

1 Like

Book purchased. Thank you for your efforts with this.

I hope you enjoy the book as much as I enjoyed writing it.

It shows:

Uses the latest Raspberry Pi Operating System (Buster)

Is that Raspian or the new Raspberry Pi OS? I thought only Raspian had the version name “Buster”?

I have seen it written and used both ways. Raspberry Pi has called it Raspberry Pi OS - Buster. When I sudo apt-get upgrade when running Raspberry Pi OS, then the terminal shows Buster. It is a little confusing, and this is the naming convention that Raspberry Pi seems to want to use.

Ok, even more confused now, but you are speaking of the Raspberry Pi OS, the latest version that has replaced Raspian, correct?

Yes your right. Raspberry Pi OS is the latest version that has replaced Raspbian. The website ( says Raspberry Pi OS (previously called Raspbian).

1 Like


1 Like

Same - now I just have to find the time to go through it all. It is a very comprehensive book - I love tinkering with electronics and my Pi & arduino sbc but have used mainly Python and NodeRed for interfacing with them so far so looking forward to giving Xojo a go.

Since you have used Python, Xojo is fairly similar and the learning curve will be lower. The benefit of Xojo is the use of a GUI IDE for increasing the speed of an application with a window.

There are many examples and much of the theory is also explained. Feedback from some previous book owners use this as their reference guide for other projects too.

I am sure the book will be helpful.

1 Like

Have you mentioned the book on the Raspberry Pi forums?

No I haven’t looked into that yet. I am not familiar with the forums or the rules. Do you happen to know which forum is most popular?

Thanks for the helpful suggestion!