sudo apt-get install avahi-daemonsudo insserv avahi-daemon# dd bs=4M if=/dev/mmcblk0 | gzip >
/tmp/raspbian_`date +%Y%m%d`.bin.gzgzip -dc /tmp/raspbian_YYYYmmdd.bin.gz | dd bs=4M
of=/dev/mmcblk0/tmp/raspbian_YYYYmmdd.bin.gz| lateral | posterior | GPIO | ||
| 1 | ||||
| 2 | ||||
| 3 | ||||
| 4 |
|
|
40-pin | |
| 5 |
|
|
40-pin |
sudo usermod -a -G dialout <username>ID 2e8a:0003 Raspberry Pi RP2 Boot
UF2 Bootloader
v2.0
Model: Raspberry Pi RP2
Board-ID: RPI-RP2ID 2e8a:0005 MicroPython Board in FS mode| 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 |
pico-setup (intended for installation in
a Raspberry Pi 4; it will also install VisualStudioCode,
OpenOCD)
pico-sdk
pico-examples
pico-extras
pico-playground
picotool
picoprobesudo dnf install ...git clone
https://github.com/raspberrypi/picotool.gitcd picotoolmkdir buildcd buildexport PICO_SDK_PATH=...cmake ..make~/apps/thonny/bin/thonnyimport 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)git clone
git://github.com/quick2wire/quick2wire-python-api.git
git clone
git://github.com/quick2wire/quick2wire-gpio-admin.gitpinout (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 |
||
| form factor | amplada | alçada | exemples |
|---|---|---|---|
| Pico | 51 | 21 |
|
| Ultra-compact | 65 | 30 |
|
| Compact | 65 | 56,5 |
|
| Standard | 85,6 | 56,5 |
|
| Pibow | |||
| PiHut | Raspberry Pi Cases | ||
| RaspberryPi.dk | Cases | ||
| Tiendatec | Cajas | ||
| Marca | família RPi | model | mides | plaques | pantalla | comandament | programari |
|---|---|---|---|---|---|---|---|
| Argon | One v2 | ||||||
| One M.2 | |||||||
| Audiophonics | RASPDAC Mini LCD | w:90xd:120xh:60 |
|
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 |
|
|||||
| Silverstone | PI02 |
||||||
| UGEEK |
|
| 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€ |
| connector RPi | models | |
| HDMI | HDMI | |
| I2C | ||
| SPI | GPIO |
| 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 |
| 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€ |
| ... | provider |
|---|---|
| rpi-imager | Raspberry Pi |
| NOOBS | |
| PINN |
sudo dnf install git gcc gcc-c++
make cmake libarchive-devel libcurl-devel
openssl-devel lib64qt5base5-devel
lib64qt5quickcontrols2-devel
lib64qt5svg-devel lib64qt5help-devel git clone --depth 1
https://github.com/raspberrypi/rpi-imagerrpi-imagerfdisk -lDisk /dev/mmcblk0 ... fdisk /dev/mmcblk0p d ntbwmkfs.vfat /dev/mmcblk0p1cd /tmpwget
https://downloads.raspberrypi.org/NOOBS_latestmount | grep -i mmcblk0p1cd /run/media/.../F2AC-9B34mv /tmp/NOOBS_latest /tmp/NOOBS_latest.zipunzip /tmp/NOOBS_latest.zipcdumount /dev/mmcblk0p1| size |
name |
type |
|
|---|---|---|---|
| mmcblk0p1 |
821MB |
RECOVERY |
W95 FAT16 |
| mmcblk0p5 |
60MB |
boot |
W95 FAT32 |
| mmcblk0p6 |
13GB |
root |
ext4 |
| mmcblk0p3 |
32MB |
SETTINGS |
ext4 |
sudo apt-get
sudo rpi-updatesudo raspi-config sudo raspi-config
| main menu | option | /boot/config.txt | alternative |
|---|---|---|---|
| 1 System Options | S1 Wireless LAN | ||
| S2 Audio | |||
| S3 Password | passwd |
||
| S4 Hostname | hostnamectl set-hostname ... |
||
S5 Boot / Auto Login
|
|||
| 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 |
| 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 |
| /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 | |
| mitjançant / through ... | directament /direct | |
|---|---|---|
| ethernet | switch | regular cable (a crossover cable is not needed any
more)
|
| WiFi | access point | ad-hoc |
raspberrypi.localsudo iwlist wlan0 scan | grep ESSID network={
ssid="testing"
psk="testingPassword"
}wpa_cli -i wlan0 reconfigure ifconfig wlan0sudo 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 303systemctl enable systemd-timesyncdsystemctl start systemd-timesyncdsudo raspi-config
ssh pi@raspberrypi.local
raspberryssh-keygen -R raspberrypi.local/run/media/${USER}/root/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)# copy file owner and file mod
chown --reference=/run/media/${USER}/root/etc/shadow
/run/media/${USER}/root/etc/shadow.new
chmod --reference=/run/media/${USER}/root/etc/shadow
/run/media/${USER}/root/etc/shadow.new# switch filesmv /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| os | bits | raspicam (legacy) | TensorFlow Lite | libcamera (new) |
|---|---|---|---|---|
|
|
|||
| 11 Bullseye | 32 | sudo raspi-config |
available |
|
| 64 | cannot be re-enabled | not available | ||
| 10 ... |
sudo apt remove libcamera-appssudo apt install -y libcamera-dev
libepoxy-dev libjpeg-dev libtiff5-devsudo apt install -y qtbase5-dev
libqt5core5a libqt5gui5 libqt5widgets5sudo apt install -y cmake
libboost-program-options-dev libdrm-dev
libexif-devcd ~/src
git clone
https://github.com/raspberrypi/libcamera-apps.git
cd libcamera-apps
git checkout prod
mkdir build
cd build| dependencies | ||
|---|---|---|
-DENABLE_DRM=1 |
||
-DENABLE_X11=1 |
X11 | libepoxy-dev |
-DENABLE_QT=1 |
Qt | qtbase5-dev libqt5core5a libqt5gui5
libqt5widgets5 |
-DENABLE_OPENCV=1 |
OpenCV | libopencv-dev |
-DENABLE_TFLITE=1 |
TensorFlow | TensorFlow Lite |
cmake .. -DENABLE_DRM=1
-DENABLE_X11=1 -DENABLE_QT=1
-DENABLE_OPENCV=0 -DENABLE_TFLITE=1
-DENABLE_COMPILE_FLAGS_FOR_TARGET=armv8-neon
cmake .. -DENABLE_DRM=1
-DENABLE_X11=1 -DENABLE_QT=1
-DENABLE_OPENCV=0 -DENABLE_TFLITE=1cmake .. -DENABLE_DRM=1 -DENABLE_X11=1
-DENABLE_QT=1 -DENABLE_OPENCV=0 -DENABLE_TFLITE=0make -j4 # use -j1 on Raspberry Pi 3
or earlier devices
sudo make install
sudo ldconfig # this is only necessary on the
first build
libcamera-hello --qt-previewlibcamera-hello --qt-preview --post-process-file
/home/pi/src/libcamera-apps/assets/negate.jsonsudo apt install opencv-datasudo ln -s /usr/share/opencv4
/usr/local/share/OpenCV| compilat amb |
processament | libcamera-hello ... |
requisits addicionals / additional requirements |
|---|---|---|---|
| - | Negatiu | --post-process-file negate.json |
|
| HDR | |
||
|
|||
| 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
224 |
|
| Estimació de posició |
|
|
|
| Detecció d'objectes |
--post-process-file object_detect_tf.json
--lores-width 400 --lores-height 300 |
|
|
| Segmentació de zones |
--post-process-file segmentation_tf.json
--lores-width 258 --lores-height 258
--viewfinder-width 1024 --viewfinder-height
1024 |
|
| 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 |
|
sudo apt-get install python-pigpio
python3-pigpiopip install
git+https://github.com/Ericmas001/HVAC-IR-Control
cd ~/srcgit clone
https://github.com/Ericmas001/HVAC-IR-Control.git
fatal: unable to access
'https://github.com/Ericmas001/HVAC-IR-Control.git/':
server certificate verification
failed. CAfile:
/etc/ssl/certs/ca-certificates.crt
CRLfile: nonesudo apt-get install
--reinstall ca-certificatescd HVAC-IR-Control/pythonsudo python demo_mitsu.py
sudo apt-get install lirc lirc_dev
lirc_rpi gpio_in_pin=23 gpio_out_pin=22 ...
LIRCD_ARGS="--uinput"
...
DRIVER="default"
...
DEVICE="/dev/lirc0"
MODULES="lirc_rpi" dtoverlay=lirc-rpi,gpio_in_pin=23,gpio_out_pin=22sudo rebootsystemctl status lirc.servicesystemctl stop lirc.servicemode2 -d /dev/lirc0 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\"| 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 |
|
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 |
|
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 | |||||||||
| compose | single | ||||
|---|---|---|---|---|---|
services: |
image | pre config | run | post config | |
| Mosquitto | mosquitto: |
docker pull eclipse-mosquitto |
|
||
| InfluxDB | influxdb: |
docker pull influxdb |
|
|
|
| Telegraf | docker pull telegraf |
|
|
|
|
| Grafana | grafana: |
docker pull grafana/grafana |
|
|
| order to config | order when running | image | pre config | run | post config | verify / monitor | |
|---|---|---|---|---|---|---|---|
| 2 | 1 | rtl_433 | - |
|
|||
| 2 | 1 | Xiaomi MiJia | main.py
|
home-monitoring-grafana/04-mijia_ble_mqtt/main.py |
(logs from main.py) |
||
|
|||||||
| 1 | 2 | Mosquitto | docker pull eclipse-mosquitto |
|
|
||
| 4 | 3 | Telegraf | docker pull telegraf |
|
|
|
|
| 3 | 4 | InfluxDB | docker pull influxdb |
|
|
|
|
| 5 | 5 | Grafana | docker pull grafana/grafana |
|
http://raspberrypi.local:3000/
|
sudo apt-get install python-pygame