Raspberry Pi
- General
- Comercial / Commercial
- Maquinari /Hardware
- Microcontrolador
- RP2040
- Capses / Cases
- Càmeres / Cameras
- Pantalles / Screens
- Àudio / Audio
- Ràdio / Radio
- Microcontrolador
- Programari / Software
- Sistema operatiu
- Admin
- Configuració
- Ciències
- ...
- SSH
- TVD
- Àudio / Audio
- Jocs
- Càmera / Camera
- Accés remot / Remote access
- Projectes / Projects
General
- Raspberry Pi (wp)
- Downloads
- Documentation
- Computers
- Getting Started
- Raspberry Pi OS
- Configuration
- ...
- Configuring Network
- ...
- ...
- Accessories
- Camera
- ...
- Microcontrollers
- Computers
- Quick start guide (2012) (pdf)
- RPi Hub (elinux)
- RaspberryPiBoard
- Buying Guide
- SD Card Setup
- RPiconfig
- /boot/config.txt
- Basic Setup
- Advanced Setup
- avahi / zeroconf
sudo apt-get install avahi-daemonsudo insserv avahi-daemon- raspberrypi.local
- avahi / zeroconf
- Beginners Guide
- Troubleshooting
- Jocs amb la Raspberry Pi 3 model B, des l'estiu 2016
- Mis apuntes de (es)
- Raspberry Pi AAB - Documentos técnicos (pdf) (es)
- Raspberry Pi: Extending the life of the SD card
- Raspberry Pi at Geek.com
- Make: Raspberry Pi
- Getting started with Raspberry Pi (O'Reilly)
- Raspberry Pi at memetic dot org
- Publicacions / Publications
- Còpia de seguretat de la targeta / SD card backup
- rpi-clone
- creació de la imatge des de la targeta cap a un fitxer
# dd bs=4M if=/dev/mmcblk0 | gzip > /tmp/raspbian_`date +%Y%m%d`.bin.gz
- bolcat de la imatge en una targeta
gzip -dc /tmp/raspbian_YYYYmmdd.bin.gz | dd bs=4M of=/dev/mmcblk0
- muntatge en un PC
- gunzip
/tmp/raspbian_YYYYmmdd.bin.gz - mount ...
- gunzip
Maquinari / Hardware
- Models
lateral posterior GPIO 1
2
3
4 - USB-C power in
- 2x micro HDMI out
- 2x USB 2.0
- 2x USB 3.0
- 1x Gb Ethernet
40-pin 5 - USB-C power in
- 2x micro HDMI out
- 1x Gb Ethernet
- 2x USB 3.0
- 2x USB 2.0
40-pin Aquesta taula continua cap a la dreta — desplaça-la o gira el mòbil.
- SoC: Broadcom
BCM2835
- ARM1176JZF-S 700 MHz (F: Vector Floating Point (VPF))
- Instruction set version:
- ARMv6
- ARM processor design version:
- ARM11
- GPU VideoCore IV
- Microcontrolador / Microcontroller
- RP2040
- Devices
- Raspberry Pi Pico
- PicoSystem (game console, from Pimoroni)
- ...
- Devices
- RP2040
- Raspberry Pi Pico
- Maquinari /
Hardware
sudo usermod -a -G dialout <username>- lsusb
ID 2e8a:0003 Raspberry Pi RP2 Boot- you can drop a uf2 file in this dir, to change the bootloader (e.g. rp2-pico-20220616-v1.19.uf2 for MicroPython)
- /run/media/.../RPI-RP2/
- INFO_UF2.TXT
UF2 Bootloader v2.0
Model: Raspberry Pi RP2
Board-ID: RPI-RP2
- INFO_UF2.TXT
ID 2e8a:0005 MicroPython Board in FS mode
- pinout
-
GP0 VBUS GP1 VSYS GND GND GP2 3V3_EN GP3 3V3(OUT) GP4 ADC_VREF GP5 GP28 / ADC2 GND GND / AGND GP6 GP27 / ADC1 GP7 GP26 / ADC0 GP8 RUN GP9 GP22 GND GND GP10 GP21 GP11 GP20 GP12 GP19 GP13 GP18 GND GND GP14 GP17 GP15 GP16 Aquesta taula continua cap a la dreta — desplaça-la o gira el mòbil.
-
- Info
- Accessoris / Accessories
- Pico/RP2040 (Welectron)
- Programari / Software
- MicroPython
- Drag-and-Drop MicroPython
- MicroPython documentation
- Get
Started with MicroPython on Raspberry Pi Pico
(book or RPi_PiPico_Digital_v10.pdf)
- Soldering the headers
- Raspberry Pi Pico Python SDK. A MicroPython environment for RP2040 microcontrollers (pdf)
- Docs
- C/C++
- Getting started with Raspberry Pi Pico. C/C++ development with Raspberry Pi Pico and other RP2040-based microcontroller boards (pdf)
pico-setup(intended for installation in a Raspberry Pi 4; it will also install VisualStudioCode, OpenOCD)pico-sdkpico-examplespico-extraspico-playgroundpicotoolpicoprobe
- MicroPython
- Eines / Tools
- picotool
- Requisits
- Mageia
sudo dnf install ...
- Mageia
- Codi
git clone https://github.com/raspberrypi/picotool.git
- Build
cd picotoolmkdir buildcd buildexport PICO_SDK_PATH=...
cmake ..make
- ...
- Requisits
- picotool
- IDE
- Thonny
Python IDE
- MicroPython
- Installation
- bash <(wget -O - https://thonny.org/installer-for-linux)
- it will install on:
~/apps/thonny/bin/thonny
- Ús / Usage
- Bottom right:
- The same interpreter which runs Thonny (default)
- Alternative Python 3 interpreter or virtual environment
- MicroPython (Raspberry Pi Pico)
- CircuitPython (generic)
- on-board LED:
- led.py
import machine
import utime
led_onboard = machine.Pin(25, machine.Pin.OUT)
while True:
led_onboard.value(1)
utime.sleep(1)
led_onboard.value(0)
utime.sleep(1)
- led.py
- Bottom right:
- Arduino IDE
- Eclipse
- ...
- Thonny
Python IDE
- ...
- Maquinari /
Hardware
- GPIO
- RPi Low-level peripherals
- GPIO Examples
- Raspberry Pi GPIO Cheat Sheet
- Quick2Wire
- github
- quick2wire-python-api
git clone git://github.com/quick2wire/quick2wire-python-api.git
- quick2wire-gpio-admin
git clone git://github.com/quick2wire/quick2wire-gpio-admin.git
- quick2wire-python-api
- github
- Pinout (usb and eth connectors are on bottom)
- pinout.xyz
pinout(sudo apt install python3-gpiozero)-
3V3
1
2
5V
GPIO2
3
4
5V
GPIO3
5
6
GND
GPIO4
7
8
GPIO14
TXD
GND
9
10
GPIO15
RXD
GPIO17
11
12
GPIO18
GPIO27
13
14
GND
GPIO22
15
16
GPIO23
GND
17
18
GPIO24
GPIO10
19
20
GND
GPIO9
21
22
GPIO25
GPIO11
23
24
GPIO8
GND
25
26
GPIO7
GPIO0
27
28
GPIO1
GPIO5
29
30
GND
GPIO6
31
32
GPIO12
GPIO13
33
34
GND
GPIO19
35
36
GPIO16
GPIO26
37
38
GPIO20
GND
39
40
GPIO21
Aquesta taula continua cap a la dreta — desplaça-la o gira el mòbil.
- pinout.xyz
- Dimensions
-
form factor amplada alçada exemples Pico 51 21 - Raspberry Pi Pico
- Raspberry Pi Pico W
Ultra-compact 65 30 - Raspberry Pi Zero 2
Compact 65 56,5 - Raspberry Pi 3 A+
Standard 85,6 56,5 - Raspberry Pi 4
Aquesta taula continua cap a la dreta — desplaça-la o gira el mòbil.
-
- Capses / Cases
- Capses d'alumini buides
- General
- Botigues
-
Pibow PiHut Raspberry Pi Cases RaspberryPi.dk Cases Tiendatec Cajas
Aquesta taula continua cap a la dreta — desplaça-la o gira el mòbil.
-
- Fabricants
-
Marca família RPi model mides plaques pantalla comandament programari Argon
One v2
One M.2
Audiophonics
RASPDAC Mini LCD w:90xd:120xh:60 - Sabre DAC
2,4" TFT LCD 240x320 SPI 8pins (fbcp-ili9341) x Volumio DeskPi DeskPi Pro
Flirc Cases
HifiBerry
KKSB cases Raspberry Pi Cases & Accessories
Lincoln Binns Raspberry Pi Enclosures
Geekworm NASPi
- SATA
- ...
Silverstone
PI02
UGEEK
- Digi Pro (digital out)
Aquesta taula continua cap a la dreta — desplaça-la o gira el mòbil.
-
- Extensions de cable
- HDMI
- USB-C
- ...
- Càmeres / Cameras
- Camera (official RPi docs)
- Programari / Software
-
marca / brand model sensor resolució focus NoIR version preu Raspberry Pi Camera module OmniVision OV5647 5 Mpix fix x
Raspberry Pi Camera module 2.1 Sony IMX219 8 Mpix manual x
Raspberry Pi High quality camera Sony IMX477R 12.3 Mpix manual -
Arducam
Sony IMX519
16 Mpix
auto
23,40€
Aquesta taula continua cap a la dreta — desplaça-la o gira el mòbil.
- Arducam
- ...
- Pantalles / Screens
- Tipus de connexió:
connector RPi models HDMI HDMI
I2C
SPI GPIO
Aquesta taula continua cap a la dreta — desplaça-la o gira el mòbil.
- HDMI
- Odys Moveon 10.2" 1024x600 DVB-T
- Raspberry
Pi Touch display
- LCD 7" 800x480
- PiTFT Adafruit
-
tech size resolution touch buttons connector preu
Adafruit reference
Adafruit RaspiPC Pimoroni BricoGeek Electrónica Embajadores Tiendatec Farnell Mini PiTFT
IPS 1.14" 240x135 - 2
17,14€ ii
PiTFT 2.2 HAT Mini Kit 2315
2.2" 320x240 - 4 2x20
PiTFT 2.4 HAT Mini Kit 2455
2.4" 320x240 resistive 5 2x20
38,56€ ii
PiTFT Mini Kit 2.8 1601
2.8" 320x240 resistive 4 2x13
43,80€ ii
42,96€ ii
PiTFT 2.8 1983
2.8" 320x240 capacitive 4 2x13
52,57€ ii
PiTFT Plus 2298
2.8" 320x240 resistive 4 2x20
43,68€ ii + 18€ PiTFT Plus 2423
2.8" 320x240 capacitive 4 2x20
49,27€ ii
61,70€ ii 44,95€ ii
PiTFT Plus 2616
3.2" 320x240 resistive 4 2x20
49,93€ ii + 18€ PiTFT Plus 3.5" 2441
3.5" 480x320 resistive
2x20
49,27€ ii 58,08€ ii
Raspberry Pi Touch display
7" 800x480
71,40€ ii
Aquesta taula continua cap a la dreta — desplaça-la o gira el mòbil.
- Tipus de connexió:
- Arduino
- ...
- Plaques / Boards
- Àudio / Audio
- Ràdio / Radio
- Android
- HDMI input (bridge HDMI -> CSI-2)
- HDMI capture
- Raspberry Pi-Módulo Hdmi a CSI-2 X630, con Chip TC358743, hasta 1080p/25Fps, para Raspberry Pi 4 /3 B + / 3B
- Auvidea
- Documentation
- B10x
Technical reference (pdf)
- raspivid -> ffmpeg
- HDMI to CSI-2 via TC358743 on kernel 4.1 (Raspberry Pi forums)
- B10x
Technical reference (pdf)
- Products
-
model
description
rev
date
target
HDMI video input
audio input
(I2S bus on 40 pin GPIO)
bridge chip
CSI lanes (1 Gbps / lane)
HDMI -> MIPI adapter
price
B100
HDMI to CSI-2 adapter (board connector)
3
Mar 2015
RPi, ...
up to 1080p60
Toshiba TC358743XBG 4
needs external Raspberry MIPI
B101
HDMI to CSI-2 adapter (15 pin FPC – 2 lanes)
4
RPi, Humming board
1080p25
x
Toshiba TC358743XBG
2
included 15 pin FPC 1mm
69,90€
B102
HDMI to CSI-2 adapter (22 pin FPC – 4 lanes)
2
Dec 2016
RPi compute module
1080p30, 1080p25, 720p30, 720p25
x
Toshiba TC358743XBG
4
included 22 pin FPC 0.5mm
79,00€
B103 (15 pin)
included 15 pin
dev kit: 149,00€ B103 (22 pin)
included 22 pin dev kit: 149,00€ Aquesta taula continua cap a la dreta — desplaça-la o gira el mòbil.
- B101 HDMI to CSI-2 Bridge (15 pin FPC)
-
- Documentation
- Joysticks
Programari / Software
- Sistema operatiu / Operating system
- Raspbian Benchmarking – armel vs armhf
- Raspbian (armhf)
- Debian (armel)
- Instal·ladors / Installers
- ...
... provider rpi-imager Raspberry Pi NOOBS
PINN
Aquesta taula continua cap a la dreta — desplaça-la o gira el mòbil.
- ...
- rpi-imager
- Instal·lació / Installation
- from package
- from source
- Dependències / Dependencies
- Mageia
sudo dnf install git gcc gcc-c++ make cmake libarchive-devel libcurl-devel openssl-devel lib64qt5base5-devel lib64qt5quickcontrols2-devel lib64qt5svg-devel lib64qt5help-devel
- Mageia
git clone --depth 1 https://github.com/raspberrypi/rpi-imager- cd rpi-imager
- mkdir -p build
- cd build
- cmake ../src
- make
- sudo make install
- Dependències / Dependencies
- ...
- Ús / Usage
rpi-imager
- Instal·lació / Installation
- NOOBS (New Out of Box Software) / PINN
(PINN is not NOOBS)
- NOOBS
For Raspberry Pi (prepare SD card from Linux)
- Create a single primary FAT partition
- List all disks and partitions:
fdisk -l
Disk /dev/mmcblk0 ...
- Work with your sd card:
fdisk /dev/mmcblk0
- Print
existing partition list:
p
- Delete
all existing partitions:
d
- Create a new
partition with default values:
n
- Change partition type
to W95 FAT32 (b):
tb
- Write
partitions:
w
- List all disks and partitions:
- Format the partition:
mkfs.vfat /dev/mmcblk0p1
- Download NOOBS:
cd /tmpwget https://downloads.raspberrypi.org/NOOBS_latest
- Eject and instert sd card
- Get the mount point:
mount | grep -i mmcblk0p1
- Move to the mount point:
cd /run/media/.../F2AC-9B34
- Unzip the downloaded NOOBS zip to it:
mv /tmp/NOOBS_latest /tmp/NOOBS_latest.zip
unzip /tmp/NOOBS_latest.zip
- Remove sd card:
cdumount /dev/mmcblk0p1
- Create a single primary FAT partition
- Setting
- Insert SD card in RPi
- ...
- Partitions
-
size
name
type
mmcblk0p1
821MB
RECOVERY
W95 FAT16
mmcblk0p5
60MB
boot
W95 FAT32
mmcblk0p6
13GB
root
ext4
mmcblk0p3
32MB
SETTINGS
ext4
Aquesta taula continua cap a la dreta — desplaça-la o gira el mòbil.
-
- NOOBS
For Raspberry Pi (prepare SD card from Linux)
- Admin tools
- Gestió de
paquets / Package management
sudo apt-get
- Update firmware:
sudo rpi-update
sudo raspi-config
- Gestió de
paquets / Package management
- Configuració / Setup
sudo raspi-configmain menu option /boot/config.txt alternative 1 System Options S1 Wireless LAN
S2 Audio
S3 Password
passwdS4 Hostname
hostnamectl set-hostname ...S5 Boot / Auto Login
- B1 Console
- B2 Console Autologin
- B3 Desktop
- B4 Desktop Autologin
S6 Network at Boot
S7 Splash Screen
S8 Power LED
2 Display Options D1 Resolution
D2 Underscan
D3 Pixel Doubling
D5 Screen Blanking
3 Interface Options P1 Camera
P2 SSH
P3 VNC
P4 SPI
P5 I2C
P6 Serial Port enable_uart=0|1
P7 1-Wire
P8 Remote GPIO
4 Performance Options P1 Overclock
P2 GPU Memory
P3 Overlay File System
P4 Fan
5 Localisation Options L1 Locale
L2 Timezone
L3 Keyboard
L4 WLAN Country
6 Advanced Options A1 Expand Filesystem
A2 GL Driver
A3 Compositor
A4 Network Interface Names
A5 Network Proxy Settings
8 Update
9 About raspi-config
Aquesta taula continua cap a la dreta — desplaça-la o gira el mòbil.
main menu
option
/boot/config.txt alternative
1 Change User Password
passwd
2 Hostname
hostnamectl set-hostname ...
3 Boot Options
B1 Desktop / CLI
start_x
B2 Wait for Network at Boot
B3 Splash Screen
4 Localisation Options
I1 Change Locale
I2 Change Timezone
I4 Change Wi-fi Country
5 Interfacing Options
P1 Camera
P2 SSH
P3 VNC
P4 SPI
P5 I2C
P6 Serial
P7 1-Wire
P8 Remote GPIO
6 Overclock
arm_freq
7 Advanced Options
A1 Expand Filesystem
A2 Overscan
disable_overscan
overscan_left
overscan_right
overscan_top
overscan_bottom
A3 Memory Split
A4 Audio
A5 Resolution
A6 GL Driver
7 Update
8 About raspi-config
Aquesta taula continua cap a la dreta — desplaça-la o gira el mòbil.
- Xarxa /
Network
- Info
- ...
/etc/debian_version
static ip address must be defined in 7 Wheezy /etc/network/interfaces 8 Jessie /etc/dhcpcd.conf 9 Stretch
10 Buster
11.4 Bullseye
Aquesta taula continua cap a la dreta — desplaça-la o gira el mòbil.
- ...
mitjançant / through ... directament /direct ethernet switch regular cable (a crossover cable is not needed any more)
- Local network between two RPis?
- Can I connect a laptop and a raspberry pi using a cross over cable?
- RPi: /etc/dhcpcd.conf
# It is possible to fall back to a static IP if DHCP fails:
# define static profile
profile static_eth0
static ip_address=10.0.0.2/24
#static routers=10.0.0.1
#static domain_name_servers=10.0.0.1
# fallback to static profile on eth0
interface eth0
fallback static_eth0
- PC
- Mageia
- Centre de Xarxes -> Ethernet ->
Configuració manual
- Adreça IP: 10.0.0.10
- Submàscara de xarxa: 255.255.255.0
- Centre de Xarxes -> Ethernet ->
Configuració manual
- Mageia
WiFi access point ad-hoc
Aquesta taula continua cap a la dreta — desplaça-la o gira el mòbil.
- ZeroConf
- FYI: Bonjour / Zeroconf on Raspbian
raspberrypi.local
- Setting
WiFi up via the command line
sudo iwlist wlan0 scan | grep ESSID- /etc/wpa_supplicant/wpa_supplicant.conf
network={
ssid="testing"
psk="testingPassword"
}
wpa_cli -i wlan0 reconfigureifconfig wlan0
- modify metric of a route
sudo ip route listsudo ip route replace default via 192.168.43.1 dev wlan0 metric 101sudo ip route del default via 192.168.43.1 dev wlan0 metric 303
- Rellotge / Clock
- Alternatives
- systemd-timesyncd
systemctl enable systemd-timesyncdsystemctl start systemd-timesyncd
- NTP
- NTP client (Raspberry Pi blog)
- systemd-timesyncd
- Alternatives
- Ciències / Sciences
- Digital signage
- Monitoratge remote / Remote monitoring
- Video codecs
- License keys
- /boot/config.txt
- decode_MPG2=0x...
- Check:
- vcgencmd codec_enabled MPG2
vcgencmd codec_enabled WVC1
- vcgencmd codec_enabled MPG2
- Vídeo vigilància / Video surveillance
- Screen resolution
- RPiconfig: Video
- SSH
- enable ssh server:
- using config tool:
sudo raspi-config- 5 Interfacing Options -> P2 SSH -> Enable
- using command line:
- ...
- using config tool:
- X11
ssh pi@raspberrypi.local- default password:
raspberry - Problemes / Problems
- No es connecta
- Pot ser un problema del tallafoc en el vostre PC
- Solució / Solution:
- permetre l'accés a Zeroconf
- WARNING:
POSSIBLE DNS SPOOFING DETECTED!
- Solució / Solution
ssh-keygen -R raspberrypi.local
- Solució / Solution
- Reset password
- Change/reset password WITHOUT monitor/keyboard
- Passos / Steps
- remove SD card from RPi
- insert SD card it on a Linux computer and
mount root partition. It will be mounted on:
/run/media/${USER}/root/
- option 1
sudo -i# create a temporary user on your local machine
useradd tmpuser# set password
echo "raspberry" | passwd --stdin tmpuser# get shados of password
tmpuser_shadow=$(awk -F: '$1 ~ /tmpuser/ {print $2}' /etc/shadow)- #
replace pi password with new password
awk -v new_shadow=${tmpuser_shadow} -F: '$1 !~ /pi/ {print} $1 ~ /pi/ {OFS=FS;$2=new_shadow; print}' /run/media/${USER}/root/etc/shadow >/run/media/${USER}/root/etc/shadow.new # copy file owner and file mod
chown --reference=/run/media/${USER}/root/etc/shadow /run/media/${USER}/root/etc/shadow.newchmod --reference=/run/media/${USER}/root/etc/shadow /run/media/${USER}/root/etc/shadow.new# switch files
mv /run/media/${USER}/root/etc/shadow /run/media/${USER}/root/etc/shadow.old
mv /run/media/${USER}/root/etc/shadow.new /run/media/${USER}/root/etc/shadow
- option 2
- ...
- No es connecta
- default password:
- enable ssh server:
- TVD
- Haupauge
- wget ...
- Requisits
- sudo apt-get install ffmpeg dvb-apps
- Tune
- scan es-Collserola > ~/.tzap/channels.conf
- tzap -r "TV3"
- ffmpeg ...
- Haupauge
- Àudio / Audio
- HifiBerry OS
- Pi MusicBox (not mantained)
- Mopidy
- Max2Play
- Jocs / Games
- Joystick
- Amazing Games You Can Play on the Raspberry Pi without Emulation
- STICKY: GAMES LIST: Games That Work On The Pi
- GameMaker Games on
Raspberry Pi
- They need to be fed (Jesse Venbrux)
- RetroPie
- Instal·lació / Installation
- Càmera /
Camera
-
os bits raspicam (legacy) TensorFlow Lite libcamera (new)
- Python support
- picamera
- Python
supported as alpha release:
- picamera2 (alpha, from RPi, high level, on top of python3-libcamera)
- python3-libcamera (libcamera, low level)
- OpenCV
- TensorFlow Lite
11 Bullseye 32 sudo raspi-configavailable - from package:
- libcamera-apps (installed by default)
- from source:
- ...
64 cannot be re-enabled not available 10 ...
Aquesta taula continua cap a la dreta — desplaça-la o gira el mòbil.
- Python support
- Raspberry Pi Camera Algorithm and Tuning Guide (pdf)
- libcamera.org
- libcamera-apps
- Compilació / Compilation
- Building libcamera-apps
- (cal?) elimineu la versió instal·lada des de paquets /
remove version installed from packages:
sudo apt remove libcamera-apps
- sense haver de recompilar libcamera / without
rebuilding libcamera
sudo apt install -y libcamera-dev libepoxy-dev libjpeg-dev libtiff5-dev- també amb Qt (p.ex. quan es visualitza remotament
sobre ssh) / also with Qt (e.g. to be used as remote
window over ssh)
sudo apt install -y qtbase5-dev libqt5core5a libqt5gui5 libqt5widgets5
- dependències de libcamera-apps
sudo apt install -y cmake libboost-program-options-dev libdrm-dev libexif-dev
- passos / steps
cd ~/src
git clone https://github.com/raspberrypi/libcamera-apps.git
cd libcamera-apps
git checkout prod
mkdir build
cd build- -D options:
dependencies -DENABLE_DRM=1
-DENABLE_X11=1X11 libepoxy-dev-DENABLE_QT=1Qt qtbase5-dev libqt5core5a libqt5gui5 libqt5widgets5-DENABLE_OPENCV=1OpenCV libopencv-dev-DENABLE_TFLITE=1TensorFlow TensorFlow Lite Aquesta taula continua cap a la dreta — desplaça-la o gira el mòbil.
- amb TensorFlow
Lite instal·lat / with installed TensorFlow Lite
- 32-bit
cmake .. -DENABLE_DRM=1 -DENABLE_X11=1 -DENABLE_QT=1 -DENABLE_OPENCV=0 -DENABLE_TFLITE=1 -DENABLE_COMPILE_FLAGS_FOR_TARGET=armv8-neon
- 64-bit
cmake .. -DENABLE_DRM=1 -DENABLE_X11=1 -DENABLE_QT=1 -DENABLE_OPENCV=0 -DENABLE_TFLITE=1
- 32-bit
- sense TensorFlow / without TensorFlow
cmake .. -DENABLE_DRM=1 -DENABLE_X11=1 -DENABLE_QT=1 -DENABLE_OPENCV=0 -DENABLE_TFLITE=0
make -j4 # use -j1 on Raspberry Pi 3 or earlier devices
sudo make install
sudo ldconfig # this is only necessary on the first build
- Problemes / Problems
- Ús / Usage
- X forwarding (using ssh -X)
libcamera-hello --qt-preview- ...
- X forwarding (using ssh -X)
- Post-processing
libcamera-hello --qt-preview --post-process-file /home/pi/src/libcamera-apps/assets/negate.json- OpenCV
- requirements
sudo apt install opencv-datasudo ln -s /usr/share/opencv4 /usr/local/share/OpenCV
- requirements
- TensorFlow Lite
- ...
- ...
compilat amb
processament libcamera-hello ...requisits addicionals / additional requirements - Negatiu --post-process-file negate.json
HDR libcamera-still -o test.jpg --ev -2 --denoise cdn_off --post-process-filehdr.json
libcamera-still -o test.jpg --post-process-file.jsondrc
OpenCV Sobel
--post-process-file sobel_cv.json
Detecció de cares
--lores-width 128 --lores-height 96 --post-process-file face_detect_cv.json
Anotacions de text
--post-process-file annotate_cv.json
TensorFlow Classificació d'objectes
--post-process-file object_classify_tf.json--lores-width 224 --lores-height 224mkdir -p ~/modelscd ~/modelswget https://storage.googleapis.com/download.tensorflow.org/models/mobilenet_v1_2018_08_02/mobilenet_v1_1.0_224_quant.tgztar xvf mobilenet_v1_1.0_224_quant.tgzwget https://storage.googleapis.com/download.tensorflow.org/models/mobilenet_v1_1.0_224_frozen.tgztar xvf mobilenet_v1_1.0_224_frozen.tgzln -s ln -s mobilenet_v1_1.0_224/labels.txt .
Estimació de posició
--post-process-file pose_estimation_tf.json --lores-width 258 --lores-height 258cd ~/modelsgit clone https://github.com/Qengineering/TensorFlow_Lite_Pose_RPi_32-bits.gitln -s TensorFlow_Lite_Pose_RPi_32-bits/posenet_mobilenet_v1_100_257x257_multi_kpt_stripped.tflite .
Detecció d'objectes
--post-process-file object_detect_tf.json --lores-width 400 --lores-height 300cd ~/modelsmkdir coco_ssd_mobilenet_v1_1.0_quant_2018_06_29cd coco_ssd_mobilenet_v1_1.0_quant_2018_06_29wget https://storage.googleapis.com/download.tensorflow.org/models/tflite/coco_ssd_mobilenet_v1_1.0_quant_2018_06_29.zipunzip coco_ssd_mobilenet_v1_1.0_quant_2018_06_29.zip
Segmentació de zones
--post-process-file segmentation_tf.json --lores-width 258 --lores-height 258 --viewfinder-width 1024 --viewfinder-height 1024cd ~/modesln -s ~/src/libcamera-apps/assets/segmentation_labels.txt .wget "" -O lite-model_deeplabv3_1_metadata_2.tflite
Aquesta taula continua cap a la dreta — desplaça-la o gira el mòbil.
- Compilació / Compilation
- picamera2
- alpha, from RPi, high level, on top of python3-libcamera
- The Picamera2 library (pdf)
- ...
- ...
-
Accés remot / Remote access
- Remote access (RPi official documentation)
| connection | render | available | from RPi | from PC |
| xarxa / network | text | console | allow ssh |
|
| graphics | single window (X11) | allow ssh |
|
|
| desktop | Xnest (old)
|
|
||
Xephyr on Rpi (new)
|
|
|||
Xephyr on your local PC (preferred one)
|
||||
| HDMI to USB-UVC adapter |
graphics | desktop |
|
Aquesta taula continua cap a la dreta — desplaça-la o gira el mòbil.
Projectes / Projects
- Instructables: Raspberry Pi projects
- OpenGL
- Domòtica / Home automation
- PrivateEyePi
- IR remote
- Mitsubishi air conditioner
- Reverse engineering the Mitsubishi AC Infrared protocol
- Ericmas001/HVAC-IR-Control
- install system-wide
sudo apt-get install python-pigpio python3-pigpiopip install git+https://github.com/Ericmas001/HVAC-IR-Control
- run examples
cd ~/src
git clone https://github.com/Ericmas001/HVAC-IR-Control.git- Problemes / Problems
fatal: unable to access 'https://github.com/Ericmas001/HVAC-IR-Control.git/': server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none- github: server certificate verification failed
- Solució / Solution
sudo apt-get install --reinstall ca-certificates- comproveu el rellotge / check clock
- Problemes / Problems
cd HVAC-IR-Control/pythonsudo python demo_mitsu.py- LED on GPIO23
- Problemes / Problems
- Python3
- sudo python3 demo_mitsu.py
- ...
- sudo python3 demo_mitsu.py
- Python3
- install system-wide
- Smart
Air Conditioner with Raspberry Pi— An Adventure
sudo apt-get install lirc- /etc/modules
lirc_dev
lirc_rpi gpio_in_pin=23 gpio_out_pin=22
- /etc/lirc/hardware.conf
...
LIRCD_ARGS="--uinput"
...
DRIVER="default"
...
DEVICE="/dev/lirc0"
MODULES="lirc_rpi"
- /boot/config.txt
dtoverlay=lirc-rpi,gpio_in_pin=23,gpio_out_pin=22
sudo rebootsystemctl status lirc.service- get remote info
systemctl stop lirc.servicemode2 -d /dev/lirc0
- ...
- Mitsubishi air conditioner
- Fotografia / Photography
- Lego
- Joguines / Toys
- Video
- UV4L (User space Video4Linux)
- Accelerated encoding
- The gpu_mem setting in /boot/config.txt needs to be greater than 16 - otherwise you will get an error with both codecs.
- v4l2_m2m
- newest than openmax
- works on 64-bit
- OpenMAX
- only for 32-bit; for 64-bit: use v4l2_m2m instead
- ffmpeg
- recent versions from apt repo already include omx and v4l2_m2m
- (RPi) Compile FFmpeg with the OpenMAX H.264 GPU acceleration
- ffmpeg
h264_omx doesn't work #98
- for 64-bit: use v4l2_m2m instead
- Gstreamer
gst-launch-1.0 v4l2src ! "video/x-raw,width=640,height=480,framerate=15/1" !
omxh264enc target-bitrate=1000000 control-rate=variable !
video/x-h264,profile=high ! h264parse ! queue !
flvmux name=mux alsasrc device=hw:1 ! audioresample ! audio/x-raw,rate=48000 !
queue ! voaacenc bitrate=32000 ! aacparse ! queue ! mux. mux. !
rtmpsink location=\"rtmp://example.com/myapp/mystream live=1\"
- MotionEye (surveilance)
- Machine learning
- TensorFlow
- Adafruit BrainCraft HAT - Machine Learning for Raspberry Pi 4
- M5StickV AI
Camera - Kendryte K210 Chipset (no Wi-Fi)
- Neural Network Processor (KPU)
- ...
- MQTT
-
MQTT
project source code producer
(from source to broker)broker consumer (listener)
(from broker to database)database graph
(from database)WebHook listener broker consumer
Mosquitto (:1883) Telegraf InfluxDB (:8086) Grafana (:3000)
IoT - Home sensor data monitoring with MQTT, InfluxDB and Grafana Nilhcem/home-monitoring-grafana
- ESP8266 + BME280
- Xiaomi mijia + paho
Mosquitto (:1883) paho (Python) InfluxDB (:8086) Grafana (:3000)
Raspberry Pi IoT: Sensors, InfluxDB, MQTT, and Grafana
Mosquitto Telegraf InfluxDB Grafana
Playing With Docker, MQTT, Grafana, InfluxDB, Python, and Arduino gonzalo123/iot.grafana
- Arduino ESP32 + potentiometer
Mosquitto paho (Python) InfluxDB Grafana (alarm -> WebHook) Flask Mosquitto NodeMCU Guía de introducción a MQTT con ESP8266 y Raspberry Pi
Raspberry pi based MQTT video doorbell
Aquesta taula continua cap a la dreta — desplaça-la o gira el mòbil.
- Instal·lació amb Docker / Installation with Docker
-
compose single
services:image pre config run post config Mosquitto mosquitto:
image: pascaldevink/rpi-mosquitto
container_name: mosquitto
ports:
- "9001:9001"
- "1883:1883"
restart: alwaysdocker pull eclipse-mosquitto
docker run -d -p 1883:1883 eclipse-mosquittodocker run -it -p 1883:1883 -p 9001:9001 eclipse-mosquitto
InfluxDB influxdb:
image: hypriot/rpi-influxdb
container_name: influxdb
restart: always
environment:
- INFLUXDB_INIT_PWD="password"
- PRE_CREATE_DB="iot"
ports:
- "8083:8083"
- "8086:8086"
volumes:
- ~/docker/rpi-influxdb/data:/datadocker pull influxdb
docker run -d -p 8086:8086 -v $PWD:/var/lib/influxdb influxdbdocker run -d -p 8086:8086 -v influxdb:/var/lib/influxdb --name influxdb influxdb
docker exec -it influxdb influxCREATE DATABASE sensorsCREATE USER telegraf WITH PASSWORD 'telegraf'GRANT ALL ON sensors TO telegraf
Telegraf
docker pull telegraf
docker run --rm telegraf telegraf config > telegraf.conf[[inputs.mqtt_consumer]]
servers = ["tcp://raspberry_pi_ip:1883"]
topics = [
"sensors"
]
data_format = "influx"[[outputs.influxdb]]
urls = ["http://raspberry_pi_ip:8086"]
database = "sensors"
skip_database_creation = true
username = "telegraf"
password = "telegraf"
docker run -v $PWD:/etc/telegraf:ro telegraf
Grafana grafana:
image: fg2it/grafana-armhf:v4.6.3
container_name: grafana
restart: always
ports:
- "3000:3000"
volumes:
- grafana-db:/var/lib/grafana
- grafana-log:/var/log/grafana
- grafana-conf:/etc/grafanadocker pull grafana/grafana
docker run -d -p 3000:3000 grafana/grafana
- admin / admin
- Data source: InfluxDB
- URL:
http://raspberry_pi_ip:8086 - Database:
sensors - User: ...
- Password: ...
- URL:
- Dashboard
- Query
- A
- ...
- A
- Visualization
- ...
- Query
Aquesta taula continua cap a la dreta — desplaça-la o gira el mòbil.
-
- rtl_433 -> mosquitto -> telegraf -> influxdb ->
grafana
xiaomi mijia -> python paho -> mosquitto -> telegraf -> influxdb -> grafana
order to config order when running
image pre config run post config verify / monitor 2 1 rtl_433 -
rtl_433 -f 433.92M -F mqtt- rtl_433 -f
433.5M
-F mqtt
2 1 Xiaomi MiJia
main.pyimport jsonMQTT_SERVER = 'localhost'
MIJIA_BTLE_ADDRESS = '...'- def
publish_sensor_data(mqttc):
message = json.dumps({'temperature':float(temperature), 'humidity':float(humidity), 'battery':battery})
mqttc.publish('home/mijia/events', message, 1, True)
home-monitoring-grafana/04-mijia_ble_mqtt/main.py
(logs from main.py)
docker network create xarxa1
1 2 Mosquitto docker pull eclipse-mosquitto
docker run --network xarxa1 -d --name mosquitto -p 1883:1883 eclipse-mosquitto- if the container already exists:
- docker start mosquitto
mosquitto_sub -v -t '#'
4 3 Telegraf docker pull telegraf- Create new user:
sudo useradd -rs /bin/false telegraftelegraf_user_group=$(getent passwd | awk -F: '/^influxdb/ {print $3":"$4}')
- Create config dir:
sudo mkdir -p /etc/telegraf
- Create
/etc/telegraf/telegraf.confconfig file:docker run --rm telegraf telegraf config | sudo tee /etc/telegraf/telegraf.conf > /dev/null
- Set permissions (needed?)
sudo chown telegraf:telegraf /etc/telegraf/*
- Modify telegram config file
- get influxdb ip address:
docker network inspect bridge | grep -A 5 influxdb
sudo nano /etc/telegraf/telegraf.conf[[inputs.mqtt_consumer]]
servers = ["tcp://<mosquitto_ip_address>:1883"]
topics = [
"rtl_433/raspberrypi/events",
"home/mijia/events",
]
data_format = "json"
[[outputs.influxdb]]
urls = ["http://<influxdb_ip_address>:8086"]
database = "sensors"
skip_database_creation = true
## HTTP Basic Auth
username = "telegraf"
password = "telegraf123"
- get influxdb ip address:
docker run --network xarxa1 -d --user ${telegraf_user_group} --name=telegraf -v /etc/telegraf/telegraf.conf:/etc/telegraf/telegraf.conf:ro telegraf- if the container already exists:
- docker start telegraf
docker container logs -f telegraf
3 4 InfluxDB docker pull influxdb- Create new system user:
sudo useradd -rs /bin/false influxdbinfluxdb_user_group=$(cat /etc/passwd | awk -F: '/^influxdb/ {print $3":"$4}')
- Create /etc/influxdb/influxdb.conf (owned by
root.root):
sudo mkdir -p /etc/influxdbdocker run --rm influxdb influxd config | sudo tee /etc/influxdb/influxdb.conf > /dev/nullls -l /etc/influxdb/influxdb.conf
- Create dir /var/lib/influxdb (owned by
influxdb.influxdb)
sudo mkdir -p /var/lib/influxdbsudo chown influxdb:influxdb -R /var/lib/influxdb
- Init database with created init file and create
a user (--rm option must be specified before
--user) (--user option is needed because files in
/var/lib/influxdb must be owned by
influxdb.influxdb):
docker run --rm--user ${influxdb_user_group}\
-e INFLUXDB_HTTP_AUTH_ENABLED=true \
-e INFLUXDB_ADMIN_USER=admin \
-e INFLUXDB_ADMIN_PASSWORD=admin123 \
-e-e INFLUXDB_USER=telegraf \INFLUXDB_DB=sensors \
-e INFLUXDB_USER_PASSWORD=telegraf123 \
-v /var/lib/influxdb:/var/lib/influxdb \
influxdb /init-influxdb.sh- ls -l
/var/lib/influxdb
docker run --network xarxa1 -d -p 8086:8086 --user ${influxdb_user_group} --name=influxdb \
-v /etc/influxdb/influxdb.conf:/etc/influxdb/influxdb.conf \
-v /var/lib/influxdb:/var/lib/influxdb \
influxdb -config /etc/influxdb/influxdb.conf- if the container already exists:
docker start influxdb
curl -G http://localhost:8086/query --data-urlencode "q=SHOW DATABASES"docker exec -it influxdb influx -precision rfc3339- SHOW DATABASES
- SHOW USERS
- USE sensors
- SELECT * FROM mqtt_consumer
5 5 Grafana docker pull grafana/grafana
docker run --network xarxa1 -d -p 3000:3000 --name=grafana grafana/grafana- if the container already exists:
docker start grafana
http://raspberrypi.local:3000/
- admin / admin
- Add data source
- InfluxDB
- HTTP
- http://<influxdb_ip_address>:8086
- Auth
- InfluxDB Details
- Database: sensors
- User: telegraf
- Password: telegraf123
- HTTP
- InfluxDB
- Add Query
- A
- FROM default mqtt_consumer
- SELECT field(temperature_C) distinct()
- GROUP BY time($_interval) fill(null)
- A
Aquesta taula continua cap a la dreta — desplaça-la o gira el mòbil.
-
- Desenvolupament / Development
- PyGame
- Installation
sudo apt-get install python-pygame
- PiTFT
- PiTFT PyGame Tips
- Raspberry Pi Pygame UI basics (Jeremy Blythe)
- ...
- Installation
- PyGame
Darrera modificació: 5 de gener de 2025 / Last update: 5th January 2025
Casa / Home