wlado's website

Raspberry Pi 4

Instalace Raspberry Pi 4 [ver. 1.2] na USB SSD a UPS

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

1. Download
-----------
Download Raspberry Pi OS (32-bit) with desktop 2020-12-02, debian 10, kernel 5.4, velikost: 1,233 GB
2020-12-02-raspios-buster-armhf.zip

2. Unzip
--------
Mac OS X 10.6.8 použít Unarchiver 3.11
po rozbalení velikost 3,972 GB

3. Instalace na SD
------------------
3.1 připojit SD k Macovi (přes USB čtečku karet)

3.2 zjistit disk

$ diskutil list
/dev/disk0
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *1.0 TB disk0
1: EFI 209.7 MB disk0s1
2: Apple_HFS HD1TB 999.9 GB disk0s2
/dev/disk1
#: TYPE NAME SIZE IDENTIFIER
0: FDisk_partition_scheme *16.0 GB disk1
1: Windows_FAT_32 boot 268.4 MB disk1s1
2: Linux 15.7 GB disk1s2
$

3.3 odpojit disk

$ sudo diskutil unmount /dev/disk1s1
Password:
Volume boot on disk1s1 unmounted

3.4. vypálit obraz disku na SD

$ sudo dd bs=1m if=/Users/user/Desktop/Projekt-RPI-4/2020-08-20-raspios-buster-armhf.img of=/dev/rdisk1
3644+0 records in
3644+0 records out
3821010944 bytes transferred in 208.224693 secs (18350422 bytes/sec)

3.5 nastavit SSH pro headless

$ cd /Volume/boot
$ touch ssh

3.6 Vysunout disk

-- zavrit a otevrit Terminal

$ sudo diskutil eject /dev/rdisk1
Password:
Disk /dev/rdisk1 ejected
$

-- vysunout fyzicky disk

3.7 Spustení na RPi

- zasunout SD do RPi 4
- Spusti napájení
- Zjistit ip adresu na routeru
- přihlásti se SSH z Maca

3.8 aktualizace
---------------

sudo apt-get update

sudo apt-get upgrade

(sudo apt full-upgrade)

(sudo rpi-update)

sudo reboot


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

5.11 statická IP
----------------
viz článek Statická IP

6 změna hostname
----------------

6.1 kontrola

$ hostnamectl
Static hostname: raspberrypi
Icon name: computer
Machine ID: 37f971e1d6b74aa19434405xxxxxxxxx
Boot ID: 9cf2cb7f20374d689a25d73xxxxxxxxx
Operating System: Raspbian GNU/Linux 10 (buster)
Kernel: Linux 5.4.79-v7l+
Architecture: arm

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


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