Installatie Raspberry Pi

1 – RASPBERRY PI 3 B+ HEADLESS SETUP (SSH and WiFI) 

Write Image to SD Card with Etcher

Enable SSH by placing a file named “ssh” (without any extension) onto the boot partition of the SD card:

Add “wpa_supplicant.conf” File to the SD Card Root with the following text

country=NL
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1

network={
    ssid="EDH-WAP-002-2.4GHz-Open-Internet"
    psk="NETWORK-PASSWORD"
}

Boot your Pi AND CHANGE YOUR PASSWORD


2 -For security add a new user and Remove the default user the PI

Check the current PI groups

groups

pi adm dialout cdrom sudo audio video plugdev games users input netdev gpio i2c spi

Add a new user with the same groups

sudo useradd -m -G adm,dialout,cdrom,sudo,audio,video,plugdev,games,users,input,netdev,gpio,i2c,spi USERNAME

Give the new user a password

sudo passwd USERNAME

sudo nano /etc/passwd

USERNAME:x:1001:1001::/home/USERNAME:/bin/bash

Reboot and login with new username and remove the default user PI

sudo deluser --remove-all-files pi

3 – Raspberry Pi updaten

sudo apt-get update -y && sudo apt-get upgrade -y

4 – Static IP address

sudo nano /etc/dhcpcd.conf

To use DHCP disable the appropiate lines by placing a # in front of the line.

5 – Hostname
sudo hostname name

Power saving

  • https://learn.pi-supply.com/make/how-to-save-power-on-your-raspberry-pi/
  • Switching off the USB/LAN IC
    • Turn OFF USB chip > echo ‘1-1’ |sudo tee /sys/bus/usb/drivers/usb/unbind
    • Turn ON USB chip > echo ‘1-1’ |sudo tee /sys/bus/usb/drivers/usb/bind
  • Turn OFF HDMI output
    • Turn OFF HDMI output > sudo /opt/vc/bin/tvservice -o
    • Turn ON HDMI output > sudo /opt/vc/bin/tvservice -p
  • Disable Wi-Fi & Bluetooth > /boot/config.txt > reboot
    • dtoverlay=pi3-disable-wifi
    • dtoverlay=pi3-disable-bt
  • Disable on-board LEDs > /boot/config.txt > reboot
    • dtparam=act_led_trigger=none
    • dtparam=act_led_activelow=on
  • Throttle CPU > Better not > minimums:
    • arm_freq_min=250
    • core_freq_min=100
    • sdram_freq_min=150
    • over_voltage_min=0

Beeldscherm Powersaving

sudo apt-get install light-locker

—-

sudo nano /boot/config.txt

-toevoegen aan het eind.

# uncomment to put the monitor into power saving mode (DPMS)
 hdmi_blanking=1 

——

sudo nano ~/.config/lxsession/LXDE-pi/autostart

????
Raspbian Buster:
nano /etc/xdg/lxsession/LXDE-pi/autostart
????

-toevoegen aan het eind.

@xset s 0 0

@xset s noblank

@xset s noexpose

@xset dpms 0 0 12001200 is wachttijd in seconden en aante passen naar eigen inzicht.—-

sudo reboot


 HDD Power saving

https://en.wikipedia.org/wiki/Hdparm
  •  sudo apt-get install hdparm
  • hdparm -S 60 /dev/sda (To test the installation)

To make it persistentAdd the following in /etc/rc.local before exit0hdparm -S 60 /dev/sda

Disable WiFi

https://www.raspberrypi.org/forums/viewtopic.php?t=284221

SSH keys

https://edywerder.ch/setting-up-ssh-keys-on-synology

https://serverpilot.io/docs/how-to-use-ssh-public-key-authentication

ssh -i <public_key> <user>@<ip_address>

  • Puttygen > create key
  • Save the private key secure
  • COPY the public key and paste in notepad and save as “authorized_keys” no extention

Owner group users