Orange
Posts: 42
Joined: Tue Jan 24, 2012 6:41 am

WiringPi Download (not for Raspbian)

Thu Aug 22, 2019 5:21 am

I'd like to download wiringPi to build on Gentoo but git.drogon.net seems to be permanently down.
I see it's on Github but that page says it's not the official page and I should download it from git.drogon.net

Is it ok to download from the Github page or should I wait and see if Gordon's site comes back online eventually.

Thanks

fruitoftheloom
Posts: 20685
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: WiringPi Download (not for Raspbian)

Thu Aug 22, 2019 5:49 am

Orange wrote:
Thu Aug 22, 2019 5:21 am
I'd like to download wiringPi to build on Gentoo but git.drogon.net seems to be permanently down.
I see it's on Github but that page says it's not the official page and I should download it from git.drogon.net

Is it ok to download from the Github page or should I wait and see if Gordon's site comes back online eventually.

Thanks

https://www.raspberrypi.org/forums/view ... 8#p1517208
Retired disgracefully.....

User avatar
DougieLawson
Posts: 36098
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: WiringPi Download (not for Raspbian)

Thu Aug 22, 2019 9:35 am

fruitoftheloom wrote:
Thu Aug 22, 2019 5:49 am
Orange wrote:
Thu Aug 22, 2019 5:21 am
I'd like to download wiringPi to build on Gentoo but git.drogon.net seems to be permanently down.
I see it's on Github but that page says it's not the official page and I should download it from git.drogon.net

Is it ok to download from the Github page or should I wait and see if Gordon's site comes back online eventually.

Thanks

https://www.raspberrypi.org/forums/view ... 8#p1517208
Gordon has gone the whole hog and has blocked http://git.drogon.net so you can't pull the official source to hack around with it.
Switch to Joan's pigpio/pigpiod from http://abyz.me.uk/rpi/pigpio/download.html
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.


User avatar
jcyr
Posts: 343
Joined: Sun Apr 23, 2017 1:31 pm
Location: Atlanta

Re: WiringPi Download (not for Raspbian)

Thu Aug 22, 2019 1:39 pm

joan wrote:
Thu Aug 22, 2019 10:33 am
There is also https://www.airspayce.com/mikem/bcm2835/
A good choice. It provides finer grain control, at least for PWM, than either WiringPi or Pigpio does.
It's um...uh...well it's kinda like...and it's got a bit of...

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

Re: WiringPi Download (not for Raspbian)

Thu Aug 22, 2019 2:00 pm

jcyr wrote:
Thu Aug 22, 2019 1:39 pm
joan wrote:
Thu Aug 22, 2019 10:33 am
There is also https://www.airspayce.com/mikem/bcm2835/
A good choice. It provides finer grain control, at least for PWM, than either WiringPi or Pigpio does.
Not really. Its hardware PWM is pretty much the same as wiringPi and pigpio and is limited to the 19.2 MHz crystal and 2 channels (pigpio uses a 500 MHz clock). It offers nothing like pigpio's hardware timed PWM on all GPIO.

User avatar
jcyr
Posts: 343
Joined: Sun Apr 23, 2017 1:31 pm
Location: Atlanta

Re: WiringPi Download (not for Raspbian)

Thu Aug 22, 2019 2:32 pm

joan wrote:
Thu Aug 22, 2019 2:00 pm
jcyr wrote:
Thu Aug 22, 2019 1:39 pm
joan wrote:
Thu Aug 22, 2019 10:33 am
There is also https://www.airspayce.com/mikem/bcm2835/
A good choice. It provides finer grain control, at least for PWM, than either WiringPi or Pigpio does.
Not really. Its hardware PWM is pretty much the same as wiringPi and pigpio and is limited to the 19.2 MHz crystal and 2 channels (pigpio uses a 500 MHz clock). It offers nothing like pigpio's hardware timed PWM on all GPIO.
Not what I meant with 'finer grain control'. Let's say I want to use true hardware PWM, not fake 'any pin' PWM, and set the clock divider to its max in order to have the lowest possible clock rate driving the PWM block, how would I do this with either pigpio or wiringpi? As far as I can tell, you can't!

I understand that these libs try to make things simple with abstraction, but it's not always helpful.
It's um...uh...well it's kinda like...and it's got a bit of...

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

Re: WiringPi Download (not for Raspbian)

Thu Aug 22, 2019 2:45 pm

I have not seen a single post requesting the ability to do that. What is the point?

http://abyz.me.uk/rpi/pigpio/pigs.html#HP

hippy
Posts: 5941
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: WiringPi Download (not for Raspbian)

Thu Aug 22, 2019 2:51 pm

Orange wrote:
Thu Aug 22, 2019 5:21 am
I'd like to download wiringPi to build on Gentoo but git.drogon.net seems to be permanently down.
It reports "git.drogon.net is temporarily unavailable" for me and Gordon did say "I will make a final release of wiringPi available soon – with the sources, but that’s that. No more public releases" so maybe he is reworking the site to support that. Might be worth trying later or keeping an eye on his site for any updates.

