├── .travis.yml ├── CHANGELOG.md ├── README.md └── hassio_rpi3bp /.travis.yml: -------------------------------------------------------------------------------- 1 | language: bash 2 | 3 | os: linux 4 | dist: trusty 5 | sudo: required 6 | 7 | script: 8 | - shellcheck hassio_rpi3bp 9 | 10 | notifications: 11 | email: false 12 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Hass.io Installer for Raspberry Pi 3 B+ 2 | 3 | All notable changes to this project will be documented in this file. 4 | 5 | The format is based on [Keep a Changelog][keep-a-changelog] 6 | and this project adheres to [Semantic Versioning][semantic-versioning]. 7 | 8 | ## Unreleased 9 | 10 | - Option to disable SSH after installation 11 | - Change port for SSH server on host machine 12 | 13 | ## [1.1.1][] - 2018-04-05 14 | 15 | ### Added 16 | 17 | - This CHANGELOG file 18 | 19 | ## [1.1.0][] - 2018-04-03 20 | 21 | ### Added 22 | 23 | - Change hostname to "hassio" during installation 24 | 25 | ## [1.0.0][] - 2018-03-30 26 | 27 | ### Added 28 | 29 | - First version of the Hass.io Installer for Raspberry Pi 3 B+ 30 | 31 | [keep-a-changelog]: https://keepachangelog.com/en/1.0.0/ 32 | [semantic-versioning]: https://semver.org/spec/v2.0.0.html 33 | [1.0.0]: https://github.com/dale3h/hassio-installer/tree/v1.0.0 34 | [1.1.0]: https://github.com/dale3h/hassio-installer/compare/v1.0.0...v1.1.0 35 | [1.1.1]: https://github.com/dale3h/hassio-installer/compare/v1.1.0...v1.1.1 36 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Hass.io Installer for Raspberry Pi 3 B+ 2 | 3 | [![Documentation][badge-docs]][hass-io] 4 | [![Discord][badge-discord]][discord] 5 | [![Version][badge-version]][hassio-installer] 6 | [![Donate][badge-donate]][donate] 7 | 8 | This script will install all [requirements][requirements], and then install 9 | [Hass.io][hass-io]. Please report any [issues][issues] that experience. 10 | 11 | ## Requirements 12 | 13 | - [Raspberry Pi 3 B+][raspberry-pi] 14 | - [Raspbian Stretch Lite][stretch-lite] 15 | 16 | ## Useful Tips 17 | 18 | - Be sure to secure your Raspberry Pi by disabling SSH and changing the 19 | password for `pi` user. 20 | 21 | - If you plan to install via SSH, be sure to [create a file named `ssh` on your 22 | SD card][enable-ssh] in `/boot` to enable SSH on first boot. 23 | 24 | - If you plan to connect via WiFi, be sure to setup your `wpa_supplicant.conf` 25 | file in `/boot` prior to your first boot. 26 | 27 | ## Installation Instructions 28 | 29 | 1. Flash the latest [Raspbian Stretch Lite][stretch-lite] image. 30 | 1. Run this as root user (`sudo su`): 31 | 32 | ```bash 33 | curl -sL https://raw.githubusercontent.com/dale3h/hassio-installer/master/hassio_rpi3bp | bash -s 34 | ``` 35 | 36 | ## Known Issues 37 | 38 | - **Bluetooth BCM43xx** add-on does not work 39 | 40 | - **SSH server** add-on (from **Official add-ons**) does not work 41 | - ***Fix:** use community SSH add-on instead* 42 | 43 | - Port conflict when using SSH add-on 44 | - ***Fix:** change the port in the SSH add-on options* 45 | 46 | ## Changelog & Releases 47 | 48 | This project keeps a [change log][changelog]. The format of the log is based 49 | on [Keep a Changelog][keep-a-changelog]. 50 | 51 | Releases are based on [Semantic Versioning][semantic-versioning], and use the 52 | format of ``MAJOR.MINOR.PATCH``. In a nutshell, the version will be incremented 53 | based on the following: 54 | 55 | - ``MAJOR``: Incompatible or major changes. 56 | - ``MINOR``: Backwards-compatible new features and enhancements. 57 | - ``PATCH``: Backwards-compatible bugfixes and package updates. 58 | 59 | ## License 60 | 61 | MIT License 62 | 63 | Copyright (c) 2018 Dale Higgs <@dale3h> 64 | 65 | Permission is hereby granted, free of charge, to any person obtaining a copy 66 | of this software and associated documentation files (the "Software"), to deal 67 | in the Software without restriction, including without limitation the rights 68 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 69 | copies of the Software, and to permit persons to whom the Software is 70 | furnished to do so, subject to the following conditions: 71 | 72 | The above copyright notice and this permission notice shall be included in all 73 | copies or substantial portions of the Software. 74 | 75 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 76 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 77 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 78 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 79 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 80 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 81 | SOFTWARE. 82 | 83 | [changelog]: CHANGELOG.md 84 | [discord]: https://discord.gg/u26F9Kw 85 | [donate]: https://www.buymeacoffee.com/dale3h 86 | [enable-ssh]: https://howchoo.com/g/ote0ywmzywj/how-to-enable-ssh-on-raspbian-jessie-without-a-screen 87 | [hass-io]: https://www.home-assistant.io/hassio/ 88 | [hassio-installer]: https://github.com/dale3h/hassio-installer 89 | [issues]: /issues 90 | [keep-a-changelog]: https://keepachangelog.com/en/1.0.0/ 91 | [raspberry-pi]: http://a.co/ciXqByX 92 | [requirements]: https://github.com/home-assistant/hassio-build/blob/master/install/README.md#requirements 93 | [semantic-versioning]: https://semver.org/spec/v2.0.0.html 94 | [stretch-lite]: https://downloads.raspberrypi.org/raspbian_lite_latest 95 | 96 | [badge-discord]: https://img.shields.io/discord/330944238910963714.svg?style=for-the-badge&maxAge=3600 97 | [badge-docs]: https://img.shields.io/badge/read-docs-blue.svg?style=for-the-badge 98 | [badge-donate]: https://img.shields.io/badge/beerpay-$5-orange.svg?style=for-the-badge 99 | [badge-version]: https://img.shields.io/badge/version-1.1.1-red.svg?style=for-the-badge 100 | -------------------------------------------------------------------------------- /hassio_rpi3bp: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | ########################################################### 3 | ########################################################### 4 | ## ## 5 | ## THIS SCRIPT SHOULD ONLY BE RUN ON A RASPBERRY PI 3 B+ ## 6 | ## ## 7 | ########################################################### 8 | ########################################################### 9 | set -o errexit # Exit script when a command exits with non-zero status 10 | set -o errtrace # Exit on error inside any functions or sub-shells 11 | set -o nounset # Exit script on use of an undefined variable 12 | set -o pipefail # Return exit status of the last command in the pipe that failed 13 | 14 | # ============================================================================== 15 | # GLOBALS 16 | # ============================================================================== 17 | readonly HOSTNAME="hassio" 18 | readonly HASSIO_INSTALLER="https://raw.githubusercontent.com/home-assistant/hassio-build/master/install/hassio_install" 19 | readonly REQUIREMENTS=( 20 | apparmor-utils 21 | apt-transport-https 22 | avahi-daemon 23 | ca-certificates 24 | curl 25 | dbus 26 | jq 27 | network-manager 28 | socat 29 | software-properties-common 30 | ) 31 | 32 | # ============================================================================== 33 | # SCRIPT LOGIC 34 | # ============================================================================== 35 | 36 | # ------------------------------------------------------------------------------ 37 | # Ensures the hostname of the Pi is correct. 38 | # ------------------------------------------------------------------------------ 39 | update_hostname() { 40 | old_hostname=$(< /etc/hostname) 41 | if [[ "${old_hostname}" != "${HOSTNAME}" ]]; then 42 | sed -i "s/${old_hostname}/${HOSTNAME}/g" /etc/hostname 43 | sed -i "s/${old_hostname}/${HOSTNAME}/g" /etc/hosts 44 | hostname "${HOSTNAME}" 45 | echo "Hostname will be changed on next reboot: ${HOSTNAME}" 46 | fi 47 | } 48 | 49 | # ------------------------------------------------------------------------------ 50 | # Installs all required software packages and tools 51 | # ------------------------------------------------------------------------------ 52 | install_requirements() { 53 | echo "Updating APT packages list..." 54 | apt-get update 55 | 56 | echo "Ensure all requirements are installed..." 57 | apt-get install -y "${REQUIREMENTS[@]}" 58 | } 59 | 60 | # ------------------------------------------------------------------------------ 61 | # Installs the Docker engine 62 | # ------------------------------------------------------------------------------ 63 | install_docker() { 64 | echo "Installing Docker..." 65 | curl -sSL https://get.docker.com | sh 66 | } 67 | 68 | # ------------------------------------------------------------------------------ 69 | # Installs and starts Hass.io 70 | # ------------------------------------------------------------------------------ 71 | install_hassio() { 72 | echo "Installing Hass.io..." 73 | curl -sL "${HASSIO_INSTALLER}" | bash -s -- -m raspberrypi3 74 | } 75 | 76 | # ------------------------------------------------------------------------------ 77 | # Configure network-manager to disable random MAC-address on Wi-Fi 78 | # ------------------------------------------------------------------------------ 79 | config_network_manager() { 80 | { 81 | echo -e "\n[device]"; 82 | echo "wifi.scan-rand-mac-address=no"; 83 | echo -e "\n[connection]"; 84 | echo "wifi.clone-mac-address=preserve"; 85 | } >> "/etc/NetworkManager/NetworkManager.conf" 86 | } 87 | 88 | # ============================================================================== 89 | # RUN LOGIC 90 | # ------------------------------------------------------------------------------ 91 | main() { 92 | # Are we root? 93 | if [[ $EUID -ne 0 ]]; then 94 | echo "This script must be run as root." 95 | echo "Please try again after running:" 96 | echo " sudo su" 97 | exit 1 98 | fi 99 | 100 | # Install ALL THE THINGS! 101 | update_hostname 102 | install_requirements 103 | config_network_manager 104 | install_docker 105 | install_hassio 106 | 107 | # Friendly closing message 108 | ip_addr=$(hostname -I | cut -d ' ' -f1) 109 | echo "=======================================================================" 110 | echo "Hass.io is now installing Home Assistant." 111 | echo "This process may take up to 20 minutes. Please visit:" 112 | echo "http://${HOSTNAME}.local:8123/ in your browser and wait" 113 | echo "for Home Assistant to load." 114 | echo "If the previous URL does not work, please try http://${ip_addr}:8123/" 115 | 116 | exit 0 117 | } 118 | main 119 | 120 | --------------------------------------------------------------------------------