Questions tagged [wiringpi]

WiringPi is a C language library for accessing GPIO pins.

Filter by
Sorted by
Tagged with
1
vote
2answers
2k views

Using Wiringpi in crontab to control GPIO pins on RaspberryPi

I am trying to create a cronjob, which sets the GPIO pin 10 to high at a given time. I am using the crontab of the default user "pi" and have verified, that the command gpio -g write 10 1 works ...
1
vote
2answers
133 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 ...
1
vote
2answers
77 views

How to find out whether GPIO is HIGH (without RPi.GPIO module)

I was wondering if there is a way to find out that a GPIO is under voltage, say - the GPIO is set to HIGH. I need to be able to check this in a linux terminal, using a command or a script that simply ...
1
vote
1answer
978 views

Can't access GPIO pins directly from C++ with wiringPi

I'm trying to access the GPIO pins of a Raspberry Pi 3 model B directly from c++. This code works fine with wiringPiSetup() and wiringPiSetupGpio() but I want to access the GPIO registers directly ...
1
vote
1answer
713 views

Wiring Pi - Root not required?

I developed some code using wiringpi on a 4.4.21 machine (Jessie) - it worked fine and as expected, required root privilege to run (i.e. requires sudo) - it uses wiringPiSetup(). I moved the code ...
1
vote
2answers
740 views

433Mhz receiver on Raspberry Pi

So I too got my hands on one of those cheap 433Mhz transmitter/receiver components. I've followed nearly every tutorial about connecting them to a Raspberry Pi but I can't seem to figure out the ...
1
vote
2answers
277 views

How do you force wiringPI library to use local time instead of UTC time?

I am running Pi 3 along with Real-Time Clock chip ds1302 and using wiringPI library to read and set date and time to and from ds1302 chip. After I set my Pi's system date and time to local date and ...
1
vote
1answer
95 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 ...
1
vote
1answer
55 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, ...
1
vote
1answer
75 views

GPIO not fast enough for RF transmitter?

I'm trying to control a 315MHz RF socket using the RCSwitch library. I tested with an Arduino and it worked 100% of the time but when porting over to a pi zero I can only get it to correctly turn on / ...
1
vote
1answer
1k views

Reading Multiple bytes in Raspberry Pi over I2C using Wiring Pi library [closed]

0 down vote favorite I am trying to build one sensor interface using Raspberry Pi over I2C. I have installed WiringPi. I am seeing limitations of wiringPi library, that supports only 1 or 2 bytes I2C ...
1
vote
3answers
3k views

wiringPi.h: No such file or directory #include < wiringPi.h>

When I try to compile I get this error: fatal error: wiringPi.h: No such file or directory #include < wiringPi.h> ^ The code is: My includes are: #include < ...
1
vote
1answer
485 views

Parallel/simultaneous read

Is there a way to read more than 1 port pin simultaneously (like a parallel port read) using wiringpi? I can see wiringpi functions to do a single pin read (digitalRead()) - but in my application I ...
1
vote
2answers
248 views

Is pinMode necessary in wiringPi programming?

Why we need to mention the pin is for input or output via pinMode. Can I simply use digitalRead or digitalWrite without setup the pinMode in before? In other words, if I set a pin as the output, can I ...
1
vote
2answers
889 views

cannot control pwm through c program by wiringpi

I am trying to control frequency and duty cycle through c-program based on wiringPi library. Here is the code: #include <wiringPi.h> #include <stdio.h> #include <stdlib.h> #include ...
1
vote
2answers
1k views

How to read raspberry's pin using node.js?

I know how to write to a pin but I can't find an example of how to read for example 3.3v from a input pin using node.js. I use wiring-pi to write, how would you do it with an example? I'm using ...
1
vote
1answer
1k views

16 channel relay module does not respond to write 0/1 (GPIO.HIGH/LOW) commands

I have received a 16 channel relay module and I'm trying to drive it through my Raspberry Pi. I have connected a 12V power supply to the DC+/- of the board as well as the 2x +5V and 2x GND on the ...
1
vote
2answers
4k views

I Cannot Change the State of the GPIO Pins

I got a RPi 2 model B v1.1 a while ago, and I am having way too much trouble trying to change the states of the GPIO pins. I have tried RPi.GPIO with a simple Python script and WiringPi in the command ...
1
vote
2answers
368 views