User avatar
jcyr
Posts: 343
Joined: Sun Apr 23, 2017 1:31 pm
Location: Atlanta

Re: WiringPi Download (not for Raspbian)

Thu Aug 22, 2019 3:00 pm

joan wrote:
Thu Aug 22, 2019 2:45 pm
I have not seen a single post requesting the ability to do that. What is the point?

http://abyz.me.uk/rpi/pigpio/pigs.html#HP
Well, I guess you've just seen one. I recently needed precisely that for fan speed control.

https://www.raspberrypi.org/forums/view ... 6#p1516346

P.S. I'd love to see pigpio incorporate more direct control, since I think it's already bundled with Raspbian.
Last edited by jcyr on Thu Aug 22, 2019 3:11 pm, edited 1 time in total.
It's um...uh...well it's kinda like...and it's got a bit of...

User avatar
DougieLawson
Posts: 36098
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: WiringPi Download (not for Raspbian)

Thu Aug 22, 2019 3:06 pm

I found some old versions of wiringPi on github (because folks were breaking Gordon's licensing rules - which is why he's abandoned the project) which look like they're OK but old and unsupportable. (Best was v2.44 which doesn't support RPi3B+.) If you just need the basics search on Github, sort by recently updated and pick the newest version and remember when it breaks you get to keep both pieces.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

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

Re: WiringPi Download (not for Raspbian)

Thu Aug 22, 2019 3:14 pm

DougieLawson wrote:
Thu Aug 22, 2019 3:06 pm
I found some old versions of wiringPi on github (because folks were breaking Gordon's licensing rules - which is why he's abandoned the project) which look like they're OK but old and unsupportable. (Best was v2.44 which doesn't support RPi3B+.) If you just need the basics search on Github, sort by recently updated and pick the newest version and remember when it breaks you get to keep both pieces.
I have version 2.50 of wiringPi on my laptop. There shouldn't be any problem hosting any published version.

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

Re: WiringPi Download (not for Raspbian)

Thu Aug 22, 2019 3:18 pm

wiringPi has the same interface as bcm2835 as far as hardware PWM is concerned. They both allow the setting of the clock divider, range, and data settings.

Personally I don't like that model. I have seen dozens of posts asking how to set a particular frequency.

pigpio has a much simpler model. You select a frequency and dutycycle.

User avatar
jcyr
Posts: 343
Joined: Sun Apr 23, 2017 1:31 pm
Location: Atlanta

Re: WiringPi Download (not for Raspbian)

Thu Aug 22, 2019 3:28 pm

joan wrote:
Thu Aug 22, 2019 3:18 pm
wiringPi has the same interface as bcm2835 as far as hardware PWM is concerned. They both allow the setting of the clock divider, range, and data settings.

Personally I don't like that model. I have seen dozens of posts asking how to set a particular frequency.

pigpio has a much simpler model. You select a frequency and dutycycle.
I must have missed something. What function would I call to set the frequency?
It's um...uh...well it's kinda like...and it's got a bit of...


User avatar
jcyr
Posts: 343
Joined: Sun Apr 23, 2017 1:31 pm
Location: Atlanta

Re: WiringPi Download (not for Raspbian)

Thu Aug 22, 2019 4:03 pm

According to the docs, gpioHardwarePWM doesn't support frequencies below 1 MHz. The hardware is capable of frequencies down to about 5 KHz.
It's um...uh...well it's kinda like...and it's got a bit of...

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

Re: WiringPi Download (not for Raspbian)

Thu Aug 22, 2019 4:29 pm

What docs? You can set a frequency of 1 Hz.

$ pigs hp 18 1 200000
Screenshot from 2019-08-22 17-27-43.png
Screenshot from 2019-08-22 17-27-43.png (50.14 KiB) Viewed 812 times

User avatar
jcyr
Posts: 343
Joined: Sun Apr 23, 2017 1:31 pm
Location: Atlanta

Re: WiringPi Download (not for Raspbian)

Thu Aug 22, 2019 4:56 pm

joan wrote:
Thu Aug 22, 2019 4:29 pm
What docs?
The docs you referred to: C http://abyz.me.uk/rpi/pigpio/cif.html#gpioHardwarePWM

Code: Select all

PWMfreq: 1-125M (1-187.5M for the BCM2711)
I interpret that as 1 MHz to 125MHz.
joan wrote:
Thu Aug 22, 2019 4:29 pm
You can set a frequency of 1 Hz.

$ pigs hp 18 1 200000

Screenshot from 2019-08-22 17-27-43.png
You have set the period to one second, not the PWM input frequency to one hertz. It actually looks like you're setting the input clock of the PWM to 1 MHz and a ON time to 200000 clock tics. Nevertheless, that achieves what I needed. It just isn't very clear what the docs are saying. I naturally opted to do my own calculations and set the PWM input clock divisor and range directly using the bcm2835 lib.

I'll give pigpio a shot. Thanks.
It's um...uh...well it's kinda like...and it's got a bit of...

