WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: wiringpi  (Read 14971 times)

Offline phillip.toone

  • Newbie
  • *
  • Posts: 40
wiringpi
« on: May 24, 2013, 03:00:36 PM »
I would like to use the wiringpi library with piCore.  It would be nice if this library were available in the tce repository but it isn't so I decided I would learn how to install this library and package it as a tcz for other's convince.  I am a bit of a novice and thought this would be me a good oportunity to learn the piCore/persistence/tce process better.  One should be able to install wiring pi with the following:

Code: [Select]
git clone git://git.drogon.net/wiringPi
cd wiringPi
./build

But I get the following error attempting to build:

Quote
-sh: ./build: not found

So I try this:

Code: [Select]
sudo ./build
and get this error:

Quote
sudo: unable to execute ./build: No such file or directory

I've also tried this:

Code: [Select]
sudo -s
./build

And get this error:

Quote
/bin/sh: ./build: not found

I've even tried using:

Code: [Select]
sudo -i
which restarts the system but I still get the same errors as before.

A few weeks ago I was able to install wiringpi by using git as follows:

Code: [Select]
git clone git://git.drogon.net/wiringPi
cd wiringPi/wiringPi
sudo make install

When I try this now I get a compile error regarding mcp3422.c using the function 'myAnalogRead' and the variable 'b3' but it seems to compile.  I used to just copy the libwiringPi.so.1.0 file to the examples directory and compile my code from there.  This seems to no longer work and I see that the file libwiringPi.so.2.0 is used in place of the earlier version.  I realize now that I should have been installing this library as follows:

Code: [Select]
cd wiringPi/wiringPi
make
sudo make install
cd ../ gpio
make
sudo make install
cd ../examples
make blink
sudo ./blink

But I get this error:

Quote
gpio.c:39:23: fatal error: gertboard.h: no such file or directory
compilation terminated.
make: *** [gpio.o] Error 1

I would like to understand what I am doing wrong so that I can create a tcz file for others to use.  Any help will be appreciated.  Thanks.

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: wiringpi
« Reply #1 on: May 24, 2013, 11:30:35 PM »
It install here without any problem using ./build.

Did you install bash.tcz? build is a bash script.
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: wiringpi
« Reply #2 on: May 25, 2013, 04:44:50 AM »
wiringpi.tcz is added to repo
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline phillip.toone

  • Newbie
  • *
  • Posts: 40
Re: wiringpi
« Reply #3 on: May 25, 2013, 08:36:42 PM »
Did you install bash.tcz? build is a bash script.

You are right, that was the problem.  The build script work perfectly with bash.

Offline phillip.toone

  • Newbie
  • *
  • Posts: 40
Re: wiringpi
« Reply #4 on: May 25, 2013, 08:41:46 PM »
wiringpi.tcz is added to repo

Ok, I installed wiringpi.tcz with tce homing that this would make everything persistent.  But  when I try to compile something, like the blink.c example program, I get this error.

Quote
blink.c:27:22: fatal error: wiringPi.h: No such file or directory
compilation terminated.
make: *** [blink.o] Error 1

When I install wiringPi with the ./build script I don't get this error.  Am I doing something wrong?

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14546
Re: wiringpi
« Reply #5 on: May 25, 2013, 09:24:04 PM »
Is wiringpi-dev loaded?

Offline phillip.toone

  • Newbie
  • *
  • Posts: 40
Re: wiringpi
« Reply #6 on: May 25, 2013, 10:01:17 PM »
Is wiringpi-dev loaded?

No, and I actually just realized that I don't want it loaded by default.  Most of the time I will be using the compiled binary and will not need or want to be able to compile the code.  When I am doing development I can just build that functionality for that session.  I'm coming to understand the concept of Tiny Core and I think I like it.  Thanks again for all your help.