Questions tagged [raspberry-pi]

The Raspberry Pi is a small, inexpensive ARM-based PC device. PROGRAMMING QUESTIONS ONLY. Questions about using it should be asked on https://raspberrypi.stackexchange.com/

Raspberry Pi.SE

There is a Stack Exchange site dedicated to the Raspberry Pi. If your question is about using the Raspberry Pi, it should be asked there. However, general programming questions, which you happen to encounter on the Raspberry Pi are appropriate on Stack Overflow.


The Raspberry Pi is a low cost, credit card sized, ARMv6 instruction set based PC device developed by the Raspberry Pi foundation.

The Raspberry Pi currently has twelve models, Model A , Model B , Model A+, Model B+, Model 2 B, Zero, Zero W, Model 3 A+, Model 3 B, Model 3B+ and Model 4B with 1, 2, 4 or 8 GB RAM. Model A was the first model of the Pi to be released (in February 2012), at an average price of $25. Model B was a higher spec variant (first released in June 2012) at an average price of $35. Currently, among the twelve models, Model 4B 8GB has the highest spec (released in June 2019) at an average price of $75.

Only most notable specs listed

Model A consists of:

  • ARM11 CPU
  • OpenGL ES 2.0 capable GPU
  • 256 MB RAM (shared with GPU)
  • HDMI and RCA video
  • 1x USB 2.0 port
  • 3.5 mm audio jack
  • SD card slot

Model B consists of:

  • ARM11 CPU
  • OpenGL ES 2.0 capable GPU
  • 512 MB RAM (shared with GPU)
  • HDMI and RCA video
  • 2x USB 2.0 port
  • 3.5 mm audio jack
  • Ethernet port
  • SD card slot

Model A+ consists of:

  • ARM11 CPU
  • OpenGL ES 2.0 capable GPU
  • 256 MB RAM (shared with GPU)
  • HDMI and composite video via 3.5mm TRRS jack (shared with audio)
  • 1x USB 2.0 port
  • 3.5 mm audio jack
  • MicroSD card slot

Model B+ consists of:

  • ARM11 CPU
  • OpenGL ES 2.0 capable GPU
  • 512 MB RAM (shared with GPU)
  • HDMI and composite video via 3.5mm TRRS jack (shared with audio)
  • 4x USB 2.0 port
  • 3.5 mm audio jack
  • Ethernet port
  • MicroSD card slot

Model 2 B consists of:

  • 4 USB ports
  • 40 GPIO pins
  • Full HDMI port
  • Ethernet port
  • Combined 3.5mm audio jack and composite video
  • Camera interface (CSI)
  • Display interface (DSI)
  • Micro SD card slot
  • VideoCore IV 3D graphics core
  • A 900MHz quad-core ARM Cortex-A7 CPU
  • 1GB RAM

Model Zero consists of:

  • 1GHz single-core CPU
  • 512MB RAM
  • Mini HDMI and USB

Model Zero W additionally consists of:

  • 802.11b/g/n wireless LAN
  • Bluetooth 4.1 (BLE)

Model 3 A+ consists of:

  • 1.4GHz 64-bit Cortex-A53 (ARMv8) CPU
  • 512MB LPDDR2 SDRAM
  • 2.4GHz / 5GHz 802.11.b/g/n/ac wireless LAN
  • Bluetooth 4.2 (BLE)
  • 1x USB 2.0

Model 3 B consists of:

  • 1.2GHz 64-bit quad-core (ARMv8) CPU
  • 1GB RAM
  • 802.11n Wireless LAN
  • Bluetooth 4.1 (BLE)
  • 4x USB 2.0

Model 3 B+ consists of:

  • 1.4GHz 64-bit Cortex-A53 (ARMv8) CPU
  • 1GB LPDDR2 SDRAM
  • Gigabit Ethernet over USB 2.0 (maximum throughput 300 Mbps)
  • 2.4GHz / 5GHz 802.11.b/g/n/ac Wireless LAN
  • Bluetooth 4.2 (BLE)
  • 4x USB 2.0

