Author: linga51

GPIO library - WiringPi

[Copy link]

0

threads

1

posts

22

credits

Novice

Rank: 1

credits
22
Published in 2016-3-31 06:02:59 | Show all floors
Hello there. Thank you all for you valuable and hard work!! Sutch a strong and active comunity is the only thing that adds some value to the orangepi.

As for wiringX: in the list of supported devices there is no reference to orange pi (interest in working with orange pi pc). Is it compatible even if not included in the readme?

Thanks!!

2

threads

19

posts

110

credits

Registered member

Rank: 2

credits
110
Published in 2016-3-31 17:55:21 from mobile | Show all floors
there is indeed no reference because until my version is wasnt supported. I wrote a module for orange pi and put it on github. As a source i used parts of the wiringOP code from werecatf. So if you take my version from github you are be able to do some testing with wiringX on your orange pi. Im still improving it by some little tests so not everything is allready working 100%

1

threads

15

posts

103

credits

Registered member

Rank: 2

credits
103
Published in 2016-3-31 19:36:10 | Show all floors
@WereCatf

Good day, my friend!
I'm interested using i2с.  Original WiringPi for Raspberry Pi supports PCF8574.
Proof.
I'm sure you know about it

I want to use it in your library.But he is seeking at the wrong device i2с.
  1. root@OrangePI:/dev# gpio i2cd
  2. gpio: The I2C kernel module(s) are not loaded.
  3. Error: Could not open file `/dev/i2c-2' or `/dev/i2c/2': No such file or directory
  4. root@OrangePI:/dev# ln -s /dev/i2c-0 /dev/i2c-2
  5. root@OrangePI:/dev# gpio i2cd
  6. gpio: The I2C kernel module(s) are not loaded.
  7.      0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
  8. 00:          -- -- -- -- -- -- -- -- -- -- -- -- --
  9. 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
  10. 20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
  11. 30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
  12. 40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
  13. 50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
  14. 60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
  15. 70: -- -- -- -- -- -- -- --
  16. root@OrangePI:/dev#
Copy code


Can you fix it?

10

threads

218

posts

2040

credits

Gold member

Rank: 6Rank: 6

credits
2040
Published in 2016-4-2 05:06:16 | Show all floors
Edited by nopnop2002 at 2016-4-2 05:10
StaLeWaR29 replied at 2016-3-31 19:36
@WereCatf

Good day, my friend!

There is a bug in gpio i2cd.
Please modify a source and re-build library once again.

/home/orangepi/WiringOP/gpio/gpio.c


[before]

  1.                 if (!moduleLoaded ("i2c-sunxi"))
  2.                 {
  3.                   fprintf (stderr, "%s: The I2C kernel module(s) are not loaded.\n", argv [0]) ;
  4.                   //return ;
  5.                 }

  6.                 sprintf (command, "%s -y %d", I2CDETECT, 2) ;
  7.                 if (system (command) < 0)
  8.                   fprintf (stderr, "%s: Unable to run i2cdetect: %s\n", argv [0], strerror (errno)) ;
Copy code

[after]

  1. #if 0
  2.                 if (!moduleLoaded ("i2c-sunxi"))
  3.                 {
  4.                   fprintf (stderr, "%s: The I2C kernel module(s) are not loaded.\n", argv [0]) ;
  5.                   //return ;
  6.                 }

  7.                 sprintf (command, "%s -y %d", I2CDETECT, 2) ;
  8. #endif
  9.                 sprintf (command, "%s -y %d", I2CDETECT, 0) ;
  10.                 if (system (command) < 0)
  11.                   fprintf (stderr, "%s: Unable to run i2cdetect: %s\n", argv [0], strerror (errno)) ;
Copy code



orangepi@OrangePI:~$ gpio i2cd
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: 20 -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --


I sent PULL-REQUEST to github.
I think that it will fix soon


0

threads

2

posts

28

credits

Novice

Rank: 1

credits
28
Published in 2016-6-13 08:16:40 | Show all floors
I was able to control a 120 volt power strip with mine. https://www.youtube.com/watch?v=Zh7QMcEfT_Q   

10

threads

218

posts

2040

credits

Gold member

Rank: 6Rank: 6

credits
2040
Published in 2016-6-15 23:52:20 | Show all floors
Edited by nopnop2002 at 2016-6-16 00:00
trpaslikcz replied at 2016-6-15 17:53
Hey , this works for me perfectly through the terminal . But on a Web server that does not work . I ...

I use almost no php, so it may not be a right response.
It may be a problem of path.

So try this

<?php shell_exec("Full_Path_of_python Full_Path_of_GPIO/examples/on.py"); ?>

or

<?php
$fullPath = 'Full_Path_of_python Full_Path_of_GPIO/examples/on.py';
exec($fullPath, $outpara);
?>

3

threads

62

posts

950

credits

Senior member

Rank: 4

credits
950
Published in 2016-7-23 19:36:38 | Show all floors
Hello.
I'm having trouble using SPI. All other interfaces are working, but in SPI it isn't outpuing any data.

Is there any nuance for it?
I'using the following library https://github.com/zhaolei/WiringOP
Thank you.

3

threads

62

posts

950

credits

Senior member

Rank: 4

credits
950
Published in 2016-7-23 20:58:40 | Show all floors
Ok, I fix it. Channel number should be 0 in my case.

5

threads

12

posts

214

credits

Intermediate member

Rank: 3Rank: 3

credits
214
Published in 2017-2-14 21:37:01 | Show all floors
Hello,

This is compatible with orange pi zero (13*2 pinout) ?

0

threads

2

posts

20

credits

Novice

Rank: 1

credits
20
Published in 2017-2-28 01:57:41 | Show all floors
Please give me a code to blinking led in orange pi lite.
I have installed wiringOPi library.
You need to log in before you can reply login | Register

Points Rule

Quick reply Top Return list