Questions tagged [wiringpi]

WiringPi is a C language library for accessing GPIO pins.

Filter by
Sorted by
Tagged with
0 votes
0 answers
8 views

How to use libwiringPi.so for cross compiling using CMake?

I'm trying to use CMake to cross compile a C++ code using the Wiring Pi library but I'm having trouble with making CMake to find said the correct library. Since I'm compiling from x86 to ARM in order ...
1 vote
1 answer
70 views

Which GPIOs can I use to shutdown Pi 4?

I am using a Pi 4 with Raspian, writing a program in Python (3.9.2) to do (amongst other things) shutdown of the Pi via a physical button. Based on this link https://linuxhint.com/set-up-shutdown-...
0 votes
2 answers
65 views

Why does the ssh connection freeze when accessing gpio pins

What is the proper method to use when creating a blinking LED example using PI zero W I connected the cathode to GPIO 37 and the anode to GND next I sshed into the pi and wrote this code import ...
3 votes
1 answer
14k views

wiringpi is missing from bullseye. how do i install it?

I get the following when trying to install wiring pi on a fresh bullseye image. Anyone have any way to get it installed? $ sudo apt-get install wiringpi Reading package lists... Done Building ...
3 votes
1 answer
463 views

Wiegand wiring guidance on Pi 4 with voltage step-down

Ok so following on from my previous post here. I have decided to start with the Wiegand wiring interface. I've drawn a diagram below to illustrate how I plan to wire everything up. Would appreciate if ...
0 votes
1 answer
271 views

Using WiringPi with more than two chip selects and MCP3008

I am trying to get more than two chip selects available on the Pi. I have the devices present, but am struggling to read a MCP3008 when the CS is plugged into the additional GPIO pins. My end goal is ...
0 votes
1 answer
677 views

How fast are C & Python libraries

I ran some code to monitor Pi hysteresis which involved mirroring a GPIO input to output. I was surprised as how slow the code was, so wrote a C version. Although this was slightly better it was still ...
  • 56.8k
0 votes
1 answer
1k views

wiringPi compile issue on RPi 4B 64bit

I am trying to compile my C++ project using CMake. My Raspberry Pi OS does include /usr/include/wiringPi.h and all the required .so files in /usr/lib/. Here is the output of gpio -v command: gpio ...
  • 51
-1 votes
1 answer
262 views

Access Multiple I2C Ports on Raspberry Pi CM4

I am working on the Raspberry Pi Compute Module 4. I would like to implement the 2 I2C ports for the 2 different types of sensors. (must be accessed within a single application) I am using the I2C ...
-1 votes
1 answer
124 views

WiringPi INPUT causes voltage below nominal 3.3v on pin with pull-up

Libs: wiringPi Hardware: Pull-up resistor (10k) to 3.3v on GPIO 24 (=THERMO_BUTTON_PIN) floating GPIO 4 (=AUDIO_BUTTON_PIN) In short, I want to implement an auto-recognition for one of two ...
-1 votes
1 answer
246 views

How to toggle RPi GPIO without system call

I want to toggle GPIO from within my C application, and be sure that it won't call kernel functions. Is wiringPi a good solution to do that, or should I do it another way?
2 votes
1 answer
4k views

multiple UARTs on the 40-pin

i am trying to connect two devices via UART to a raspberry 4. one being a stepper driver (i dont need much throughput), one being an image sensor (the higher the baud rate is i can get, the better). ...
  • 171
0 votes
1 answer
2k views

fatal error: wiringPi.h: No such file or directory

