New answers tagged

1

Headphone-Right is connected to GPIO40. Headphone-Left is connected to; GPIO45 for Rpi-2B+ and earlier. GPIO41 for RPi-3B and newer. See https://github.com/raspberrypi/firmware/blob/master/extra/dt-blob.dts


0

Provided you can network the Pis you can use pigpio or gpiozero to control all the GPIO from a single computer. The computer can be one of the Pis or any other networked computer. Each Pi needs to have the pigpio daemon running.


4

If you're using RaspiOS 32 with the latest 5.10.11 kernel then you have /boot/overlays/spi0-1cs.dtbo and /boot/overlays/spi1-1cs.dtbo Those free up the second CS pin. There's even an option to free up the MISO pin if you're doing send-only SPI transfers. From /boot/overlays/README Name: spi0-1cs Info: Only use one CS pin for SPI0 Load: dtoverlay=spi0-...


1

If you are not using them for SPI you can use them for any of their alternative functions. So yes, just set them to INPUT mode or OUTPUT mode using the GPIO library of your choice. However the current Linux SPI driver leaves them in OUTPUT mode as it drives the select lines itself. You might have to use a different SPI driver. If you are using pigpio set ...


0

It is impossible to determine the pull state of GPIO on most Pi (except by measurement). It is possible with the BCM2711 used by Pi4 and I have written a Python3 library (based on RPi.GPIO) which does this and a program gpioread which shows this and the actual programmed function/state. See https://raspberrypi.stackexchange.com/a/117593/8697 Corrupted git ...


0

You can't query the pull state with RPi.GPIO. In fact you can only query the pulls in software in the latest Pi models based on the BCM2711. I'm not sure if any of the mainstream GPIO libraries actually provide support for doing so.


0

Try shell scripting inside shell_exec, as echo 1 > /sys/class/gpio/gpio4/value For writing.


0

On boot ALL pins are INPUT. A few (1-9 from memory) have pull-ups, others pull-down. Shortly after power is applied pins are modified by Device Tree as configured in config.txt. It is possible to change pin state at this stage.


0

The table shows the default pulls which are applied by the hardware when the Pi is powered after being powered down.


1

Hip shot. You didn't share the device name. 1 - EN : Usually a high or low to enable the device. May be loose to default on. Basically an ENABLED or DISABLED feature. (locked or unlocked). You could try the three different states it can do,which is Ground, VCC or floating. I'm sure you've figured it out by now.


0

Nothing. The Linux SPI driver does not put the slave select GPIO into SPI mode, it leaves them in OUTPUT mode and drives them directly.


2

Max input on VSYS (pin 39) is 5.5V (range 1.8V to 5.5V) VSYS is the main system input voltage, which can vary in the allowed range 1.8V to 5.5V, and is used by the on-board 2.1. Raspberry Pi Pico Pinout 8 Raspberry Pi Pico Datasheet SMPS to generate the 3.3V for the RP2040 and its GPIO. From the Pico datasheet https://datasheets.raspberrypi.org/pico/pico-...


1

Thanks to everyone's comments I've come to a solution. All comes down to not letting the wires float (as suggested by @Dougie). Connecting the wires in a breadboard does not guarantee that they be actually connected, so I soldered them, and that stabilized the address of the MCP23008 on the I2C bus.


0

Download the Desktop version of it and run the Pi OS on your computer, no need to gut it to do so. https://www.raspberrypi.org/software/raspberry-pi-desktop/


2

This answer does not address directly your question but it may solve your problem. After reading all suggested solutions it seems not to be simple task to have a save second boot option. A broken system may also affect the second boot option. If you really want to have a fail safe system I simply would provide a second Raspberry Pi. This can be full tested ...


0

These (appalling designed) modules are controlled by a PNP transistor connected to 5V. They can only be controlled by 5V - which requires an external transistor (which kind of negates the point of a module because you could just control the relay directly). See Can you use a 5V Relay Module with the Pi? Some claim they can be used with 3.3V - but the relay ...


1

As with pretty much any connector, search for "[connector name] breakout board", and you'll see tons of adapters from that connector to some sort of GPIO breakout. For example, here's an RJ-45 breakout board:


0

This behavior is, in fact, a bit unusual, since most devices would recognize 3.3V as high, even if the power supply is at 5V. But it seems this is not the case here. That's not a big problem, though. If it works at 3.3V and the relais is (as I expect) properly separating the control side from the switch side you're all set.


