Notifications
Clear all

Raspberry Pi pin usage???

85 Posts
4 Users
8 Likes
2,709 Views
byron
(@byron)
No Title
Joined: 5 years ago
Posts: 1122
 

Posted by: @zander

@byron Can you tell this noob what the difference is between gpiozero and the Joan libraries?

gpiozero is made to be an easy interface to using the GPIO pins in python.   It can sit on top of various base libraries such as pigpio or rpi-gpio.   The gpiozero doc's refer to these as pin factories.

 


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6974
 

@byron I just noticed that it is python only.

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
Inq
 Inq
(@inq)
Member
Joined: 2 years ago
Posts: 1900
Topic starter  

Posted by: @zander

@inq You missed one KEY word: APPEAR.

I didn't miss... I chose to ignore it. 🤣  

3 lines of code = InqPortal = Complete IoT, App, Web Server w/ GUI Admin Client, WiFi Manager, Drag & Drop File Manager, OTA, Performance Metrics, Web Socket Comms, Easy App API, All running on ESP8266...
Even usable on ESP-01S - Quickest Start Guide


   
ReplyQuote
byron
(@byron)
No Title
Joined: 5 years ago
Posts: 1122
 

@zander - you post

I'll stay away from Joan (pigpio)

You dont appear to go for Joan, but seem quite happy with Bartosz Golaszewski (who done the gpiod stuff).  Lucky old Bartosz I suppose. 😀 

This post was modified 5 months ago by byron

   
ReplyQuote
Inq
 Inq
(@inq)
Member
Joined: 2 years ago
Posts: 1900
Topic starter  

Posted by: @byron

@zander - you post

I'll stay away from Joan (pigpio)

You dont appear to go for Joan, but seem quite happy with Bartosz Golaszewski (who done the gpiod stuff).  Lucky old Bartosz I suppose. 😀 

I try my best not to stereotype, but in 25 years as a professional programmer in several companies from startups to huge corporate, I've never run into an original equipment female developer.  I thought my last company had the first one and I worked with her on many projects.  She had pictures of her kids on her desk and all.  Another coworker, said no... you still haven't met one.  She fathered those kids, then had the sex change.  😳 

Interesting world we live in!  

 

3 lines of code = InqPortal = Complete IoT, App, Web Server w/ GUI Admin Client, WiFi Manager, Drag & Drop File Manager, OTA, Performance Metrics, Web Socket Comms, Easy App API, All running on ESP8266...
Even usable on ESP-01S - Quickest Start Guide


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6974
 

@inq Let me see if I can expand your knowledge. The first pic is of the download instructions for the library link you posted. Notice that after the github.com/ it says joan2937, hence the 'Joan library'

You are using the Joan library!