Is it normal when a pin goes low it triggers a interrupt on an another one?

I have the following : Output Pin 17 (wiringPi pin number 0) to a relay module -> a LOW means the relay will let current pass. 5V pin to power the relay module Input Pin 22 (wiringPi pin number 3) ...
1
vote
1answer
414 views

Unosquare.RaspberryIO: unregister from InterruptCallback

I'm developing an application on C# using Unosquare.RaspberryIO. My question related to interrupts and callbacks. According to the documentation, it's possible to register callbacks. For example: pin....
1
vote
1answer
705 views

What does Pin Base mean in WiringPI Library?

I cant seem to find a clear answer what "pinBase" does. Does anyone have an idea what it does? Thanks! Code node = wiringPiNewNode (pinBase, 8) ; Function struct wiringPiNodeStruct *...
1
vote
1answer
380 views

How can I use Garage Door Safety Sensors with Raspberry Pi?

I am trying to use garage door safety sensors as a way of counting cars. From my understanding, if there is no object (car) between the sensors, then they output a 3.3V signal every 6 milliseconds. If ...
1
vote
1answer
177 views

Are there any know issues with wiringpi on Stretch for PWM (pin 18) control

I have Python code that has run for a long time on RPis using Jessie to control an Adafruit PiTFT. I dim the screen in that code by adjusting PWM on pin 18 - works fine. I just recently built an ...
1
vote
2answers
286 views

Updating to Raspbian 9 leading to errors using PWM (wiringPi)

A few days ago I updated my Raspberry Pi (Rev. 3) to the new Raspbian 9 (based on Debian "Stretch"). Everything went fine but when I tested some of my own tools I recognized a strange behaviour ...
1
vote
2answers
848 views

Error executing gpio from bash script file: “gpio: ”source: /usr/bin/gpio: cannot execute binary file"

Trying a simple test to light a led from a bash script file I get this error: ./led.sh: línea 2: source: /usr/bin/gpio: no se puede ejecutar el fichero binario Translated from spanish: "cannot ...
1
vote
1answer
5k views

Wiring a 3 pin toggle switch to Raspberry Pi 3

I have this small 3 pin toggle switch - just toggles left and right - it has its three pins aligned left, center and right. No datasheet for it - not sure where it came from - most likely a starter ...
1
vote
1answer
382 views

Problem using I2C with ioctl() and GPIOs with wiringPi simultaneously

I'm working on a project where I need to use GPIO to toggle pins high and low as well as gather sensor data from an I2C peripheral. I have each component working separately, GPIO using wiringPi and ...
1
vote
1answer
7k views

Python: Use SPI with WiringPi

I've been searching google and stackexchange for quite a while: I would like to access an ADC (MCP3201) via SPI, to do so, I have to use Python and would like to use WiringPi. Sadly it seems ...
1
vote
1answer
502 views

Can not use GPIO pins when Official Raspberry Pi screen is connected

I have a Raspberry Pi2 B+ model, with noobs distro installed. I had some programs using wiringPi library and an ultrasound component working (tested them using a separate monitor via HDMI). However, ...
1
vote
1answer
3k views

PWM - What does pwmSetClock() and pwmSetRange() mean?

I have looked at the WiringPi site and have found: pwmSetRange (unsigned int range) ; This sets the range register in the PWM generator. The default is 1024. pwmSetClock (int divisor) ; This sets ...
1
vote
1answer
574 views

Servo motor using wiring Pi problems

I am looking for solution for something wrong happen in my programme i have configuration for control RC motor over RasPi using Wiring Pi here is code #include<stdio.h> #include<netinet/in.h&...
1
vote
1answer
1k views

wiringpi2 digitalWrite() has no effect

Hello fellow rpi lovers :-) I've encountered a very strange problem in my rpi-based project: I'm trying to control just one pin in OUTPUT mode so I use more or less such code: import wiringpi2 ...
1
vote
1answer
1k views

Python GPIO not reading inputs

Using a very simple input script to read a button press, Python GPIO isn't reading high when the button is pressed. The wiring is correct - I have checked it using wiringpi readall. Rpi. GPIO has ...
1
vote
1answer
137 views

