Instalace Raspberry Pi 3 a 4 - aktualizace 2023-12-17

*** Zásadní změny ***

* Startovací disk není boot, ale bootfs
* Už není default pi user a heslo raspberrypi, ale musí být definováno uživatelem před prvním spuštěním a ještě ke všemu se zapisuje jen hash a ten neumí macos 13 vygenerovat.
  https://www.raspberrypi.com/news/raspberry-pi-bullseye-update-april-2022/
* Python 3.11 nenainstaluje pip, musí se to obejít.

Komponenty

1.1) Raspberry Pi 3 v 1.2 1.2) Raspberry Pi 4 v 1.2 IP: 10.100.0.24, MAC: DC-A6-32-72-25-F9, hostname: home 2) USB to SATA 3) USB SATA SSD WD Green 240GB, 5V/0,7A 4) (DS2418-100) i2c to 1wire (i2c = address 18) - https://thepihut.com/products/1-wire-plus - https://www.abelectronics.co.uk/kb/section/9/1-wire-pi 5) RTC DS3231 (i2c adresa = 68) 6) BME280 (ic2 adresa = 76
7) SCD41 (i2c adresa = 62) 8) DS18B20 (1wire)

SupTronics X825 (2.5 SATA) + 1TB SSD WD blue
SupTronics X728 (UPS deska + RTC)

Poznamky - ovládaní gpio na vzdálenem rpi - https://www.elvisek.cz/2018/04/raspi-remote-gpio/

8) iPad mini - 1024 x 768 4:3

1) Stažení Raspberry Pi OS Lite

2023-12-11 System 32 bit Kernel version: 6.1 Debian version: 12 (bookworm) Size: 520MB

2) Kontrola

SHA256 hash:

3) Rozbalit archivační utilitou Mac OS 13.5 (2023.12)

4) Vypsat seznam disků

