ben_nuttall
  • Member for 7 years, 8 months
  • Last seen this week
Why raspberry pi 4b claims that it's processor is armv7l when in official specification it's ARM v8? How to change it?
9 votes

The Raspberry Pi 3 and 4 have 64-bit CPUs. However, Raspbian is a 32-bit operating system, so that SD card images work on all Pi models. Depending on where you're looking, the Pi will report armv6 or ...

View answer
Installing libraries via pip is taking forever. Raspberry pi 3b+
Accepted answer
8 votes

Building scipy from source takes about 1hr20. Pre-compiled wheels are available from piwheels.org, so you can install it from there without building yourself. Raspbian Stretch is pre-configured to ...

View answer
Error installing RPi.GPIO in virtual environment
Accepted answer
7 votes

It looks like the latest release does not support Python 3.9 but the alpha releases do: https://www.piwheels.org/project/RPi.GPIO/ You can install the alpha version with: pip install rpi-gpio --pre

View answer
What is the rationale behind GPIO pin numbering?
7 votes

The GPIO/BCM pin numbers refer to the GPIO numbers at the SoC (chip) level. 28 of them are routed from the SoC to physical pins in the board. They're presumably just routed in a sensible way in terms ...

View answer
Why does my python script work in Thonny but not from the console?
Accepted answer
5 votes

When you run it from the console, the script reaches the end and exits. Thonny, Mu and IDLE all keep your script running even though it's reached the end. It's the #1 FAQ on the gpiozero docs: https:...

View answer
How to implement remote control GPIO Raspberry Pi?
5 votes

The pigpio library supports remote GPIO: http://abyz.me.uk/rpi/pigpio/ The GPIO Zero library also supports using pigpio as the pin driver, so you can use the GPIO Zero API with pigpio features. See ...

View answer
Pausing code execution till a button is pressed
Accepted answer
5 votes

That's one way of doing it - it will work. The better way is to use GPIO.wait_for_edge(17, GPIO.RISING) which will pause at that line until the button is pressed (on a RISING or FALLING edge). ...

View answer
Find out whether SPI is enabled or not
Accepted answer
5 votes

You can use raspi-config non-interactively to get the SPI status: sudo raspi-config nonint get_spi Which returns 0 (enabled) or 1 (disabled) Similarly, enable with: sudo raspi-config nonint do_spi ...

View answer
Testing Raspberry Pi scripts on a PC
5 votes

GPIO Zero provides a mock pin interface, meaning you can run the same code on your PC and emulate the pins. See examples of how it's used in the test suite.

View answer
Is there a Raspbian image with OpenCV 3 pre-installed?
5 votes

You can install opencv in a few minutes using piwheels: sudo apt install libatlas3-base libwebp6 libtiff5 libjasper1 libilmbase12 libopenexr22 libilmbase12 libgstreamer1.0-0 libavcodec57 ...

View answer
How can I implement event detection?
5 votes

You don't want to relaunch your program like that - every time you do, you fork the process. See fork bomb. If you construct your program so that you have a block of code you can re-run when the ...

View answer
MCP3008 and Raspberry Pi Zero
Accepted answer
5 votes

