Announcement

Collapse
No announcement yet.

Installing Debian 10 on the Hometroller (well, just about any hardware really)

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

    Installing Debian 10 on the Hometroller (well, just about any hardware really)

    Installing Debian 10 on the Hometroller (well, just about any hardware really)

    Please NOTE: There are many possible variations to these instructions, but this is what has worked for me. My initial adventure took me about 4 days to get through in solving a variety of problems. I hope to spare you the pain of doing that.

    There are many people more knowledgeable about linux than I am and I welcome any feedback or recommendation from them!

    Assumptions:

    I am assuming that you are either:

    A) Upgrading from an older version of Debian on the Hometroller

    B) Trying to prepare a system run HS4

    C) Installing a larger disk in your hometroller

    For A or B, you should get a backup of your system! Do not forget to do this!

    To backup, run:

    Code:
    tar -cvf /tmp/HomeSeer.tar /usr/local/HomeSeer /var/www
    This will backup the entire HomeSeer installation. I am assuming you have used the default location of /usr/local/HomeSeer for the installation of the HS4 software.

    Once you have this, get it off the system! These directions completely wipe the box clean and nothing is preserved!

    I used winscp to copy the file to my local PC and save it there.

    My install/update was for one of the original hometrollers sold by HomeSeer. The 'SEL' on the end meant Secure Edition Linux.

    Please NOTE: I do not recommend that you install the SEL extensions for Linux at this time. I have used them before and unless you have experience debugging them, they will shutdown your system. I hope to look further into that at a later time when I have several days to invest in fixing things as they happen!

    I have not done this process on any system other than the HomeTroller offerred by HomeSeer, but knowing a bit a about unix/Linix, I would expect them to work for most systems. This does not take into account any other software installed on the system! Anything outside Homeseer is your responsability!


    0) If you have not done so, BACKUP and SAVE your existing HomeSeer setup as discussed above!

    1) Get the source DVD. I used:

    debian-10.5.0-i386-DVD-1.iso

    From https://cdimage.debian.org/debian-cd.../i386/iso-dvd/.

    2) The use something to burn this onto a USB drive. I used Win32DiskImager. There are LOTS of options out there for this.

    3) Insert the USB drive into the system.

    4) Reboot the system into firmware. Check that the SATA interface is running in AHCI mode and not IDE.

    5) Check the bootlist. Make the USB the first boot device. And set it for the legacy boot as well.

    6) Save your changes and reboot.

    7) Install Debian:

    My main choice here was to use the whole disk as a single file system and install it with LVM. LVM makes recovery of the structures, if needed, much easier.

    I also chose not to use a network mirror.

    I created my homeseer user ID here and set the password. Write it down along with the root password!

    8) During the installation, I got a clear message that grub failed to load.

    9) Select 'Continue with no bootloader installed' and finish the install.

    10) Reboot again from the USB. Then select "Advanced Options". Then select "Graphical rescue mode".

    11) Your root file system will depend on whether you installed LVM or not. I happen to have installed LVM for some ease of management and recoverability reasons. The device I use for my root file system is:

    Code:
    /dev/mapper/homeseer--vg-root
    12) Then select "Execute a shell in /dev/mapper/homeseer--vg-root". You should have a shell prompt now.
    I personally NEVER saw the option to reinstall the GRUB boot loader in recovery mode.

    13) Generate the basic grub config file:
    Code:
    grub-mkconfig -o /boot/grub/grub.cfg
    14) Install grub:

    Code:
    grub-install /dev/sda
    The directions on fixing grub mainly came from https://www.debian.wayoflinux.com/in...reinstall-grub. Follow the details on the CLI tab please.

    15) Take out the usb drive and you should boot from the disk. Reboot!

    16) Login as homeseer and use the password you set for it.

    17) At this point, you have a lot of work still to do! First, use "su -" to get root access:

    Code:
    su -
    Enter your homeseer password.

    18) Edit /etc/group and add homeseer to the sudo group. It should look like this:

    Code:
    sudo:x:NN:homeseer
    NN will be a number. This is just the group ID. The main thing is 'sudo' is te group name and 'homeseer' is a member of the group.
    Save the file, exit root's shell, logout and login again as homeseer.

    19) As homeseer, run:

    Code:
    sudo bash
    You should be promped for your password and then have a root access bash shell. The prompt should be similar to:

    Code:
    root@homeseer:/home/homeseer#
    20) Suspend power savings! This system should NEVER suspend! Run:

    Code:
    systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target
    The output should look like:

    Created symlink /etc/systemd/system/sleep.target → /dev/null.
    Created symlink /etc/systemd/system/suspend.target → /dev/null.
    Created symlink /etc/systemd/system/hibernate.target → /dev/null.
    Created symlink /etc/systemd/system/hybrid-sleep.target → /dev/null.

    21) Fix the installation sources! If you don't do this, you will not be able to load software.

    Edit /etc/apt/sources.list to read:

    Code:
    # deb cdrom:[Debian GNU/Linux 10.5.0 _Buster_ - Official i386 DVD Binary-1 20200801-13:12]/ buster contrib main
    deb http://deb.debian.org/debian buster main contrib
    deb-src http://deb.debian.org/debian buster main contrib
    
    deb http://security.debian.org/debian-security buster/updates main contrib
    deb-src http://security.debian.org/debian-security buster/updates main contrib
    
    # buster-updates, previously known as 'volatile'
    # A network mirror was not selected during install. The following entries
    # are provided as examples, but you should amend them as appropriate
    # for your mirror of choice.
    #
    # deb http://deb.debian.org/debian/ buster-updates main contrib
    # deb-src http://deb.debian.org/debian/ buster-updates main contrib
    It is very important that you have the cdrom (really your usb drive here) Commented out!

    22) Go to the mono website and add it to your reposotories:

    Code:
    https://www.mono-project.com/download/stable/#download-lin
    Follow the directions for linux/debian and look for debian 10.

    23) Install mono-devel:

    Code:
    apt install mono-devel
    This should prompt you (Y/n) to install mono and everything it requires. Say Y.

    24) Install the Visual Basic extension for mono:

    Code:
    apt install mono-vbnc
    Without this, HomeSeer will fail to run and complain about missing Visual Basic methods.

    25) Install avahi-daemon for chromecast support:

    Code:
    apt install avahi-daemon
    26) Install unzip utilities:

    Code:
    apt install unzip
    27) Configure linux to work WITHOUT a display plugged in! Otherwise, it will hang when you attempt to boot it:

    Edit /etc/default/grub and uncomment:

    Code:
    #GRUB_TERMINAL_OUTPUT=console
    Save the file and update to grub bootloader:

    Code:
    grub-mkconfig -o /boot/grub2/grub.cfg
    grub-install /dev/sda
    I found I did not need to run grub-date like /etc/default/grub says, but I did need to run grub-mkconfig and grub-install for things to work correctly.

    28) Copy the back you made before we started to the new system. Put it in /.

    29) Restore the backup:

    Code:
    cd /
    tar -xvf HomeSeer.tar
    The files will be listed as they are restored.

    29) Update!

    Code:
    cd /
    wget https://homeseer.com/hometroller/sel/RecoverySEL.tar
    tar -xvf RecoverySEL.tar
    tar -f RecoverySEL.tar
    30) ADD startup file for homeseer.

    Create /etc/systemd/system/hs4.service to have:

    Code:
    [Unit]
    Description=HomeSeer Home Automation
    Documentation=https://homeseer.com/support-home/
    After=network-online.target remote-fs.target time-sync.target
    Before=multi-user.target
    
    [Service]
    WorkingDirectory=/opt/HomeSeer
    ExecStart=/usr/bin/mono HSConsole.exe --log
    SyslogIdentifier=HomeSeer HSx
    StandardOutput=null
    Restart=on-failure
    RestartSec=30
    KillMode=none
    TimeoutStopSec=300
    ExecStop=/opt/HomeSeer/hsstop.sh
    
    [Install]
    WantedBy=multi-user.target
    31) Make it executable:

    Code:
    chmod a+x /etc/systemd/system/hs4.service
    32) Create the shutdown file /usr/local/HomeSeer/hsstop.sh to have:

    Code:
    #!/bin/bash
    # hsstop.sh - stop the HS application
    # supports: systemd service shutdown
    
    # import login credentials used to login to web server
    # these are ignored if password not required
    inifile=$(dirname $0)/Config/$(basename $0 .sh).ini
    login=
    test -r $inifile && . $inifile
    
    # extract web server port from settings.ini
    hsroot=$(dirname $0) # where this script lives
    webport=$(awk -F= '\
    {
    gsub("\015", "") # remove CR character
    if ($1 == "gWebSvrPort") print $2
    }
    ' $hsroot/Config/settings.ini)
    
    # send application shutdown command
    for i in $(seq 1 5)
    do
    curl -f -s -o /dev/null ${login:+-u} $login --data 'ConfirmShutdownhs=Yes' "
    http://localhost:$webport/LinuxTools"
    rc=$?
    test $rc -eq 0 && break
    sleep 2
    done
    
    killmain()
    {
    test -n "$MAINPID" && kill -0 $MAINPID && kill $MAINPID
    }
    
    trap killmain EXIT
    
    # if curl cmd unsuccessful, terminate main process
    test $rc -ne 0 && killmain
    
    # wait until all HomeSeer mono processes terminate, with timeout
    maxwait=300
    polltime=5
    mono=$(which mono) || exit
    for (( t=0; t<$maxwait; t+=$polltime ))
    do
    pgrep -af $mono.'*'\(HSConsole\|HomeSeer\) || break
    sleep $polltime
    done
    33) Make it executable!

    Code:
    chmod a+x /usr/local/HomeSeer/hsstop.sh
    This was taken from https://forums.homeseer.com/forum/hs...ce-not-working

    34) Enable the hs4 service:

    Code:
    systemctl daemon-reload
    systemctl enable myservice.service
    systemctl start myservice.service



    At this point, you should see 1 or more mono processes running:

    Code:
    ps -ef | grep mono
    My ouptut is:

    Code:
    root 24271 1 2 Aug09 ? 03:49:22 /usr/bin/mono HSConsole.exe --log
    root 24319 24271 2 Aug09 ? 02:56:02 /usr/bin/mono /usr/local/HomeSeer/HSPI_Insteon.exe
    root 24352 24271 5 Aug09 ? 07:22:53 /usr/bin/mono /usr/local/HomeSeer/HSPI_Ecobee.exe
    root 24361 24271 0 Aug09 ? 00:35:54 /usr/bin/mono /usr/local/HomeSeer/HSPI_SDJHealth.exe
    You are basically done now. Please connect to your new HS4 environment from a web browser and setup your license information.

    #2
    Originally posted by Grover View Post
    To backup, run:

    Code:
    tar -xvf /tmp/HomeSeer.tar /usr/local/HomeSeer /var/www
    This will backup the entire HomeSeer installation. I am assuming you have used the default location of /usr/local/HomeSeer for the installation of the HS4 software.
    First issue I spotted...
    'tar xvf' extracts from the filename specified by the first parameter following 'f'.
    You want 'tar cvf' to create the tar file.
    HS4 Pro Edition 4.2.5.0 running on Lenovo ThinkCenter & Debian Linux
    Plugins: Z-Wave (via Nortek USB stick

    Home Assistant 2021.10.6 running on HA "Blue" ODROID-N2
    Add-ons: Android Debug Bridge, Duck DNS, ESPHome, File Editor, Glances, HA Google Drive Backup, InfluxDB, Log Viewer, MariaDB, Mosquitto broker, NGINX SSL Proxy, Node-RED, Portainer, SSH & Web Terminal, Samba, TasmoAdmin, UniFi Controller, Visual Studio Code, WireGuard, Zigbee2mqtt, Z-Wave JS to MQTT
    Integrations: AccuWeather, Alexa Media Player, Glances, Google Nest, HACS, HomeSeer, Insteon, IPP, Life360, Local IP, Logitech Harmony Hub, Mobile App, MQTT, My Garage, OpenWeather, Spotify, Tuya Local. Ubiquiti UniFi, Z-Wave JS
    Insteon: 2413S Dual Band PLM
    Zigbee: zzh! CC2652R Rev A
    Z-Wave: RaZberry daughtercard on RPi 1B via ser2net

    Comment


      #3
      dbrunt - You are correct. Fixed. Thanks!

      Comment


        #4
        Thanks for this, I'm currently running HS3 on Debian9 and haven't tried HS4 yet although I purchased it over a year ago. Maybe this weekend I will build a new Debian10 virtual machine and test your instructions. I use two Z-NET controllers, assume I have to shut down my HS3 install before HS4 connects to them? Can I go back to the HS3 setup easily or will my Z-NET's now be bound to the HS4 install? Does my HS3 license get invalidated if I activate my HS4 upgrade?

        Comment

        Working...
        X