Model 4 B consists of:

  • 1.5GHz 64-bit quad-core Cortex-A72 ARM v8 CPU
  • 1GB, 2GB, 4GB or 8GB LPDDR4-3200 SDRAM (depending on model)
  • Gigabit Ethernet
  • 2.4 / 5GHz 802.11ac Wireless LAN
  • Bluetooth 5.0 BLE
  • 2x USB 2.0, 2x USB 3.0
  • 2x micro HDMI ports (both support up to 4kp60)

The most recently released and presently leading the features and power columns is the Model 400. This model varies a bit from previous ones in that it comes packed within a keyboard containing the ports, etc. You may check out the official page and find more information.

Model 400

  • Broadcom BCM2711 quad-core Cortex-A72 (ARM v8) 64-bit SoC @ 1.8GHz
  • 4GB LPDDR4-3200
  • Dual-band (2.4GHz and 5.0GHz) IEEE 802.11b/g/n/ac wireless LAN
  • Bluetooth 5.0, BLE
  • Gigabit Ethernet
  • 2 × USB 3.0 and 1 × USB 2.0 ports
  • Horizontal 40-pin GPIO header
  • 2 × micro HDMI ports (supports up to 4Kp60)
  • H.265 (4Kp60 decode); H.264 (1080p60 decode, 1080p30 encode); OpenGL ES 3.0 graphics
  • MicroSD card slot for operating system and data storage
  • 78- or 79-key compact keyboard (depending on regional variant)
  • 5V DC via USB connector
  • Operating temperature: 0°C to +50°C ambient
  • Maximum dimensions 286 mm × 122 mm × 23 mm

The Raspberry Pi has no on-board operating system and requires an OS to be loaded onto an SD card, which it then boots from.

Common OS images (Official download page)

  • NOOBS (New Out Of Box Software - ideal for first time users)
  • Raspberry Pi OS, previously called Raspbian (Buster - suitable for beginners)
  • Ubuntu (Core or classic)
  • Soft-Float Debian
  • Pidora
  • Kali Linux - IT security and penetration testing

Related tags:

  • The tag with tag wiki, especially for assembly programming on the Raspberry Pi
  • Especially with tag wiki for programming on 64-bit systems

Further links:

Further information on the processors and their instruction set can be found in the arm and arm64 tag wikis.

17501 questions
3
votes
2 answers

Enable Docker Remote API - raspberry pi / raspbian

My starting point is: How to use docker remote api to create container?, so I edit /etc/init/docker.conf and update 2 occurrences of the DOCKER_OPTS variable to: DOCKER_OPTS='-H tcp://0.0.0.0:4243 -H unix:///var/run/docker.sock' Then, a simple…
tgogos
  • 23,218
  • 20
  • 96
  • 128
3
votes
2 answers

Can't connect to mqtt broker

