Announcement

Collapse
No announcement yet.

Fresh Install - Instructions Tutorials ?

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

    Fresh Install - Instructions Tutorials ?

    So I have HS3 installed on a Pi right now that I installed myself a couple years ago. It has been running fine but I have been thinking about upgrading (own the software). The last time I did it I could never get the auto-start to ever work and anytime the power went out I had to manually start everything back up.

    Seeing if anyone has a location to point me to to read up on the steps for a clean install. I would completely wipe the current system and just start over since I have a better idea of what I want this time around for automation and such that I never took the time to setup with HS3.

    I am fairly rusty when it comes to Linux as well but I will dig in to read up on it as I go down this path.

    #2
    HOMESEER _ LINUX INSTALL

    # | apt-get -y install mono-devel mono-vbnc flite chromium-browser aha ffmpeg alsa-base alsa-utils
    # | apt-get -y remove brltty

    # | wget https://homeseer.com/updates4/linux_4_2_5_0.tar.gz -O homeseer.tar.gz


    /usr/local/

    # | sudo tar xvzf homeseer.tar.gz -C /usr/local


    AUTO STRAT (HOMESEER-LINUX)

    # | sudo nano homeseer.service

    Insert... |
    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=/usr/local/HomeSeer
    ExecStart=/usr/bin/mono HSConsole.exe --log
    SyslogIdentifier=HSConsole
    StandardOutput=null
    Restart=on-failure
    RestartSec=30
    KillMode=none
    TimeoutStopSec=300
    ExecStop=/usr/local/HomeSeer/hsstop.sh
    
    [Install]
    WantedBy=multi-user.target
    Then

    # | sudo systemctl daemon-reload



    EDITING THE STOP SCRIPT

    # | sudo nano /usr/local/HomeSeer/hsstop

    Insert... |

    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
    curl -f -s -o /dev/null ${login:+-u} $login --data 'action=shutdown_hs' "http://localhost:$webport/system.html"
    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 -afi $mono.'*'\(HSConsole\|HSPI_\) || break
    sleep $polltime
    done
    THEN MAKE IT EXECUTABLE... |

    # | sudo chmod +x /usr/local/HomeSeer/hsstop.sh




    Note : Credits go out to zwolfpack and other helpful board members who have provided those scripts over time




    Eman.


    TinkerLand : Life's Choices,"No One Size Fits All"

    Comment


      #3
      I got this after the executable command.

      pi@PI4HS4:~$ cd /usr/local
      pi@PI4HS4:/usr/local$ sudo nano homeseer.service
      [sudo] password for pi:
      pi@PI4HS4:/usr/local$ sudo systemctl daemon-reload
      pi@PI4HS4:/usr/local$ sudo nano /usr/local/HomeSeer/hsstop
      pi@PI4HS4:/usr/local$ sudo chmod +x /usr/local/HomeSeer/hsstop.sh
      chmod: cannot access '/usr/local/HomeSeer/hsstop.sh': No such file or directory
      pi@PI4HS4:/usr/local$

      Looks like something did not save correctly?

      Comment


        #4
        I am a little confused with the instructions...

        Where should the homeseer.service file be placed?

        Do you also need to do the following:

        sudo systemctrl enable homeseer.service

        Thanks!

        Comment

        Working...
        X