Yes, you can. There's no difference in the GPIO/SPI capabilities of any Pi models. Here's a guide which includes wiring, enabling hardware SPI and reading analog input signals with Python (though you ...

View answer
What is the raspberry key for on the PI 400?
4 votes

It's the "super key" or Windows key. As far as I'm away it's only purpose in the Raspberry Pi OS is to open the main menu (which also has a Raspberry Pi logo) which you can then navigate ...

View answer
How exactly do i make a LED Blink? I tried every possible result
4 votes

First of all, test the LED by connecting it to 3V3 and GND to make it come on without needing code. Then move from 3V3 to a GPIO pin and make sure you know which pin you're connected to. Refer to ...

View answer
Error when trying to read out temperature with gpiozero
Accepted answer
4 votes

Unfortunately the CPUTemperature class does not support reading from a remote Pi, even if you provide a remote pin factory. There's an issue to add it but it's probably not a priority: https://github....

View answer
Using GPIO from my virtualenv
Accepted answer
4 votes

Either install the libraries you need into the virtualenv using e.g. pip install gpiozero or when you create your virtualenv, enable site-packages using virtualenv --system-site-packages. Be aware ...

View answer
Turn on a Led with Raspberry Pi
Accepted answer
4 votes

The Raspberry Pi GPIO header has 40 pins. There are two 5V pins, two 3V3 pins, some ground pins, and the rest are general purpose - you can use them as input or output pins. These general pins are ...

View answer
I cannot install a very popular component, libmysqlclient-dev. What's wrong?
Accepted answer
4 votes

Debian Stretch changed libmysqlclient-dev to libmariadbclient-dev. MariaDB is a fork of MySQL that's more friendly in the open source world. It's compatible as a drop-in replacement, although you ...

View answer
How do I control GPIO-connected fan via code at a certain CPU temperature?
4 votes

gpiozero has a CPUTemperature class allowing you to easily control devices based on the Pi's running temperature. And you should just use OutputDevice to control the fan: from gpiozero import ...

View answer
opencv not working on Python3
Accepted answer
3 votes

(Updated 12 Oct 2020) There's a known issue with some old opencv wheels on piwheels. You need to preload python3 with: LD_PRELOAD=/usr/lib/arm-linux-gnueabihf/libatomic.so.1 python3 But newer ...

View answer
What are the differences in architecture of Model 2 and Model 3B+? (SD card not working in model 3B+)
3 votes

You need an OS image that came out after the release of the product, or you can upgrade the SD card in your Pi 2 and that should do the trick, provided the OS version (e.g. Stretch) came out since the ...

View answer
Any way to add more GPIOs to the AIY Voice Kit?
3 votes

You can use a break-out board like the Black HAT Hacker or Pico HAT Hacker. Alternatively, connect another Pi Zero as a USB gadget and use the GPIO expander.

View answer
Qutebrowser/QTWebengine on Raspbian
Accepted answer
3 votes

Raspbian Buster is several months from release. It's in testing phase, so you can't rely on everything working until it's released. The package you're looking at has apparently been built for arm64 ...

View answer
Failed building wheel for cffi on Model 3B+
3 votes

Wheels are pre-built for Python 3 (see piwheels.org) so I'd recommend using that: sudo pip3 install cffi Python 2 EOL is approaching too.

View answer
What command do I use as an "and" function?
3 votes

You can use the word and between conditionals, e.g: if button_a.is_pressed and button_b.is_pressed: print("both pressed") elif button_a.is_pressed: print("a pressed") elif button_b.is_pressed:...

View answer
What is the best way to wait for GPIO events
Accepted answer
2 votes

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) ...

View answer
AttributeError: module 'picamera' has no attribute 'picamera'
2 votes

Did you call your file picamera.py? If so, the file will try to import itself. Rename it, and make sure there's no picamera.py or picamera.pyc.

View answer
What is simplest Python code to call the begin_time function with the value of time equal to 5 when the launch Button is pressed?
2 votes

You can create a function that takes no parameters: def begin_time_5(): begin_time(5) begin.when_pressed = begin_time_5 This is called "currying". Alternatively, use a lambda: begin....

View answer
Can I use the Python Interpreter to list a modules' classes and methods, as well as descriptions?
2 votes

Using dir and help on the whole module or on specific classes or objects: >>> from gpiozero import * >>> dir(gpiozero) >>> help(gpiozero) >>> btn = Button(2) >&...

View answer
how can i connect 4 LCD screen, 4 cameras and 12 led lights to a raspberry pi and can they work simultaneously?
Accepted answer
2 votes

cameras: yes if USB webcams, no if CSI cameras (official rpi camera module) - you can only use 1 on a Pi, or 2 on a compute module LEDS: yes, easily (one per GPIO) LCD display: it depends on the ...

View answer