AdaFruit PiPlate(LCD+Keys) + PWM port + DS18B20 temp sensor

I would like to know if it is possible to use at the same time, the Adafruit LCD+Keys + the PWM port(to control a MOSFET) + one temperature sensor (DS18B20) and its oneWire protocol? I was concerned ...
1
vote
1answer
2k views

How to set a fixed Frequency and change duty cycle from 0 to 100 in Raspberry Pi hardware PWM? [duplicate]

I am trying to control a fan using Raspberry Pi. For that I tried to use the PWM pin in raspbery Pi. I am using Qt C++ to control the fan. I installed the wiring Pi and run the Wiring pi using command ...
1
vote
1answer
44 views

Logic State non-responsive

I need the raspberry Pi to respond to some buttons. I'm writing this in Pure C, using the wiringPi library. As such, I thought it prudent to use the gpio utlitily to make sure my pins were sane ...
1
vote
0answers
30 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 ...
1
vote
0answers
63 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 ...
1
vote
0answers
521 views

Access Timer Interrupts in Raspian

I want to write a C program that runs some code at a fixed interval (somewhere between 200us and 1ms, TBD). Is it possible to use the hardware timer interrupts to execute code without resorting to ...
1
vote
0answers
66 views

Adafruit Ultimate GPS with Rpi 3 “Permission Denied”

I am trying to connect an Adafruit Ultimate GPS to my Raspberry Pi 3 and read data from it using the WiringPi Serial library. I have set the serial connection up and removed the serial console through ...
1
vote
1answer
230 views

How to access to I2C software with wiringpi library-

I want to use I2C software instead hardware I2C. Because a buggy parto of the I2C related with clock stretching. I can enable in boot.txt adding this: dtoverlay=i2c-gpio,bus=3 It would create a /...
1
vote
0answers
194 views

WiringPi install using npm fails

I'm having a hard time installing the wiring-pi node package. It fails on the step "Making wiring-pi ...", spaming the terminal with build errors. If I clone and install wiring-pi manually as ...
1
vote
0answers
39 views

Raspberry-pi read data from thermometr

I am newbie at raspberry. I have raspberry Raspberry Pi Details: Type: Pi 3, Revision: 02, Memory: 1024MB, Maker: Sony * Device tree is enabled. *--> Raspberry Pi 3 Model B Rev 1.2 ...
1
vote
0answers
145 views

DRV2605 + TCA9548A I2C Multiplexer gets sporadic “Remote I/O Error”

The setup is a raspberryPi driving two AdaFruit DRV2605s through an AdaFruit TCA i2c multiplexer and it all works correctly the bulk of the time. I adapted the sample Arduino code and by and large we'...
1
vote
0answers
631 views

How to Read LDR Input with Raspberry Pi's GPIO Pins in C? [closed]

Using an LDR and the below circuit diagram, I am trying to read the amount of light that the LDR is receiving. My primary goal is to detect a change when an object passes over the LDR to trigger an ...
1
vote
0answers
163 views

WiringPi can only turn on 8 LEDs

On my RPi 3 I have a PHP website to control 10 LEDs. Each is wired to a separate GPIO pin and 220 ohm resistor. Here is the code: <html> <head> <title>LED Control</title>...
1
vote
0answers
69 views

How to determine Gpio write mode [closed]

Hello I'm creating a cgi script to turn on one led (Red) while blue is off and vice versa it's more like a quiz buzzer Here's a code #!/bin/bash ch=gpio read 16 if test $ch -eq 1 then ...
1
vote
0answers
4k views

PWM with wiringPi library and C in order to blink an LED at a given frequency

I am working with the wiringPi library with C on a Raspberry Pi 3 Model B and attempting to understand and develop a model so that I can predict the blinking behavior of an LED connected to GPIO #18, ...
1
vote
1answer
157 views

Servo turns one way except in Python

I am currently busy with a project where i need a servo to turn, i wrote a script in WiringPi (Python & .NET) that does this: //Set GPIO scheme. WiringPi.WiringPiSetupGpio(); ...
1
vote
1answer
242 views

I2C connection to MS5637 baro sensor using wiringI2CPi

I am trying to write some code to connect and drag data across I2C using the Wiring Pi library, I'm at the stage where any data would be good but this is a link to the sensor's datasheet I'm trying to ...