Also from that same link, it is a github link. These are the 'normal' places we get libraries from. It looks like 2nd pic. The main reason to use a github source is you can set it up to be automatically (I think, I don't know GIT) updated on your PC but I have not yet figured out how to include my local git repository into my build procedure. My experience, gut, instincts all tell me it can be done. This is only for those that want to stay current (often called the bleeding edge). I am fairly certain you can get notified of activity on the Joan github library, I do that for my esp32 camera stuff. Maybe the Arduino IDE library update mechanism works for the github sourced libraries? I never thought about it, this is my bad.

Also notice it has NOT been updated in 2 years. Not sure if that is important, but it is a little strange given the PI5 is quite different. The kernel git for the underlying code was updated 3 yrs ago, 3 months ago, 5 weeks ago and 2 weeks ago. That suggests to me that Joan may need to update to work with the Ver 2 libgpiod kernel code. Some testing on a Pi5 with some of her examples should tell us the story. 

Yes it is native.

What I like about the link in the UK you posted is all the sample code. I will need to look into that so I can appreciate the library.

I just took a quick peek at the DHT11/21/22/33/44 sample and it does look high level and very straightforward. Encouraging. 

Some last minute observations. The last two pics show first that the Pi4b is NOT supported, then later it does show the 4b as supported, but no Pi5! I think it is being worked on.

Screenshot 2023 12 06 at 13.04.52
Screenshot 2023 12 06 at 13.05.56
Screenshot 2023 12 06 at 13.54.09
Screenshot 2023 12 06 at 13.54.32

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
Inq reacted
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6974
 

@inq Wow, that is interesting. I hope I am wrong or you are pulling my leg, but in my experience in Canada and from people I know in the USA, EU, etc., there have been females in all roles to do with computers as far back as I can recall (about the late '60s). It was common knowledge that female system analysts (formerly called time and motion) were better simply because admin people feared losing their jobs due to computers. The female of the species was more trusted by the predominantly female admin workforce. Then we have this

When the ENIAC was nearing completion, six women were chosen from among the human computers to be trained as programmers. These were Kay McNulty, Frances Bilas, Betty Jean Jennings, Elizabeth Snyder,

Ruth Lichterman, and Marlyn Wescoff

Your experience may be different, but it is not representative in my experience. BTW, that phrase 'human computers' is correct, that is what they called the women (NO men) that worked with the early machines. This one may pique your interest

 
 
Barbara “Barby” Canright
 
In 1939, Barbara “Barby” Canright in 1939 was the first woman to be hired as a female computer at t NASA's Jet Propulsion Laboratory. Calculating everything by hand—from how many rockets were needed to make a plane airborne to figuring out how to get a 14,000 pound bomber in the air—fell squarely on Barby's shoulders.

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6974
 

@byron That was Dennis @inq that said 'stay away from joan as in post https://forum.dronebotworkshop.com/raspberry-pi/raspberry-pi-pin-usage/paged/4/#post-44339

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6974
 

@inq You said 'stay away from joan', not me. I think joan's library is different from Bartosz library. The library of joan is a 3rd party while the library of Bartosz is a kernel library. Here is link to the Bartosz library, look at the URL. https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git/ and here is Joans library https://github.com/joan2937/pigpio . That is a normal public github, whereas the Bartosz is a git/kernel public library. Not the same I think.

 

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6974
 

Just a follow up re females and computers. In the attached picture the 'computer' is the human female, NOT the machine. TBH, I don't know what they called the machine but that word BOMBE top right sounds familiar and google agrees.

Screenshot 2023 12 06 at 14.54.14

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
byron
(@byron)
No Title
Joined: 5 years ago
Posts: 1122
 

Posted by: @zander

@byron That was Dennis @inq that said 'stay away from joan as in post https://forum.dronebotworkshop.com/raspberry-pi/raspberry-pi-pin-usage/paged/4/#post-44339

Dear Ron, sorry to misquote you, it was an @inq aversion I see.   And regarding the pigpio our dear Joan says it wont run on rpi5 but has another lib that will apparently run ok.

https://abyz.me.uk/lg/download.html

But gpiod seems to be the way to go.  I see that the python gpiozero now has a 'pin factory' that uses the libgpiod library hence it works ok with all the pis.

 


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6974
 

@byron Ah, at first I thought that was the same link and it updated while I was looking at it, but it's a separate lib. Noted and tagging @inq.

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
byron
(@byron)
No Title
Joined: 5 years ago
Posts: 1122
 

Posted by: @zander

That is a normal public github, whereas the Bartosz is a git/kernel public library. Not the same I think.

Whats the difference between git and github: (quote from a google)

what's the difference? Simply put, Git is a version control system that lets you manage and keep track of your source code history. GitHub is a cloud-based hosting service that lets you manage Git repositories. If you have open-source projects that use Git, then GitHub is designed to help you better manage them.

I don't see any reason to pick a libraries author based on the use of git or github.  

and here is Barosz on github as well.  

https://github.com/brgl/libgpiod


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6974
 

@byron I didn't pick based on that. The github is 3rd party public, 3 yrs old and read-only (in other words no longer used), the git is for the linux kernel and current. The latest ver is 2.1 and was added in the last few weeks. See the git page for details, but basically 1.x was last updated 3 years ago and then as of 3 months ago  was modified to ver 2.x, I assume for Pi5.

Here is the git link https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git/  

I tried to read the tealeaves to determine why the change (see pic) and expected it to say to work on Pi5 but no luck. Besides, that would be an obvious security leak. But as you will see it is a major change.

Screenshot 2023 12 06 at 17.59.52

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
byron
(@byron)
No Title
Joined: 5 years ago
Posts: 1122
 

Posted by: @zander

I tried to read the tealeaves to determine why the change (see pic) and expected it to say to work on Pi5 but no luck.

The libgpiod update is a linux rather than a rpi specific update. (something to do with some other linux libraries getting outdated I think).  

All linux based boards will no doubt benefit from this library update if they have GPIO pins.   The update is not specifically for the rpi5 which appears to be using a different chip different chip for its GPIO connections than previous which surfaced some older rpi-gpio issues, but it appears the libgpiod library will work OK with this new chip, and probably other chips on other linux boards, including the older rpi boards like the rpi 4.  

Hence the libgpiod library is included in the raspberry pi os as its based on Debian Bookworm, but its also included in the Debian Bookwork distribution itself for whatever computer its installed on.

It appears that adding the libgpiod gpio as a python gpiozero pin factory was underway before the rpi5 came on to the scene as it appears to have been requested due to it being a preferred library for linux.

For my use I'm probably settling on the python gpiozero library as it can be easily updated to use a different 'pin factory' thus I can use the same old python code without worrying about the underlying GPIO library.  If wanting some high speed GPIO interaction then I would not use a linux based sbc anyway, but rather use a microcontroller such as the rpi pico or ESP32, and possibly send some pre-processed data to an rpi4/5 etc.


   
ReplyQuote
Page 5 / 6