xpertsavenue / wiringop-zero Goto Github PK
View Code? Open in Web Editor NEWWiringPi / WiringOP libary for the Orange Pi Zero with 26 pin GPIO header
License: GNU Lesser General Public License v3.0
WiringPi / WiringOP libary for the Orange Pi Zero with 26 pin GPIO header
License: GNU Lesser General Public License v3.0
On Armbian Buster, the /bin/sh interpreter does not understand [[ ... ]]
(line 4 of build script). An error message is printed. If you change the first line to #!/bin/bash
it works perfectly.
I have a problem to compile the source under the following conditions:
Hardware: Orange Pi Zero
OS: Raspian GNU/Linux 8
uname -a
Linux OrangePI 3.4.39 #2 SMP PREEMPT Mon Nov 21 16:23:11 CST 2016 armv7l GNU/Linux
I have installed the packages "gcc" and "make" before this task.
The following output have bin received:
`orangepi@OrangePI:~~/WiringOP-Zero$ sudo ./build
./build: 4: ./build: [[: not found
wiringPi Build script
WiringPi Library
[UnInstall]
[Compile] wiringPi.c
[Compile] wiringSerial.c
[Compile] wiringShift.c
[Compile] piHiPri.c
[Compile] piThread.c
[Compile] wiringPiSPI.c
[Compile] wiringPiI2C.c
[Compile] softPwm.c
[Compile] softTone.c
[Compile] softServo.c
[Compile] mcp23008.c
[Compile] mcp23016.c
[Compile] mcp23017.c
[Compile] mcp23s08.c
[Compile] mcp23s17.c
[Compile] sr595.c
[Compile] pcf8574.c
[Compile] pcf8591.c
[Compile] mcp3002.c
[Compile] mcp3004.c
[Compile] mcp4802.c
[Compile] mcp3422.c
[Compile] max31855.c
[Compile] max5322.c
[Compile] sn3218.c
[Compile] drcSerial.c
[Link (Dynamic)]
[Install Headers]
[Install Dynamic Lib]
WiringPi Devices Library
[UnInstall]
[Compile] ds1302.c
[Compile] maxdetect.c
[Compile] piNes.c
[Compile] gertboard.c
[Compile] piFace.c
[Compile] lcd128x64.c
[Compile] lcd.c
[Compile] piGlow.c
[Compile] hx711.c
hx711.c: In function ‘hx711Read’:
hx711.c:75:2: error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode
for (uint8_t i = 24; i--;)
^
hx711.c:75:2: note: use option -std=c99, -std=gnu99, -std=c11 or -std=gnu11 to compile your code
hx711.c:86:11: error: conflicting types for ‘i’
for (int i = 0; i < sGainBits[instId]; i++)
^
hx711.c:75:15: note: previous definition of ‘i’ was here
for (uint8_t i = 24; i--;)
^
hx711.c:86:2: error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode
for (int i = 0; i < sGainBits[instId]; i++)
^
hx711.c: In function ‘hx711ReadAverage’:
hx711.c:103:2: error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode
for (uint8_t i = 0; i < times; i++)
^
Makefile:67: recipe for target 'hx711.o' failed
make: *** [hx711.o] Error 1
Make Failed...
Please check the messages and fix any problems. If you're still stuck,
then please email all the output and as many details as you can to
[email protected]
`
Can you help me to resolve this.
HI All,
I can only find an Arabian Bionic Minimal image. What other requirements are needed to make WiringOP-Zero to work?
I get a host of errors when I try and run the ./build
I have worked out the cc: compiler is required and installed that.
So it made WiringOP-Zero, but with a whole lot of cautions.
I did a gpio readall and it shows all the pins, but nothing is working.
WiringPi Library
[UnInstall]
make: Nothing to be done for 'all'.
[Install Headers]
[Install Dynamic Lib]
WiringPi Devices Library
[UnInstall]
make: Nothing to be done for 'all'.
[Install Headers]
[Install Dynamic Lib]
GPIO Utility
make: Nothing to be done for 'all'.
[Install]
All Done.
NOTE: To compile programs with wiringBP v2, you need to add:
-lwiringPi
to your compile line(s) To use the Gertboard, MaxDetect, etc.
code (the devLib), you need to also add:
-lwiringPiDev
to your compile line(s).
All help would be appreciated.
Regards
PMAR146
Good day
Im trying to install your library in my opi zero 2 plus H5 , without succes , it works in my opi zero , can you help me ?
wiringPi.o: error adding symbols: File in wrong format
collect2: error: ld returned 1 exit status
Makefile:73: recipe for target 'libwiringPi.so.2.0' failed
make: *** [libwiringPi.so.2.0] Error 1
Thank you
There is pinout of OPI zero 2 plus.
https://forum.armbian.com/index.php?/topic/5072-i-finally-mapped-the-gpio-on-the-opz2-h3/
Is it possible to fit this board using compile option?
he orange pi zero is an optimal octoprint server - includes wifi and is very fast, small and cheap.
when using octopring and this enclose-plugin (which uses wirining pi and is designed for raspberry pi) then the following error occurs:
2017-10-08 07:56:46,675 - octoprint.plugins.enclosure - WARNING - An exception of type RuntimeError occurred on updateOutputUI. Arguments:
('Please set pin numbering mode using GPIO.setmode(GPIO.BOARD) or GPIO.setmode(GPIO.BCM)',)
here you find more the plugin: https://github.com/vitormhenrique/OctoPrint-Enclosure
the ower of this plugin is also willing to help, but he lacks of a orange pi zero. maybe in cooperation with your orange pi knowledge, you both could solve this issue easily and a lot of users will be satisfied.
maybe you could look into it ... I guess there is a slight incompatibility with the original wiring pi for raspberry.
thx!
I need a static library. Unfortunately the make seems to have failed. Any Ideas?
cd WiringOP-Zero
sudo make static
make -C wiringPi static
make[1]: Entering directory '/root/WiringOP-Zero/wiringPi'
make[1]: Nothing to be done for 'static'.
make[1]: Leaving directory '/root/WiringOP-Zero/wiringPi'
make -C devLib static
make[1]: Entering directory '/root/WiringOP-Zero/devLib'
make[1]: Nothing to be done for 'static'.
make[1]: Leaving directory '/root/WiringOP-Zero/devLib'
make -C gpio static
make[1]: Entering directory '/root/WiringOP-Zero/gpio'
make[1]: *** No rule to make target 'static'. Stop.
make[1]: Leaving directory '/root/WiringOP-Zero/gpio'
Makefile:9: recipe for target 'static' failed
make: *** [static] Error 2
WiringOP-Zero/wiringPi/mcp3422.c
Line 81 in 8830c86
value = ((buffer [0] & 0x0F) << 8) | buffer [1] ; /* use the correct bytes please */
root@orangepizero:/home/orangepi#
git clone https://github.com/xpertsavenue/WiringOP-Zero.gitWiringPi Library
[UnInstall]
[Compile] piHiPri.c
[Compile] piThread.c
[Compile] mcp23008.c
[Compile] mcp23016.c
[Compile] mcp23017.c
[Compile] mcp23s08.c
[Compile] mcp23s17.c
[Compile] pcf8574.c
[Compile] pcf8591.c
[Compile] mcp3002.c
[Compile] mcp3004.c
[Compile] mcp4802.c
[Compile] mcp3422.c
[Compile] max31855.c
[Compile] max5322.c
[Compile] sn3218.c
[Compile] drcSerial.c
[Link (Dynamic)]
[Install Headers]
[Install Dynamic Lib]
WiringPi Devices Library
[UnInstall]
[Compile] hx711.c
hx711.c: In function ‘hx711Read’:
hx711.c:75:2: error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode
for (uint8_t i = 24; i--;)
^
hx711.c:75:2: note: use option -std=c99, -std=gnu99, -std=c11 or -std=gnu11 to c ompile your code
hx711.c:86:11: error: conflicting types for ‘i’
for (int i = 0; i < sGainBits[instId]; i++)
^
hx711.c:75:15: note: previous definition of ‘i’ was here
for (uint8_t i = 24; i--;)
^
hx711.c:86:2: error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode
for (int i = 0; i < sGainBits[instId]; i++)
^
hx711.c: In function ‘hx711ReadAverage’:
hx711.c:103:2: error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode
for (uint8_t i = 0; i < times; i++)
^
Makefile:67: recipe for target 'hx711.o' failed
make: *** [hx711.o] Error 1
Make Failed...``
from clean install!! what i have to do? {i run Armbian_5.35_Orangepizero_Debian_jessie_default_3.4.113}
The pin mapping is incompatible to all other Orange Pi H3 boards and Banana Pi/Pro and Raspberry Pi.
https://github.com/zhaolei/WiringOP BCM Number is compatible to Raspberry Pi (and Banana Pi).
Hi,
I've been trying on a project. To do so, I needed this library and my orange pi zero's SPI1 pins. Unfortunately I haven't been succeeded. I thought that something was wrong about opi but afterwards I wired my SCLK pin to oscilloscope and watch the signals.
The problem is not about OPi zero, must be about this library. Dont know what yet, but hope gonna find out. Anyone can help me or got any idea how to fix this?
Hello.
I want to make a program with C++. How can I make this?
Hi, I'm trying to build on my OPIZ
here is the PI:
Welcome to ARMBIAN 5.38 stable Debian GNU/Linux 9 (stretch) 4.14.18-sunxi
System load: 0.41 0.25 0.10 Up time: 1 min
Memory usage: 9 % of 493MB IP: 192.168.1.18
CPU temp: 35°C
Usage of /: 8% of 15G
here is the log
GPIO Utility
[Link]
/usr/bin/ld: gpio.o: relocation R_ARM_THM_MOVW_ABS_NC against `a local symbol' can not be used when making a shared object; recompile with -fPIC
gpio.o: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
Makefile:48: recipe for target 'gpio' failed
make: *** [gpio] Error 1
I tried to add -fPIC flag in gpio/Makefile with no success
@$(CC) -o $@ $(OBJ) $(LDFLAGS) -fPIC $(LIBS)
Hi, @xpertsavenue. I have been implementing the interruption example for a few days (for RFID readers - Wiegand). However, when we have the interrupt function call on the configured port it goes into "eternal loop" no longer leaves the function. I made a simpler example, a counter for the interrupt, and the problem persists. Where should I be wrong? It's an OrangePi Zero H2 +.
Thank you.
Okay, at this point I can say that I've tried pretty much everything. I've searched all over on the internet and I can't get the spi1 to work through the WiringOP libs on my OrangePi Zero!
Is there anyone out there who was able make the magic? Can you helpe me?
ps.: In the armbian version I am using, the spidev1.0 already exists, so I think the problem is not activating it.
Thanks in advance!
Greetings.
Rafael
For any poor sods trying to use pinModeAlt
and finding it to be broken, this is because the developer simply couldn't be arsed to make it work, and instead opted for the "brute force" approach of making the function a complete no-op when running on a Banana or Orange Pi.
This, of course, leaves all the poor saps (like me) who bought an Orange instead of a Raspberry without any method whatsoever to set the pins back to (e.g) ALT5 after setting them to IN or OUT. An endeavour which caused me much frustration, and cost me the best part of two days to solve.
Incidentally, the solution required the addition of ONE line of code. Why didn't the dev just do that? Your guess is as good as mine.
You can find a working version here in my fork. You're welcome.
Running on Orange Pi 3.0.0 Bullseye with Linux 5.16.17-sun50iw9
> sudo ./build
wiringPi Build script
=====================
WiringPi Library
[UnInstall]
make: Nothing to be done for 'all'.
[Install Headers]
[Install Dynamic Lib]
WiringPi Devices Library
[UnInstall]
[Compile] onewire.c
onewire.c:131:10: error: conflicting types for ‘OneWireReadRoom’
131 | uint64_t OneWireReadRoom(uint8_t instId)
| ^~~~~~~~~~~~~~~
In file included from onewire.c:7:
onewire.h:60:35: note: previous declaration of ‘OneWireReadRoom’ was here
60 | extern unsigned long long int OneWireReadRoom(uint8_t instId);
| ^~~~~~~~~~~~~~~
onewire.c:154:5: error: conflicting types for ‘OneWireSetDevice’
154 | int OneWireSetDevice(uint8_t instId, uint64_t rom)
| ^~~~~~~~~~~~~~~~
In file included from onewire.c:7:
onewire.h:55:16: note: previous declaration of ‘OneWireSetDevice’ was here
55 | extern int OneWireSetDevice(uint8_t instId, unsigned long long int rom);
| ^~~~~~~~~~~~~~~~
onewire.c:179:5: error: conflicting types for ‘OneWireCrcCheck’
179 | int OneWireCrcCheck(uint64_t data8x8bit, uint8_t len)
| ^~~~~~~~~~~~~~~
In file included from onewire.c:7:
onewire.h:50:16: note: previous declaration of ‘OneWireCrcCheck’ was here
50 | extern int OneWireCrcCheck(unsigned long long int data8x8bit, uint8_t len);
| ^~~~~~~~~~~~~~~
onewire.c: In function ‘OneWireSkipRom’:
onewire.c:355:1: warning: control reaches end of non-void function [-Wreturn-type]
355 | }
| ^
make: *** [Makefile:69: onewire.o] Error 1
Make Failed...
Please check the messages and fix any problems. If you're still stuck,
then please email all the output and as many details as you can to
[email protected]
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.