Skip to content

Instantly share code, notes, and snippets.

@cactaceae21
Last active July 13, 2021 10:08
Show Gist options
  • Save cactaceae21/cdfd0579030614523e0edc6b01777e6c to your computer and use it in GitHub Desktop.
Save cactaceae21/cdfd0579030614523e0edc6b01777e6c to your computer and use it in GitHub Desktop.
MacigMirror #mm #fun

Magic Mirror configs

Ubuntu 20.04 Minimal ubuntu-20.04.2-preinstalled-server-arm64+raspi.img.xz

default user: ubuntu/ubuntu

useradd -m -s /bin/bash mm2 sudo passwd mm2

vi /etc/netplan/50-cloud-init.yaml add config:

wifis:
    wlan0:
        dhcp4: true
        optional: false
        access-points:
            <SSID>:
                password: "<password>"

sudo netplan --debug try sudo netplan --debug generate sudo netplan --debug apply

vi /etc/systemd/system/wlan0_power.service add config:

[Unit] Description=wlan0 Power Management Disable After=network.service

[Service] ExecStart=/usr/sbin/iw dev wlan0 set power_save off

[Install] WantedBy=default.target

chmod 664 /etc/systemd/system/wlan0_power.service

sudo systemctl daemon-reload sudo systemctl enable wlan0_power.service

sudo systemctl stop unattended-upgrades.service

sudo apt update sudo apt upgrade

Minimal GUI and libraries sudo apt install xinit openbox slim libnss3

Configure auto login for mm2 user /etc/slim.conf <auto_login yes> <default_user mm2>

Set Timezone sudo timedatectl set-timezone Europe/London

Set Hostname sudo hostnamectl set-hostname

Install NodeJS curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash - sudo apt install -y nodejs

sudo npm install -g pm2

** Stops screen from powering off vi /etc/X11/xorg.conf.d/10-blanking.conf

Section "Extensions" Option "DPMS" "Disable" EndSection

Section "ServerLayout" Identifier "ServerLayout0" Option "StandbyTime" "0" Option "SuspendTime" "0" Option "OffTime" "0" Option "BlankTime" "0" EndSection

*** REBOOT *** Needs a reboot to initialize the gui in prep for nodejs/electron

from mm2 user git clone https://github.com/MichMich/MagicMirror cd MagicMirror npm install cp config/config.js.sample config/config.js npm run start

ctrl-c to stop

This will confirm MM working To start at boot:

from mm2 user pm2 startup

  • READ INSTRUCTIONS * from ubuntu user - use command from mm2 user output sudo env PATH=$PATH:/usr/bin /usr/lib/node_modules/pm2/bin/pm2 startup systemd -u mm2 --hp /home/mm2

from mm2 user

cd ~ vi mm.sh

cd ~/MagicMirror DISPLAY=:0 npm start

chmod +x mm2.sh

pm2 start mm.sh --watch ~/MagicMirror/config/config.js --watch-delay 2 pm2 save


Modules: MMM-CalendarExt2 https://github.com/MMM-CalendarExt2/MMM-CalendarExt2 cd ~/MagicMirror/modules git clone --depth=1 https://github.com/eouia/MMM-CalendarExt2 cd MMM-CalendarExt2 npm install

MMM-CalendarExtTimeline https://github.com/MMM-CalendarExt2/MMM-CalendarExtTimeline cd /modules git clone https://github.com/eouia/MMM-CalendarExtTimeline

MMM-NextEvent https://github.com/cure/MMM-NextEvent cd ~/MagicMirror/modules git clone --depth=1 https://github.com/cure/MMM-NextEvent

MMM-Worldclock https://github.com/BKeyport/MMM-Worldclock/ cd ~/MagicMirror/modules # navigate to module folder git clone https://github.com/BKeyport/MMM-Worldclock


UK Calendars
https://www.gov.uk/bank-holidays

UK Weather
https://www.metoffice.gov.uk/services/data/datapoint

Security Feeds
https://securityweekly.com/feed/

Other MM / RPi related Links
https://www.okdo.com/project/keep-track-of-your-day-with-a-magic-mirror/
https://docs.magicmirror.builders/getting-started/installation.html#manual-installation
https://www.raspberrypi.org/documentation/configuration/screensaver.md
https://linuxconfig.org/how-to-run-script-on-startup-on-ubuntu-20-04-focal-fossa-server-desktop
https://raspberrypi.stackexchange.com/questions/114140/best-resource-for-raspi-config-equivalents-in-config-txt
https://linuxconfig.org/ubuntu-20-04-connect-to-wifi-from-command-line
https://itsfoss.com/connect-wifi-terminal-ubuntu/
https://askubuntu.com/questions/1143287/how-to-setup-of-raspberry-pi-3-onboard-wifi-for-ubuntu-server-with-netplan/1143594#1143594
https://gist.github.com/Jiab77/76000284f8200da5019a232854421564
https://wiki.ubuntu.com/ARM/RaspberryPi#First_boot_.28Username.2FPassword.29
https://github.com/MichMich/MagicMirror/wiki/Auto-Starting-MagicMirror
https://github.com/MichMich/MagicMirror/wiki/Configuring-the-Raspberry-Pi
https://www.raspberrypi.org/documentation/configuration/wireless/wireless-cli.md
https://askubuntu.com/questions/530072/how-to-auto-login-in-xubuntu-or-ubuntu-server-with-xfce
https://raspberrypi.stackexchange.com/questions/96606/make-iw-wlan0-set-power-save-off-permanent

Icons used in one of the mods
https://iconify.design/icon-sets/noto/

Mod list
https://github.com/MichMich/MagicMirror/wiki/3rd-party-modules

More mods
https://github.com/Blastitt/twitControl
https://github.com/fewieden/MMM-ip

Minimal desktop
https://www.smarthomebeginner.com/minimal-desktop-environment-for-linux-servers/

RPi Distro on Github
https://github.com/RPi-Distro

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment