WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Getting wiringpi2 to work in PiCore  (Read 3662 times)

Offline Terry_J_C

  • Newbie
  • *
  • Posts: 22
Getting wiringpi2 to work in PiCore
« on: February 13, 2016, 11:53:53 AM »
Hi,

I have read the discussion about wiringpi in http://forum.tinycorelinux.net/index.php/topic,17223.msg103333.html#msg103333 and from this I conclude that there is probably no work going on at present to update the wiringpi extension to the latest version.

AFAIK, wiringpi2 is the only library available that provides access to the Broadcom pin that can do hardware PWM (GPIO pin 18).  I've successfully used wiringpi2, running under Raspbian, to create PWM in hardware, to dim and brighten LEDs, which seems to be flicker-free (see http://raspi.tv/2013/how-to-use-wiringpi2-for-python-with-pull-ups-or-pull-downs-and-pwm ).  However, it appears from the thread quoted above that the PiCore extension for wiringpi is still the original and doesn't actually work with modern Pi hardware.  I then looked into building wiringpi2 from source (see https://projects.drogon.net/raspberry-pi/wiringpi/download-and-install/  (Plan B)), but got a number of compilation errors.

I have queried the compilation errors with my local LUG, but I was wondering if it is possible to create an extension based on wiringpi2 some other way?

I have also attached a dump of the shell activity that lists the errors, in case someone here can help.  I have installed 'make' and all the 'gcc' extensions.
Terry

Offline Paul_123

  • Administrator
  • Hero Member
  • *****
  • Posts: 1260
Re: Getting wiringpi2 to work in PiCore
« Reply #1 on: February 13, 2016, 12:09:31 PM »
It works just fine, I recently built it, I forgot there was an official extension to test.   I'm sure that Bmarkus will rebuild for you.

anyway, you need more extensions that just make and gcc.

tce-load -iw compile-essentials.tcz

should get everything you need

Offline Terry_J_C

  • Newbie
  • *
  • Posts: 22
Re: Getting wiringpi2 to work in PiCore
« Reply #2 on: February 13, 2016, 12:29:52 PM »
It works just fine, I recently built it, I forgot there was an official extension to test.   I'm sure that Bmarkus will rebuild for you.

anyway, you need more extensions that just make and gcc.

tce-load -iw compile-essentials.tcz

should get everything you need

Hmmm.  That improved things.  (See attached.)

Are there any other extensions needed to build this?
Terry

Offline Paul_123

  • Administrator
  • Hero Member
  • *****
  • Posts: 1260
Re: Getting wiringpi2 to work in PiCore
« Reply #3 on: February 13, 2016, 02:02:53 PM »
looks like compile-essentials does not include binutils.tcz

you can find extensions containing the commands or files you are missing by using the "provides" function of tce


Offline Terry_J_C

  • Newbie
  • *
  • Posts: 22
Re: Getting wiringpi2 to work in PiCore
« Reply #4 on: February 13, 2016, 02:53:12 PM »
looks like compile-essentials does not include binutils.tcz
Many thanks.  I have now completed an error-free compilation.

The only problem is that I cannot find where the script put the output (I'm still looking).   :-\
I have to do something else now, so I'll have to pick this up tomorrow.

Thanks again for all your help.
Terry

Offline gavinmc42

  • Sr. Member
  • ****
  • Posts: 301
Re: Getting wiringpi2 to work in PiCore
« Reply #5 on: February 14, 2016, 07:32:53 PM »
Terry,

You might want to have a look at this.
http://abyz.co.uk/rpi/pigpio/

I have had the binary working fine with piCore.
The shell interface is useful for quick tests.
http://forum.tinycorelinux.net/index.php/topic,19111.msg117491.html#msg117491

It should be ok if you just want to do leds?

Luajit may also be able to do PWM on 18?
Let me know if you get it working.

Can do interesting things with gpio 18
http://www.rtl-sdr.com/transmitting-fm-am-ssb-sstv-and-fsq-with-just-a-raspberry-pi/

Gavin


Offline Terry_J_C

  • Newbie
  • *
  • Posts: 22
Re: Getting wiringpi2 to work in PiCore
« Reply #6 on: February 15, 2016, 08:19:37 AM »
You might want to have a look at this.
http://abyz.co.uk/rpi/pigpio/
Thanks for the heads-up on this and the other items that you flagged.  I note however that the PWM function provided doesn't appear to support the hardware PWM channel (GPIO 18).

I got soft PWM working using RPi.GPIO, but it suffered from flickering when running under Python, (even on the RPi 2).  Using wiringpi2 resolved that (it really does work well), so I don't want to embark on another approach using soft PWM unless I have to.

Currently, the only problem that I have left is getting the Python wrapper (wiringpi2) for the latest version of wiringpi (V2.31) accessible in piCore and I'll be able to run the code that I have already successfully tested on my RPi 2.
Terry