This is detailed description of Base Configuration.
- Requirements
- Download Operation System
- MicroSD Card
- Format microSD card to FAT32
- Flash Raspbian into microSD
- Turn on raspberry and set Wi-Fi connection
- Install Git
- Set Static Ip Address
- Install RPi-monitor
- Backup
- Summary
- Downloaded OS
- microSD card 16GB
- Raspberry Pi model 3b+
- Display to setup first configuration
- HDMI cable
- keyboard
I prefer the Raspbian Official Operation System.
In my opinion, the capacity of the card should be 16GB. I prefer SanDisk
.
Format microSD card to FAT32 format. I use CD Card Formatter.
Install downloaded image on microSD. I use balenaEtcher to do it. It's easy to use. It has one feature - mount .img
files into the microDS card and nothing else!
-
Plug in microSD card into Raspberry Pi and on the single-board PC.
-
Next, put default
user:password
:pi:raspberry
. -
Next, should be configured Wi-Fi connection and SSH to be enabled:
$ sudo raspi-config
And configuration window will open and looks like picture below:
-
Next, choose
Interfacing Options
and setSSH
enable. This will help to connect to Raspberry Pi via SSH. -
After that, go back and go to
Network Options
and chooseWi-Fi
. Fill the name and password of the Wi-Fi. -
To be sure, that these changes are working as expected, reboot Raspberry:
$ sudo reboot
-
Next, need to understand the
IP address
of the Raspberry to connect to:$ sudo ifconfig
Next we can find the it:
And 192.168.0.104
is an IP address of the Raspberry Pi.
Summary: all the actions will be executed from PC via SSH connection. SSH connection it's out of the scope, so google it :)
This is the light version of the Raspbian, that's why before using scripts
from the project, we need to clone it, for this purpose install git:
$ sudo apt-get install git -y
To be sure, that every time Raspberry will be on the same IP, this needs to be configured:
First, we need to understand the main IP address of the router. For example, in this case, it's 192.168.0.1
. Or it can be 192.168.1.1
.
Open the dhcpcd config:
$ sudo nano /etc/dhcpcd.conf
and write down below
nodhcp
interface eth0
static ip_address=192.168.0.222/24
static routers=192.168.0.1
static domain_name_servers=192.168.0.1
interface wlan0
static ip_address=192.168.0.222/24
static routers=192.168.0.1
static domain_name_servers=192.168.0.1
interface wlan1
static ip_address=192.168.0.222/24
static routers=192.168.0.1
static domain_name_servers=192.168.0.1
I choose 192.168.0.222
as a static ip address and set to all interfaces, which can be.
Next, reboot raspberry and watch to static IP instead of the dynamic.
$ sudo reboot
Raspberry should be monitored and RPi-monitor
- it's the tool, which can help with it. It developed for Raspbian and it's fast and light.
It shows the next data:
- Version of the OS
- Uptime
- CPU
- Temperature
- Memory
- SD Card memory
Looks like picture below:
I really like it, moreover it has statistics
section, when can be sound data from last reboot, see below:
Can be used bash script from the project.
So, go ahead:
First, add https
support:
$ sudo apt-get install apt-transport-https ca-certificates
Add the public key for repository access:
$ sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 2C0D3C0F
Add RPi-monitor repository to the list of the available repos:
$ sudo wget goo.gl/vewCLL -O /etc/apt/sources.list.d/rpimonitor.list
Update packages with new configurations:
$ sudo apt-get update
Install RPi-monitor:
$ sudo apt-get install rpimonitor
It's the last step for installing RPi-monitor. Let's do extra configurations.
Add auto update package status:
$ sudo /etc/init.d/rpimonitor install_auto_package_status_update
$ sudo /etc/init.d/rpimonitor update
$ sudo service rpimonitor restart
Now it's available in 192.168.0.222:8888
.
This is a good time to do the backup. What does it mean? It means that needs to create .img
file of the microSD card with Base Configuration to be sure that if something will be bad, we can easily set it again, just mount own customized image.
//todo adds the link to the base configuration image.
Should be found the name of the microSD card put it into command below
For people who use linux/macOS it's really easy. I use macOS, so will tell how to do it on macboor:
$ sudo dd if=/dev/name_of_the_microSdCard of=/home/Username/Desktop/raspberrypi-backup.img
That’s it. The only thing is highly recommended is that you properly eject the SD before taking it out of the slot physically:
$ sudo diskutil eject /dev/name_of_the_microSdCard
Full Description of how to make the backup without empty space will be added later
It's all that I wanted to add to the Base Configuration stage. This is the base of all the instances of all Raspberry Pi PCs.
Good luck!