yunohost admin

sub:module

integration: upnp

FIELD VALUE
support/reference URL [create cron job] https://www.geeksforgeeks.org/cron-command-in-linux-with-examples/
support/reference URL [restart cron] https://www.golinuxcloud.com/restart-crontab/
support/reference URL https://github.com/home-assistant/core/issues/86898

setup instructions

  • need to programatically enable upnp

yunohost firewall upnp enable

bash script

upnp.sh

# enable upnp for homeassistant 
yunohost firewall upnp enable 
  • schedule cron job every hour

crontab -e

# cron job for upnp enable for homeassistant
@hourly  /root/upnp.sh

sub:module

integration: swap file on external usb

FIELD VALUE
support/reference URL https://www.makeuseof.com/easy-way-to-add-virtual-memory-swap-to-raspberry-pi/
mount label sda1
UUID 8c4af039-f30e-40be-b9b5-2b85da5c8328

setup instructions

:::info
format usb for swap

:::

  • on a desktop computer, insert USB stick, open Disk Manager and select Format

  • create a partition using + symbol

  • set partition size of maximum twice RAM

    • RAM available on Pi4 = 4GB so 4x2 = 8GB partition size
  • name the volume Swap

  • select Other for partition type

  • select Linux Swap Partition and create it

  • Click on Gear icon and select Edit Mount Options

  • Toggle User Session Defaults and click OK

    • Make sure Mount at system startup is selected

:::warning
alternatively, to format on linux

:::

  • follow above steps to the point of creating a volume Swap
  • plug USB stick into rpi4 and type lsblk
  • determine mount label
  • unmount by sudo umount /dev/sda1
  • format for swap by mkswap /dev/sda1

:::info
mount usb on rpi4

:::

  • ssh into server
  • find the swap partition by lsblk
  • find the UUID of device noted from prior step by blkid
  • copy UUID and edit fstab file to mount automatically at boot

sudo nano /etc/fstab

  • add line

UUID=”<UUID>” none swap sw 0 0

  • save, reboot and check swap size

free -m

:::info
edit swappiness paramater

:::

  • to find current value

cat proc/sys/vm/swappiness

  • default value is 60; edit to 100 if rpi4 consistently runs out of RAM; else leave at default or edit lower

sudo nano /etc/sysctl.conf

sysctl.conf

vm.swappiness=100


You'll only receive email when they publish something new.

More from Kirk Rehn
All posts