Skip to content

gertlind/Argon-RPI4B-Installation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

Install  Linux on a Micro SD with Raspberry Imager

  • [https://www.raspberrypi.org/software/] (url)
    • Create an empty file with the name SSH in the root of the Micro SD.
    • Create wpa_supplicant.conf with below content in the root of the Micro SD.
country=SE
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
network={
ssid="yourSSID"
psk="xxxxxxxx"
key_mgmt=WPA-PSK
}
  • Insert the MicroSD in the Raspberry and start.
    • Log in and update below.
sudo apt update
sudo apt full-upgrade
sudo rpi-update
sudo reboot
sudo rpi-eeprom-update -d -a

Make below settings in raspi-config

  • raspi-config
    • Advanced Options
      • Bootloader Version
        • [Boot ROM Version]
          • [Latest Use the latest version boot ROM software]
            • [Reset to Default] - [No]
            • [Boot ROM not reset to defaults] - [Ok]
        • Advanced Options
          • [Boot Order]
            • [USB Boot]
              • [USB device is default boot device] - [Ok]
      • [Finish]
      • [Would you like to reboot now] - [Yes]
    • Check /boot/vcgencmd bootloader_config
      • Last row should be: BOOT_ORDER=0xf41

Copy the Micro SD to the SSD drive with RPI-Clone

Install git

sudo apt-get install git

https://github.com/billw2/rpi-clone

git clone https://github.com/billw2/rpi-clone.git
cd rpi-clone
sudo cp rpi-clone rpi-clone-setup /usr/local/sbin
rpi-clone -f -p 240M sda
# This takes a while

Shut down

sudo shutdown -h now
  • Remove the Micro SD and start.

Change Hostname

# change the name in /etc/hostname
sudo nano /etc/hostname

# edit /etc/hosts
sudo nano /etc/hosts
 127.0.0.1       localhost
 ::1             localhost ip6-localhost ip6-loopback
 ff02::1         ip6-allnodes
 ff02::2         ip6-allrouters

 127.0.0.1       hostname

reboot

sudo reboot

Argon tool

curl https://download.argon40.com/argon1.sh | bash

Instruction - https://www.waveshare.com/wiki/PI4-CASE-ARGON-ONE

#settings
argonone-config 

Install Fail2Ban

http://kamilslab.com/2016/12/11/how-to-install-fail2ban-on-the-raspberry-pi

Also check out https://www.domoticz.com/wiki/Setup_fail2ban on how to add Domoticz to fail2ban.

Install ntpdate

sudo apt install ntpdate
sudo nano /etc/rc.local
Add  ntpdate -s pool.ntp.org last row before exit 0.
Save and close
Reboot

Install Domoticz

curl -L https://install.domoticz.com | bash

Create domoticz in /etc/logrotate.d/

sudo nano /etc/logrotate.d/domoticz
/var/log/domoticz.log {
rotate 7
daily
minsize 1M
missingok
notifempty
copytruncate
compress
delaycompress
postrotate
	invoke-rc.d sudo systemctl restart domoticz.service > /dev/null
endscript
}

Change domoticz log path

sudo nano /etc/init.d/domoticz.sh
DAEMON_ARGS="$DAEMON_ARGS -log /var/log/domoticz.log"

Install Speed Test

sudo apt-get install gnupg1 apt-transport-https dirmngr
export INSTALL_KEY=379CE192D401AB61
export DEB_DISTRO=$(lsb_release -sc)
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys $INSTALL_KEY
echo "deb https://ookla.bintray.com/debian ${DEB_DISTRO} main" | sudo tee  /etc/apt/sources.list.d/speedtest.list
sudo apt-get update
sudo apt-get install speedtest

Install ddclient

sudo apt-get install ddclient

Example ddclient.conf

# Configuration file for ddclient generated by debconf
#
# /etc/ddclient.conf

daemon=600
# check every 600 seconds
syslog=yes
# log update msgs to syslog
mail-failure=your.mail.com # Mail failed updates to user
pid=/var/run/ddclient.pid
# record PID in file.
ssl=yes
# use HTTPS
## Detect IP with our CheckIP server
use=web, web=checkip.dyndns.com/, web-skip='IP Address'
## DynDNS username and password here
login=your_username
password=your_password
## Default options
protocol=dyndns2
#server=members.dyndns.org
## Dyn Standard DNS hosts
custom=yes, your.domain.com

Change Python to version 3

sudo update-alternatives --install /usr/bin/python python /usr/bin/python2.7 1
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.7 2
# List alternatives
update-alternatives --list python
# Change version
update-alternatives --config python

Domoticz fails to start after power failure.

For some reason Domoticz wont start after a power failure. Add below line to crontab.

@reboot sleep 180;sudo systemctl restart domoticz.service

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published