I installed MQTT broker Mosquitto on my pi and are having some problems getting it to work with boxes in my network. Locally, if I putty in to the RPi running the Mosquitto MQTT broker everything is OK. I can use the client commands (mosquitto_sub,…
Jason94
  • 13,320
  • 37
  • 106
  • 184
3
votes
2 answers

bash script command "trap" doesn't work in docker container

I'm trying to gracefully shutdown a service that I run in a docker container (on a raspberry pi 3 b running raspbian lite), since just issuing 'docker stop' breaks the service (a lock file does not get cleared) My internet research has shown people…
GitProphet
  • 870
  • 1
  • 12
  • 22
3
votes
1 answer

Running program in .profile slows down GUI startx

I want to run a python program that polls the keyboard on startup/login to my raspberry pi. Previous attempts included cron jobs (failed due to lack of stdin or stdout). rc.local also failed as it has no stdin (it got stuck in a perpetual loop - now…
davidhood2
  • 1,367
  • 17
  • 47
3
votes
4 answers

Python user input inside infinite loop too slow, easily confused

I have a Python script running on a Raspberry Pi that sits waiting for user input and records the input in a SQLite database: #!/usr/bin/env python import logging import db while True: barcode = raw_input("Scan ISBN: ") if ( len(barcode) >…
Martin Joiner
  • 3,529
  • 2
  • 23
  • 49
3
votes
0 answers

showmount gives following error on MAC

I am trying to mount on macOS the files that I have shared on my raspberrypi using NFS. But when I do showmount -e rpiAddress .It gives the following error. showmount: Cannot retrieve info from host: kirtanpi: RPC failed:: RPC: Unable to send; errno…
molecule
  • 1,027
  • 1
  • 14
  • 27
3
votes
1 answer

PiCameraValueError: Incorrect buffer length for resolution 1920x1080

This is my code to detect circle/balls. I want to detect soccer ball from Pi camera. (soccer ball could be in any color.) I am having trouble with some PiCameraValueError. What is wrong with this code. I am using Raspberry Pi 2, Python2, and…
Mat_python
  • 151
  • 2
  • 2
  • 10
3
votes
2 answers

Get CPU temperature from Raspberry Pi with Windows IOT Core

Is there a way to get the CPU temperature from a Raspberry Pi with Windows 10 IoT Core, much like you can get running "vcgencmd measure_temp" in Raspbian? Unfortunately Windows Dashboard App Manager "SystemPerformance.htm" only shows CPU performance…
Manuel Hernandez
  • 581
  • 1
  • 7
  • 11
3
votes
1 answer

Profiler showing high percentage of time spent in node::ContextifyScript::New

When moving a project to run natively on a Raspberry Pi (Model B) with Node v6.6.0, I noticed significantly impacted performance (as might be expected). I tried profiling the code to see where the possible improvements might be, and found that…
aliask
  • 133
  • 1
  • 7
3
votes
1 answer

Mono executes program with wrong current directory

I have a strange problem. I have written a custom spamfilter in C# .NET 4.6 for personal use. And I put this program up to my Raspberry Pi. I have tested many times the program, and everything worked fine, but when I created a cronjob I have noticed…
Lightpower
  • 43
  • 3
3
votes
1 answer

Raspberry Pi not terminating SSH connection on reboot

This has happened to me on multiple occasions and I can't seem to pinpoint the cause of it. Whenever I try to shutdown or reboot the Raspberry Pi via an SSH connection, the system broadcasts it's halting, but doesn't close the SSH connection.…
jammehcow
  • 155
  • 1
  • 1
  • 9
3
votes
0 answers

pygame.mixer with USB soundcard causes (snd_pcm_recover) below 48000 Hz

I have created a Python program to play a song when a button is pressed. I am using a USB sound card and pygame.mixer to load songs and play them randomly when the button is pressed. The songs are 16-bit little-endian signed WAV files at 44100 Hz…
E. Schiesser
  • 367
  • 4
  • 13
3
votes
1 answer

PyGame on Raspberry Pi 2: Faster loading than pygame.image.load() possible?

I started to play around a bit with PyGame and I wrote a slideshow for showing images fullscreen on my Raspberry Pi 2. Everything is working fine, except that loading files takes (in my opinion) far too long. The images I used for testing are…
Markus Weninger
  • 11,931
  • 7
  • 64
  • 137
3
votes
0 answers

Raspberry PWM Output with Pi4J

My target is to code a GUI in Java where with which the user can output a PWM signal over one of the Hardware-PWM Pins of the Raspberry 3. Doing so, the user should be able to select the length of a whole pulse (in ms), the length of the duty cycle…
Jas On
  • 51
  • 8
3
votes
4 answers

Raspberry Pi 3 Model B setup startx or sudo startx gives: command not found

How can I get startx to work? I have my SD set -used pi filler and image raspbian jessie. However, I did download the zip Raspbian Jessie Lite (usually I have done the full desktop image, not lite) After I log in as pi I want to get to my GUI. I…
Joe Parzival
  • 557
  • 2
  • 5
  • 10
1 2 3
99
100