0

Do you have pullup resistors on the I2C lines? I'd put a 10K resistor between the SCL/SDA lines and VCC


0

If the sensor only has two terminals of its rj45 port wired in, you can probably make a custom cable. Cut the end off of an ethernet cable and wire up the appropriate leads to gpio pins. Not as slick as you wanted, but worth a shot. IDK if the signaling voltage will be compatible, but there's tons of 3.3v and 5v logic out there, I reckon it's worth a try.


0

You need a true Dual rail power supply - That is to say (+V) - 0V(GND) - (-V) The +Ve must be a positive voltage relative to GND and the -Ve must be a negative voltage relative to the GND.


0

I solved it by using in Python app (it's an example): import subprocess from gpiozero import LED led = LED(8) led.off() led.close() subprocess.run(['raspi-gpio', 'set', '8', 'ip', 'pd']) Where last line is calling system's command that sets 8 GPIO pin to input mode and pull down. I also had to add some params to /boot/config.txt: gpio=7=ip,pd gpio=8=ip,pd ...


0

Its been possible for a while to configure the boot order of the PI.. So you can tell it the order of SD, USB and Network boot. In the case of boot order you could remotely change the boot order than then reboot. In the case of network boot what the PI boots is decided by server your connecting to over the network. At which point its up to you what root ...


1

The odds of having a "bricked" system will be a product of the probability of a critical problem (P1) and the probability of the recovery mechanism not working as planned (P2). Designing a recovery mechanism lowers P2 (P2=1 if no recovery mechanism is in place), but at the same time it could increase P1 as your setup becomes more complex. As such, ...


1

Some pins are high at boot time. If you connected LEDs to each pin, you'd see which ones. gpiozero will always turn a pin low when you initialise it, so if GPIO7 was on at boot, running led = LED(7) would initially set it to low (off) until you turned it on with led.on(). But when your script ended it would clean-up - and restore it back to its initial state ...


1

I believe the methods presented in those examples are still relevant. libgpiod is the replacement for the sysfs method of directly talking to the GPIO as a Linux user. I.e. it replaces user functions to read and write individual GPIO and to be told about individual GPIO level changes. It is not a replacement for all the kernel modules which currently talk ...


0

I recently went through this problem with ubuntu 20.10 on a RPI4 and CM4 and even running GPIO -v simply SEGV's.. As long as you have the dependancies.. its simple enough to upgrade to WiringPI 2.6 which works.. #git clone git@github.com:WiringPi/WiringPi.git #cd WiringPi #./build At which point root@ys:~/git/WiringPi# gpio -v gpio version: 2.60 Copyright (...


0

After a weekend full of research I finally found the error: Somehow, the Raspberry Pi implementation doesn't exactly follow the 1-Wire specification which leads to timing issues in conjunction with OneWireHub. Thankfully, I found the solution for my problem on Github: https://github.com/orgua/OneWireHub/issues/44 Now the communication is working fine in the ...


0

This is unanswerable without more information. gpiozero usually uses RPi.GPIO as backend which directly maps pins using /sys/gpiomem and writes directly to the hardware. RPi.GPIO keeps its own internal information on pin use. gpiozero "cleans up" its pin assignments on exit, so there is no residual assignment. There are other methods of controlling ...


0

OK, I must have done something to change the settings. I did hook up an official 7" touch screen briefly and mess around trying to connect to my NAS. I re-flashed my OS and rebooted and now all of the gpio's on the 40 pin header are coming up as inputs.


1

No. The GPIO are set to default values at power-down by the hardware. Those are the values that are set when the power is restored. At power-up all GPIO are set as inputs. GPIO 0-8 have weak internal pull-ups enabled. The other GPIO have weak internal pull-downs enabled. These settings may be overridden by software during boot. If you want to defeat the ...


0

As a general rule, bidirectional GPIO pins will default to being inputs when the chip is reset or power is first applied. It would help if you included a schematic for your connections to the relays, but if you want the pins to default to a low voltage then you probably need to add pulldown resistors to those pins.


0

This doesn't answer your question directly but may be a good workaround for you. A Raspberry pi 4B can easily be made to boot from a flash drive. Once setup that way, if you leave the original SD card in, it will boot to the SD in the event that booting from the flash drive fails. I've only tested this on a 4B but some literature clams that a 3B will do it ...


0

AFAIK it is not possible "to be able to select the other root partition at boot time using a GPIO pin" BUT it is simple to change the boot partition by editing cmdline.txt.


1

The BCM2711 peripherals documentation can be found on the Foundation website. https://datasheets.raspberrypi.org/bcm2711/bcm2711-peripherals.pdf The GPIO is a superset of the earlier GPIO i.e. it is identical EXCEPT some pins have additional modes and the peripheral address differs between models. See https://www.raspberrypi.org/documentation/hardware/...


1

Typically, each Pi must have a common ground (the (-) side of the 5V supply) with the relays, sensors and whatnot it is connected to. You could connect all the Pi's to a common ground, but this is not required. Connecting this common ground to the protective earth terminal is not something you should do: if this is necessary, the connection should be made ...


0

My bad, I was drawing too much current from the pin. Apparently this led to the startup issue.


2

You want signal.pause(): import RPi.GPIO as GPIO from signal import pause GPIO.setmode(GPIO.BOARD) GPIO.setup(11, GPIO.IN, pull_up_down=GPIO.PUD_UP) GPIO.setup(13, GPIO.IN, pull_up_down=GPIO.PUD_UP) GPIO.setup(15, GPIO.IN, pull_up_down=GPIO.PUD_UP) def my_callback(channel): print("Callback on channel: ", channel) GPIO.add_event_detect(11, ...


1

This is a simple programming Question, not specific to the Pi. It appears to be the python equivalent of the ?= conditional expression There appears to be nothing unusual, although clever programming tricks like this just make code like this difficult to maintain. It would be clearer if the author used parentheses. NOTE In this particular case it is not ...


1

Try setting the default application for root to the same value as for pi: filetype=$(xdg-mime query filetype file:///home/pi/index.html) defaultapp=$(xdg-mime query default $filetype) # query as pi sudo xdg-mime default $defaultapp $filetype # set as root Alternatively, executing sudo -u pi xdg-open file:///home/pi/index.html should use the settings of ...


1

If you want to work with video on a Pi, you can get a USB VGA webcam for almost the same price as the OV7670 module, and get the video stream via v4l interface ("/dev/video") which will work faster and be easier to use. If you want to play with low-level video acquisition, get a fast microcontroller with a dedicated data port (1 pins which can be ...


1

You are correct and need to consider I = " Forward Current" and V = " Forward Voltage" in the equation.


0

Pigpio is a good library to use up to 20 KHz but at 100KHz it's accuracy seems to be dropping to about 40% (according to our recent benchmark test on a RPi 3B). Still, it is the best one we know.


0

We have recently tested the read speed for two python libraries, PIGPIO and RPi.GPIO, by simulating on the raspberry an 8-bit sipo register with an 8-bit D flip flop connected on it's parallel output. The test was performed on a Raspberry Pi 3b. Both libraries perform well for frequencies of up to 5 KHz, with accuracy above 99%. The accuracy of the Rpi.GPIO ...


0

We have recently benchmarked PIGPIO and RPi.GPIO with regards to the accuracy of reading inputs at different frequencies. The test was performed on a Raspberry Pi 3b, reading signals generated from a Lattice MachXO2-4000 FPGA Both libraries perform well for frequencies of up to 5 KHz with accuracy above 99%. The accuracy of the Rpi.GPIO library deteriorates ...


1

Note that according to the documentation for the BDR91, the A-B contacts are designed to connect to a 230 VAC appliance: Your question states that you intend to connect the relay to your RPi, and you ask for help in accomplishing that objective. You must know that there is no 230 VAC input to the RPi - other than the mains input to the Power Supply. You'll ...


2

The relay contacts are just that - a contact closure. You detect the same way you would any other push button. There are literally thousands of tutorials in dozens of different languages. NOTE the relay is shown connected to mains power. There are safety protocols that must be observed to ensure isolation from mains power. Depending on detail missing from ...


1

We have run a relevant benchmark test for both Rpi.GPIO and PIGPIO. We concluded that both libraries perform well for frequencies of up to 5 KHz with and accuracy above 99%. The accuracy of the Rpi.GPIO library deteriorates over 5 KHz and at 50 KHz it is incapable of performing this task. The PIGPIO library performs comparably better, with its accuracy being ...


Top 50 recent answers are included