~ % diskutil list
/dev/disk0 (internal, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *251.0 GB   disk0
   1:             Apple_APFS_ISC Container disk1         524.3 MB   disk0s1
   2:                 Apple_APFS Container disk3         245.1 GB   disk0s2
   3:        Apple_APFS_Recovery Container disk2         5.4 GB     disk0s3

/dev/disk3 (synthesized):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      APFS Container Scheme -                      +245.1 GB   disk3
                                 Physical Store disk0s2
   1:                APFS Volume D256GB                  10.0 GB    disk3s1
   2:              APFS Snapshot com.apple.os.update-... 10.0 GB    disk3s1s1
   3:                APFS Volume Preboot                 10.3 GB    disk3s2
   4:                APFS Volume Recovery                1.6 GB     disk3s3
   5:                APFS Volume Data                    41.6 GB    disk3s5
   6:                APFS Volume VM                      20.5 KB    disk3s6

/dev/disk4 (external, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *1.0 TB     disk4
   1:                        EFI EFI                     209.7 MB   disk4s1
   2:                 Apple_APFS Container disk5         999.9 GB   disk4s2

/dev/disk5 (synthesized):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      APFS Container Scheme -                      +999.9 GB   disk5
                                 Physical Store disk4s2
   1:                APFS Volume Preboot                 20.5 KB    disk5s2
   2:                APFS Volume Recovery                20.5 KB    disk5s3
   3:                APFS Volume VM                      1.1 GB     disk5s4
   4:                APFS Volume Ex1TB                   235.5 GB   disk5s5

/dev/disk6 (external, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *4.0 TB     disk6
   1:                        EFI EFI                     209.7 MB   disk6s1
   2:                  Apple_HFS HD4TB                   4.0 TB     disk6s2

~ % 

5) Připojit USB SSD disk

Připojit USB disk do maca

6) Vypsat seznam disků

~ % diskutil list
/dev/disk0 (internal, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *251.0 GB   disk0
   1:             Apple_APFS_ISC Container disk1         524.3 MB   disk0s1
   2:                 Apple_APFS Container disk3         245.1 GB   disk0s2
   3:        Apple_APFS_Recovery Container disk2         5.4 GB     disk0s3

/dev/disk3 (synthesized):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      APFS Container Scheme -                      +245.1 GB   disk3
                                 Physical Store disk0s2
   1:                APFS Volume D256GB                  10.0 GB    disk3s1
   2:              APFS Snapshot com.apple.os.update-... 10.0 GB    disk3s1s1
   3:                APFS Volume Preboot                 10.3 GB    disk3s2
   4:                APFS Volume Recovery                1.6 GB     disk3s3
   5:                APFS Volume Data                    41.6 GB    disk3s5
   6:                APFS Volume VM                      20.5 KB    disk3s6

/dev/disk4 (external, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *1.0 TB     disk4
   1:                        EFI EFI                     209.7 MB   disk4s1
   2:                 Apple_APFS Container disk5         999.9 GB   disk4s2

/dev/disk5 (synthesized):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      APFS Container Scheme -                      +999.9 GB   disk5
                                 Physical Store disk4s2
   1:                APFS Volume Preboot                 20.5 KB    disk5s2
   2:                APFS Volume Recovery                20.5 KB    disk5s3
   3:                APFS Volume VM                      1.1 GB     disk5s4
   4:                APFS Volume Ex1TB                   235.5 GB   disk5s5

/dev/disk6 (external, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *4.0 TB     disk6
   1:                        EFI EFI                     209.7 MB   disk6s1
   2:                  Apple_HFS HD4TB                   4.0 TB     disk6s2

/dev/disk7 (external, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:     FDisk_partition_scheme                        *240.1 GB   disk7
   1:             Windows_FAT_32 boot                    268.4 MB   disk7s1
   2:                      Linux                         239.8 GB   disk7s2

~ % 

7) odpojit disk

~ % sudo diskutil unmount /dev/disk7s1 Password: Volume boot on disk7s1 unmounted ~ %

8) vypalit ssd

~ % sudo dd bs=1m if=/Volumes/HD4TB/install/RW-raspberrypi/2023-12-11/2023-12-11-raspios-bookworm-armhf-lite.img of=/dev/rdisk7
2420+0 records in
2420+0 records out
2537553920 bytes transferred in 69.924958 secs (36289674 bytes/sec)
~ % 

9) nastavit SSH pro headless

Poznámka: Hash256 nutno připravit na linuxu

~ % cd /Volumes/bootfs 
bootfs % touch ssh
bootfs % cat > userconf.txt
rpi:encrypted-password

ctrl + D

10) Zavrit a otevrit Terminal

11) Vysunout disk

~ % sudo diskutil eject /dev/rdisk7
Password:
Disk /dev/rdisk7 ejected
~ % 

fyzicky vyndat disk

12) Zasunout disk do Raspberry Pi a nastartovat

13) První přihlášení

Zjistit na Routeru v DHCP rezervacich ip adresu

~ % ssh rpi@10.100.0.21
rpi@10.100.0.21's password: 
Linux topeni 6.1.0-rpi7-rpi-v7 #1 SMP Raspbian 1:6.1.63-1+rpt1 (2023-11-24) armv7l

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Thu Dec 21 17:02:27 2023 from 10.100.0.12
~ $ 

14) Základní nastavení - IP, Hostname, Update

14.1 Nastavení pevné IP

rpi@raspberrypi:~ $ sudo nmtui

“Edit connection” -- "Wired connection" -- "Edit"
    IPv4 CONFIGURATION: Manual -- Show

    IPv4 Addresses 10.100.0.21
    Gateway 10.100.0.1
    DNS servers 10.100.0.1

    OK
    Back
"Set System Hostname" -- OK

Quit

rpi@raspberrypi:~ $ sudo reboot

14.2 Aktualizace

rpi@home:~ $ sudo apt-get update
rpi@home:~ $ sudo apt-get upgrade

14.3 Nastavení časového pásma

sudo raspi-config
5 Localisation Options
L2 Timezone
Europe
Prague
Finish

14.4 Nastavení hostname

sudo raspi-config
1 System Options
S4 Hostname
OK
Please enter a hostname: rpi3plus -- OK
Finish
  • Pokud se objevuje chybove hlaseni - unable to resolve host xxxxx: Name or service not known - opravit v /etc/hosts na spravne jmeno aaaaaa

15) Instalace Python 3 ----------------------

15.1