Learning cmake for use with CLion. I have a raspberry pi project and I'm trying to bring in wiringPi library on my Ubuntu box. Here's my build results. ====================[ Build | rookery_exe | ...
  • 117
0 votes
1 answer
154 views

Raspberry Pi: How to check I2C Bus Busy Status in Multi-Master mode

I am working on the Wiring Pi I2C Example codes. In my case, I am using the 2 masters over the same I2C Bus. I am getting some errors like 0x00 + Missing ACK/NAK Even the Clock pulse is not in 50% ...
1 vote
2 answers
116 views

How to check if wiringPiSetup() was run

I am working on a C++ project using several objects that use wiringPi. When I initialize the objects each runs wiringPiSetup() in their constructor. If I test the objects individually all o them work. ...
  • 71
3 votes
1 answer
55 views

magnetic field generated by the engine alternator affects gpio value

I am working on a dashboard for a motorcycle. I created a Qt application on my raspberry pi 4 on a raspberry pi os lite. I have configured one of my GPIO as interrupt using the wiringPi library. ...
  • 337
0 votes
1 answer
339 views

WiringPi SPI without Chip Select/Enable?

I am wondering how the WiringPi SPI works without using the chip select/enable spi.cs_change = true; in the following code. int wiringPiSPIDataRW (int channel, unsigned char *data, int len) { struct ...
  • 1
0 votes
1 answer
536 views

How to read SPI memory with raspberry pi? (using wiringpi)

This is the pinout I have for the flash memory W25Q128FV which I'm trying to interact with I'm trying to control it with a raspberry pi 3 B+. Here's how I wired everything: CS - GND D0 - SPIMISO WP - ...
  • 33
0 votes
0 answers
217 views

How to use 4 CS for SPI in C++

I'm currently trying to implement 4 CS in RaspPi. I'm still a newby in this field and used the library wiringPi. For CS0 and CS1 this works totally fine. However now I have 2 more CS on the GPIO Pin ...
-1 votes
1 answer
852 views

Raspberry Pi Software Driven servo control with PWM using C and Wiring Pi LIbrary

I'm trying to get my raspi zero to move an SG90 PWM driven servo. I have achieved this with python already using the gpiozero library, so I know my hardware works but I am trying to do it with C using ...
  • 119
1 vote
4 answers
3k views

GPIO pins not changing state

I have Raspberry pi 4B, and I want to interact with the GPIO pins. I connected simple LED wiring to physical pin's 37(GPIO25) and 39(GND). After exported pin, and set up mode to "out", I ...
  • 21
2 votes
2 answers
3k views

GPIO not working on Raspberry PI 4 4GB

I have a RPi 4 running Raspbian with the Ubuntu Mate desktop environment, whenever I try to use the Wiring Pi library through a C script, to doesn't work at all. On using the gpio readall command I ...
1 vote
0 answers
60 views

Rotary encoder working on Pi 3 but not on Pi 4

I'm trying to read an encoder switch using wiringPi (latest, 2.52). Whenever there is an edge on either of the encoding pins a or b, I store a snapshot of the state of both pins on two bits: int val = ...
  • 179
1 vote
2 answers
4k views

wiringPi.h not found by gcc. Works in Raspian, not Ubuntu Mate

This is my first time posting on stack exchange so I apologize if this is too much or not enough info on the problem. A few months ago I installed Ubuntu Mate 18.04 on a Raspberry Pi 3B+ and tried to ...
0 votes
1 answer
1k views

how to use MCP23S17 pin expander via SPI

I'm working on a custom sensor that is wired to a couple of MCP23S17 gpio expanders, which are in term connected to a Raspberry Pi 4 via the SPI pins i.e. SPI_MOSI, SPI_MISO, SPI_SCLK and CE0 pin. I'm ...
  • 49
3 votes
1 answer
4k views

Enabling of I2C-0 via "dtparam=i2c_vc=on" on Pi 3B+ causes "I2C-10" & "I2C-11" to appear and disables GPIO 10 GPIO 11

For reference: I am using the latest release Pi OS Lite, Aug 2020 version. I am developing an application using Pi4J. I am referring to pins via this Pinout: Pin Numbering - Raspberry Pi 3B+ I am ...
-2 votes
3 answers
201 views

says i don't have wiringpi module when runing code at startup

I have a code set up to run at boot, and it works fine when I start it via terminal, but it doesn't run at boot. I opened the terminal, and this is what I saw: Running at boot Traceback (most recent ...
user avatar
1 vote
0 answers
224 views

I2C, SPI and Python Libraries with Raspberry Pi 4b

I've been working with RPi.GPIO so far but I have had issues with PWM and edge detection, which are well known issues with RPi.GPIO, anyway, after some research I'm considering using a different ...
  • 86
0 votes
0 answers
61 views

Can't get to toggle leds with WiringPi library in C

So I got my python code to run that basically just toggles the LED, but now I tried enabling the GPIO via WiringPi library in C but it doesn't work. Considering python code runs, there isn't really ...
  • 3
0 votes
3 answers
346 views

libpgiod vs wiringPI code/configuration

I have an RPI, setup with wiringPi and some code I wrote to read a quadrature encoder. It works just fine, I can read the pins, using a wiringPiISR mechanism (the ISRs get executed on the rising as ...
  • 11
3 votes
2 answers
320 views

Output resistors and GPIO

I am planning to control a IC (CD74HCT299E). I have currently GPIO-pins directly hooked up to the IC. My Question is, does the Raspberry pi have resistors before the GPIO-pin, or do I have to or ...
1 vote
1 answer
307 views

Running pump & servo - Relay needed?

simulate this circuit – Schematic created using CircuitLab So I am working on a project that will require both a servo motor plus a small water pump. Both run on 3.7 -6v and I am going to use ...
2 votes
1 answer
922 views

How to write 16 bit data to device address using the i2c wiringpi lib

I am trying to write 16 bit data to i2c device . As there are no registers specified to write to the slave device, I am not able to use the built-in wiringPiI2CWriteReg16 Api. Can some one guide me ...
0 votes
0 answers
4k views

gcc and g++ compilers don't find wiringPiSetup() and wiringPiI2CSetup() functions

Update/solution: The sample program(s) Gordon refers to are at github/wiringPi - specifically for me lcd-adafruit.c. On my Rpi, the correct libraries are in /usr/lib and are libwiringPi.so and ...
1 vote
0 answers
26 views

How do I hold SPI high value?

I'm using wiringPi spi library to communicate two raspberries. As the spi clks aren't synchronised, I don't read the high values, since they are only a pulse. Is there a way to hold the high value ...
  • 11
1 vote
0 answers
122 views

Controlling PWM by wiringpi through python programming [closed]

Can anyone give me the program for controlling PWM by wiringpi through python programming? I have already searched on the net but could only find program through C programming.
0 votes
0 answers
173 views

Initializer element is not constant serialOpen WiringPi

I'm getting an error when trying to run some code on my raspberry pi. Here is the source code: /* SimpleReceive This sketch displays text strings received using VirtualWire Connect the Receiver data ...
  • 109
0 votes
0 answers
307 views

Can't read data from PN532 NFC reader over SPI

I'm using Pi4J library to read data from a NFC reader based on PN532, connected to my Pi via SPI. However, I don't seem to receive any data from if when I put a NFC card to my reader. I'm using SPI0 ...
  • 121
1 vote
1 answer
167 views

Crontab with WiringPi

I want to change pin state at certain time with Crontab. I tried to use this command: 7 0 * * * /usr/bin/gpio -g write 0 0 but it returns me this error: bash: 7: command not found I also tried: 7 0 * ...
1 vote
0 answers
81 views

Changing speed of a stepper motor break the rotation smoothness?

I'm using node-stepper-wiringpi with the L298N driver (12V) to control a stepper motor. If i put a speed of 30 the rotation is smooth but if i put more than 30 the stepper struggle to make the ...
  • 123
3 votes
2 answers
2k views

GPIO pullups not working?

Sorry for the very basic question. I am trying to set a built-in pullup on GPIO pins and it doesn't seem to be working. Hardware is Pi 3B and 4B (I tried on both), OS is Raspbian 10 (buster). The ...
2 votes
1 answer
4k views

WiringPi and ADS1115 C/C++ sample programs

I am trying to create c++/c program to AnalogRead using and ADS1115. I have seen that wiringPi has support for ADS1115 but i could not find any sample program to start with. Can anybody link guide me ...
  • 656
4 votes
4 answers
4k views

Setting Pull Up/Pull Down mode doesn't work (mostly)

I can't seem to set the pull-up resistor mode on the PI4 with most methods I try. I have tried: C# (the new System.Device.Gpio interface), WiringPi (using a C# abstraction), and wiringPi command line ...
  • 834
0 votes
0 answers
202 views

using Pi Zero W GPIO relay control

I am trying to control my relay with Raspberry GPIO. Using the terminal to write to gpio5 (Physical 18, BCM 24) works: gpio mode 5 out gpio write 5 1 Trying to do the same in my c++ code doesn't ...
  • 1
1 vote
2 answers
902 views

Wiring Pi Issue - #!/bin/bash vs #!/bin/sh

I am working on a project and have an application shell script. For function part, I need the GPIO access, and for that, I am using the standard wiringpi package. The issue I am getting is with the #...
0 votes
1 answer
415 views

How rpi3 as slave use i2c with wiringPi

I tried to let my rpi3 with wiringPi as slave to receive data from master and data +1 send to master . mater send 1 to slave (rpi3) My rpi3 SDA is GPIO 18 ,SLC is GPIO 19 the code on my rpi3 : #...
-1 votes
1 answer
245 views

How to use at the same time 2 hardware pwm in wiringpi

I need help to configure 2 hardware PWM channels. I am developing device, and sometimes I will need active 2 PWM channels with different frequencies (frequencies is low: 410 and 580 Hz).I'm writing ...
1 vote
1 answer
404 views

How can I require root privileges for invoking 'gpio' from WiringPi?

I removed my user from the gpio group, logged out and back in. I can still run e.g. gpio write 25 1. I see from this answer how the memory mapping and permissions changed between Jessie and Stretch, ...
  • 177
1 vote
0 answers
250 views

Interrupt issue - Wiringpi and pigpio show different values for pin

I am having an issue with raspberryio/wiringpi interrupts. A lot of extra interrupts are generated. My configuration is as follows: Physical pin 16: Set as input Pulldown resistor Interrupt ...
2 votes
2 answers
3k views

What is the correct way to use /dev/gpiomem with mmap to get access to Raspberry PI3 peripherals

I'm implementing a pascal library to deal with RPI3 peripherals. My goal is to control GPIO pins' functions, pins' logical levels, pins' pull resistors, I2C and PWM, at least. To achieve this I'm ...

1
2 3 4 5