User avatar
jcyr
Posts: 343
Joined: Sun Apr 23, 2017 1:31 pm
Location: Atlanta

Re: WiringPi Download (not for Raspbian)

Thu Aug 22, 2019 6:46 pm

joan wrote:
Thu Aug 22, 2019 4:29 pm
What docs? You can set a frequency of 1 Hz.

$ pigs hp 18 1 200000

Screenshot from 2019-08-22 17-27-43.png
Hmm... Not quite what I expected! C code:

Code: Select all

pi@raspberrypi:~/fanmon $ cat test.c
#include <stdio.h>
#include <pigpiod_if2.h>

#define PWM_GPIO 18u

int main(void)
{
    int pi = pigpio_start(NULL, NULL);
    // set freq. to 1 Hz
    set_PWM_frequency(pi, PWM_GPIO, 1);
    // display actual freq.
    printf("PWM freq. = %d Hz\n", get_PWM_frequency(pi, PWM_GPIO));
    pigpio_stop(pi);
    return 0;
}

pi@raspberrypi:~/fanmon $ gcc test.c -lpigpiod_if2 -lrt
pi@raspberrypi:~/fanmon $ ./a.out                      
PWM freq. = 10 Hz
pi@raspberrypi:~/fanmon $
It's um...uh...well it's kinda like...and it's got a bit of...

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

Re: WiringPi Download (not for Raspbian)

Thu Aug 22, 2019 7:54 pm

You need to read the documentation for the functions you use.

User avatar
jcyr
Posts: 343
Joined: Sun Apr 23, 2017 1:31 pm
Location: Atlanta

Re: WiringPi Download (not for Raspbian)

Fri Aug 23, 2019 12:16 am

joan wrote:
Thu Aug 22, 2019 7:54 pm
You need to read the documentation for the functions you use.
Ah, ok. hardware_PWM(...) instead of set_PWM_frequency(...)

Had to decipher your source code to figure that out.
It's um...uh...well it's kinda like...and it's got a bit of...

User avatar
davidcoton
Posts: 4131
Joined: Mon Sep 01, 2014 2:37 pm
Location: Cambridge, UK

Re: WiringPi Download (not for Raspbian)

Fri Aug 23, 2019 8:06 am

jcyr wrote:
Fri Aug 23, 2019 12:16 am
joan wrote:
Thu Aug 22, 2019 7:54 pm
You need to read the documentation for the functions you use.
Ah, ok. hardware_PWM(...) instead of set_PWM_frequency(...)

Had to decipher your source code to figure that out.
WHY? You quoted the documentation page, and the first heading is...
int gpioHardwarePWM(unsigned gpio, unsigned PWMfreq, unsigned PWMduty)
Did you read what you quoted??? :roll: :o :lol:
Signature retired

User avatar
jcyr
Posts: 343
Joined: Sun Apr 23, 2017 1:31 pm
Location: Atlanta

Re: WiringPi Download (not for Raspbian)

Fri Aug 23, 2019 1:40 pm

I don't want to be critical, but in hindsight there were a couple of factors contributing to my confusion. First, hardware PWM versus software PWM which are handled very differently. It never occurred to me that anyone would ever want or need anything other than hardware PWM. Odd that hardware PWM is listed as an advanced feature. Second, direct pigpio vs. proxied via the pigpiod daemon. Equivalent functions have different names.

Coming from a silicon design background, calculating clock rates and such is second nature to me. I'm more comfortable specifying things directly rather than having them calculated under the hood for me, hence my initial choice of support library. I don't doubt that the latter is better suited to the targeted audience.

Who actually reads documentation? I generally do that only once I discover my initial assumptions were false! ;)
It's um...uh...well it's kinda like...and it's got a bit of...

User avatar
davidcoton
Posts: 4131
Joined: Mon Sep 01, 2014 2:37 pm
Location: Cambridge, UK

Re: WiringPi Download (not for Raspbian)

Fri Aug 23, 2019 8:05 pm

jcyr wrote:
Fri Aug 23, 2019 1:40 pm
Who actually reads documentation? I generally do that only once I discover my initial assumptions were false! ;)
I've learnt to assume that my assumptions are false. :? :lol:
Signature retired

pfletch101
Posts: 510
Joined: Sat Feb 24, 2018 4:09 am
Location: Illinois, USA

Re: WiringPi Download (not for Raspbian)

Fri Aug 23, 2019 8:25 pm

jcyr wrote:
Fri Aug 23, 2019 1:40 pm
Who actually reads documentation? I generally do that only once I discover my initial assumptions were false! ;)
I always read through the entire documentation of a hardware device or software package once. I then generally reread the section(s) on whatever I actually plan to use. I find that enough of the complete readthrough generally sticks with me that when something apparently odd (but documented) happens and/or I need a different functionality, it 'rings a bell', and I have a better chance of figuring it out.

Also, I take a lot of trouble documenting the software I write for my clients, and it drives me crazy when I get questions which could be answered by even a cursory reading of the manual.

Return to “General discussion”