$ sudo apt-get install python3-dev python3-pip Reading package lists... Done Building dependency tree... Done Reading state information... Done The following additional packages will be installed: javascript-common libexpat1-dev libjs-jquery libjs-sphinxdoc libjs-underscore libpython3-dev libpython3.11-dev python3-setuptools python3-wheel python3.11-dev zlib1g-dev Suggested packages: apache2 | lighttpd | httpd python-setuptools-doc The following NEW packages will be installed: javascript-common libexpat1-dev libjs-jquery libjs-sphinxdoc libjs-underscore libpython3-dev libpython3.11-dev python3-dev python3-pip python3-setuptools python3-wheel python3.11-dev zlib1g-dev 0 upgraded, 13 newly installed, 0 to remove and 0 not upgraded. Need to get 7,396 kB of archives. After this operation, 30.8 MB of additional disk space will be used. Do you want to continue? [Y/n] Y ... $

15.2

odblokování instalací přes pip

$ sudo mv /usr/lib/python3.11/EXTERNALLY-MANAGED /usr/lib/python3.11/EXTERNALLY-MANAGED.old

test verze

$ python3 --version Python 3.11.2

*************

3.9 Nastavit bootovani z USB

1) sudo raspi-config   
2) 6 Advanced Options Configure advanced settings   
3) A7 Bootloader Version Select latest or default boot ROM software   
4) E1 Latest Use the latest version boot ROM software   

5) Latest version boot ROM selected - will be loaded at next reboot

6) Reset boot ROM to defaults?
ENTER

7) Boot ROM reset to defaults
ENTER



8) Would you like to reboot now?
ENTER

9) sudo raspi-config
10) 6 Advanced Options Configure advanced settings
11) A6 Boot Order Choose network or USB device boot
12) B1 USB Boot Boot from USB device if SD card boot fails [ENTER]
USB device is default boot device 

Reboot

13) Kontrola

$ vcgencmd bootloader_config [all] BOOT_UART=0 WAKE_ON_GPIO=1 POWER_OFF_ON_HALT=0

[all] BOOT_ORDER=0xf41 [to je dobře] pi@raspberrypi:~ $ ```

RaspberryPi 4 Bootuje nejdříve z USB a pak hledá SD kartu

=====================

4.10 zmena hesla

pi@raspberrypi:~ $ passwd
Changing password for pi.
Current password: 
New password: 
Retype new password: 
passwd: password updated successfully

6.2 změna

$ sudo hostnamectl set-hostname nove_jmeno

7. spuštění VNC

$ sudo raspi-config 3 Interface Options P3 VNC

nastavení rozlišení

2 Display Options D1 Resolution DMT Mode 16 1024x768 60Hz 4:3

8. Node-RED

pi@central:~ $ node-red start
20 Dec 22:20:26 - [info] 

Welcome to Node-RED
===================


20 Dec 22:20:26 - [info] Node-RED version: v1.2.6
20 Dec 22:20:26 - [info] Node.js version: v12.20.0
20 Dec 22:20:26 - [info] Linux 5.4.79-v7l+ arm LE
20 Dec 22:20:26 - [info] Loading palette nodes
20 Dec 22:20:28 - [info] Dashboard version 2.25.0 started at /ui
20 Dec 22:20:28 - [info] Settings file : /home/pi/.node-red/settings.js
20 Dec 22:20:28 - [info] Context store : 'default' [module=memory]
20 Dec 22:20:28 - [info] User directory : /home/pi/.node-red
20 Dec 22:20:28 - [warn] Projects disabled : editorTheme.projects.enabled=false
20 Dec 22:20:28 - [info] Flows file : /home/pi/.node-red/start
20 Dec 22:20:28 - [info] Creating new flow file
20 Dec 22:20:28 - [warn] 

---------------------------------------------------------------------
Your flow credentials file is encrypted using a system-generated key.

If the system-generated key is lost for any reason, your credentials
file will not be recoverable, you will have to delete it and re-enter
your credentials.

You should set your own key using the 'credentialSecret' option in
your settings file. Node-RED will then re-encrypt your credentials
file using your chosen key the next time you deploy a change.
---------------------------------------------------------------------
TOP