Announcement

Collapse
No announcement yet.

Instructions for Homeseer on Ubuntu Server on Pi from bare metal.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Instructions for Homeseer on Ubuntu Server on Pi from bare metal.

    Hopefully this will help some new users get started with Homeseer on Pi.

    Parts:
    Sandisk Extreme 64Gb microsd card
    Raspberry pi Model 3 B+
    Case and heatsinks (Sunfounder ABS case)
    Power supply (3A) (Mackertop Brand Pi 3 Power supply)
    Ethernet cable to router

    Software:
    Windows or Mac or Linux system to burn Ubuntu
    Etcher
    https://www.balena.io/etcher/

    Ubuntu for pi (arm)
    https://www.ubuntu.com/download/iot/raspberry-pi-2-3

    Putty (SSH)
    https://www.chiark.greenend.org.uk/~...ty/latest.html

    Card preparation:
    On your PC:
    1. Insert microSD card into card reader.
    2. "Cancel" when Windows asks you to format the card.
    3. Using Etcher, select the downloaded file, the card, and then flash.
    4. Wait
    5. Close Etcher.
    6. Remove card

    Assemble Pi
    1. Place heat sinks onto 2 chips on top, one on bottom
    2. Install into case
    3. Insert ethernet cable from router / switch
    4. Insert microSD card.
    5. Insert 3A power supply.
    6. Wait about 2 minutes and look for a new device on your router called Ubuntu and note the IP address
    7. Set up fixed IP address from your DCHP server for raspberry pi - wired
    8. Using Putty, SSH into Pi using IP address above. Accept the fingerprint of your new device.
    9. Login using user ubuntu password ubuntu
    10. Change default password.
    11. Login again with new password.
    Reboot
    Code:
    sudo init 6
    13. SSH (Putty) using IP specified in DHCP server (router)

    Update ubuntu
    Code:
    sudo apt-get update
    Code:
    sudo apt-get upgrade
    note: sudo apt upgrade either failed or hanged for 10 minutes.
    Reboot Pi
    Code:
    sudo init 6
    Ssh/login again
    Code:
    sudo apt-get update
    There will be a list of packages "kept-back" Note packages.
    Manually upgrade above packages. The command for my installation was:
    Code:
    sudo apt-get install linux-headers-raspi2 linux-image-raspi2 linux-raspi2 u-boot-tools
    Reboot
    Code:
    sudo init 6
    Set up wireless networking to help include devices later (optional)
    Ubuntu moved from /etc/network/interfaces to Netplan. Here's how to set up.

    1. Backup up old config
    Code:
    sudo cp /etc/netplan/50-cloud-init.yaml /etc/netplan/50-cloud-init.yaml.orig
    Disable auto network configuration
    Code:
    sudo nano -w /etc/cloud/cloud.cfg/99-disable-network-config.cfg
    Code:
    network: {config: disabled}
    Turn on wifi
    Code:
    sudo ifconfig wlan0 up
    Confirm:
    Code:
    networkctl
    Configure network.
    Code:
    sudo nano -w /etc/netplan/edit 50-cloud-init.yaml
    Code:
    network:
    version: 2
      renderer: networkd
      ethernets:
        enp3s0:
          dhcp4: yes
          dhcp6: no
    
      wifis:
        wlp3s0:
         dhcp4: yes
         dhcp6: no
         access-points:
           "MY_HOME_ROUTER":
             password: "abcd1234"
    note: don't forget the colon after SSID field like I did.
    Note2: when editing yaml config files, do not use tabs, only spaces.

    Code:
    Sudo netplan try
    Code:
    sudo netplan apply
    To troubleshoot:
    Code:
    sudo netplan --debug generate
    Now you have an up to date Ubuntu server on Pi with Wifi enabled. Next post is how to actually install Homeseer!

    #2
    Install Mono:

    SSH into Pi
    Install mono via repository
    Code:
    sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
    Code:
    echo "deb https://download.mono-project.com/repo/ubuntu stable-bionic main" | sudo tee /etc/apt/sources.list.d/mono-official-stable.list
    Code:
    sudo apt update
    Code:
    sudo apt install mono-complete mono-vbnc mono-xsp4
    Patch mono
    Code:
    sudo cp /usr/bin/vbnc /usr/bin/vbnc.orig
    Code:
    sudo nano -w /usr/bin/vbnc
    Code:
    #!/bin/bash
    for x; do
    if [[ $x = '/tmp'* ]]; then
    sed -i '1{/#Externa/d}' $x
    fi
    done
    exec /usr/bin/mono --debug $MONO_OPTIONS /usr/lib/mono/4.5/vbnc.exe "$@"
    Install HS3
    Download HS3 for Linux
    Code:
    cd /home/ubuntu
    Code:
    wget http://homeseer.com/updates3/hs3_linux_3_0_0_531.tar.gz
    Code:
    sudo tar xvf hs3_linux_3_0_0_531.tar.gz
    Create service:
    Code:
    cd /etc/systemd/system
    Code:
    sudo nano -w homeseer.service
    Code:
    [Unit]
    Description=HomeSeer Service
    
    [Service]
    ExecStart=/usr/bin/mono /home/ubuntu/HomeSeer/HSConsole.exe --log
    WorkingDirectory=/home/ubuntu/HomeSeer
    Restart=on-failure
    RestartSec=10
    
    [Install]
    WantedBy=multi-user.target
    start homeseer
    Code:
    sudo systemctl start homeseer
    Test Homeseer by going to browser:
    http://IP address of Pi

    Register via browser

    Configure Homeseer to start on boot
    Code:
    sudo systemctl enable homeseer
    reboot to verify
    Code:
    sudo init 6
    Thank you for all the forum participants who have provided the steps and information used in this tutorial.

    Comment


      #3
      To set up a basic firewall:

      Install firehol
      Code:
      sudo apt-get install firehol
      Backup configuration:
      Code:
      sudo cp /etc/firehol/firehol.conf /etc/firehol/firehol.conf.orig
      Update configuration:
      Code:
      sudo nano -w /etc/firehol/firehol.conf
      clear existing configuration lines (F9 repeatedly)
      enter following:
      Code:
      version 6
      server_hsspeaker_ports="tcp/10401"
      client_hsspeaker_ports="default 10401"
      server_hsunknown_ports="tcp/10400"
      client_hsunknown_ports="default 10400"
      server_hstouch_ports="tcp/10200"
      client_hstouch_ports="default 10200"
      
      
      # Accept all client traffic on any interface
      interface4 eth0 homenet
              policy reject
              server ICMP accept
              server http accept
              server ssh accept
              server hsspeaker accept
              server hstouch accept
              server hsunknown accept
              client all accept
      
      interface4 wlan0 homewifi
              policy reject
              server ICMP accept
              server http accept
              server ssh accept
              server hsspeaker accept
              server hstouch accept
              server hsunknown accept
              client all accept
      Start firewall
      Code:
      sudo systemctl start firehol
      Enable firewall to start on boot
      Code:
      sudo systemctl enable firehol
      ​​​​​​​

      Comment

      Working...
      X