Announcement

Collapse
No announcement yet.

Installing HS4 on Linux

Collapse
This is a sticky topic.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #31
    Originally posted by SteveW View Post

    You can start with Raspberry Pi OS's "lite" image, then install HS4 standard on top of it. Plain Debian does not have the various hardware-specific files (e.g.firmware for the Pi SOC).
    I did not stumble upon a procedure starting from Pi lite. I did find a couple that said build your own Linux then install HS4. So, am I missing anything I need, or that I can still install?

    Comment


      #32
      When I first got HS3 on Debian 8 running on a virtual machine running on QEMU (Linux, x86-64), I wrote a simple script to be able to reproduce the install.
      I've since upgraded to Debian 11 and HS4; So I decided to review this and make sure it still works.

      First, download a net install of Debian 11:
      https://www.debian.org/download

      Install the minimum requirements. Only select "SSH Server". Do not need to install desktop GUI and do not install a web server. The less the better, except for SSH server.
      If using a Z-Wave or Zigbee USB stick, you'll also need to map it to the VM by mapping the USB device on the host to the VM. (This can be done from the virtualization GUI like virt-manager on Linux or VMWare or VirtualBox).
      I started with an USB stick but then I end up installing a Z-Net because it has better range and has been solid, but cannot be used outside of HomeSeer.

      So I went over the kickstart script again, updated some bits and re-tested on a new VM. HS4 starts right away.

      Notes / Caveats:
      - If the script doesn't finish installing everything, reboot and run it again.
      - It should not break thing running it several times if this script was used to kickstart the system.
      - It also installs a serial console. If using a VM, this comes very handy because when things go wrong, I can log in via serial console, like this: "virsh console homeseer" from the host or other virsh client, without using a video console.
      - Things might change with Debian 12. We'll see then.
      - It will install the now-current version of HomeSeer and configure it as a system service.
      - to stop it from Linux, run 'systemctl stop homeseer'. 'systemctl start homeseer' for starting it again, and so on.
      - Installing Mono from the official repo takes time, be patient.

      This is somewhat rough. There are not a lot of checks, but it works.
      Run this script inside the homeseer VM, do not run it on the virtualization host, and run this as root.

      Copy this to a file called 'debian-install-homeseer.sh' (or whatever you like) and make it executable:
      chmod +x debian-install-homeseer.sh
      Attached Files

      Comment


        #33
        what's the correct way to update HS4 on linux (i'm running Debian)

        Current Version: 4.2.6.0
        Latest Release: 4.2.7.0

        i tried the Install Update... button on the Setup page, waited for the countdown, then restarted. Still on 4.2.6.0
        Mark

        HS3 Pro 4.2.19.5
        Hardware: Insteon Serial PLM | AD2USB for Vista Alarm | HAI Omnistat2 | 1-Wire HA7E | RFXrec433 | Dahua Cameras | LiftMaster Internet Gateway | Tuya Smart Plugs
        Plugins: Insteon (mine) | Vista Alarm (mine) | Omnistat 3 | Ultra1Wire3 | RFXCOM | HS MyQ | BLRadar | BLDenon | Tuya | Jon00 Charting | Jon00 Links
        Platform: Windows Server 2022 Standard, i5-12600K/3.7GHz/10 core, 16GB RAM, 500GB SSD

        Comment


          #34
          Your installation directory may be in a different location than mine, so modify these commands as appropriate. Mine is installed in /usr/local/HomeSeer

          Navigate to the directory above ../HomeSeer (e.g /usr/local)

          Get the package: sudo wget https://homeseer.com/updates4/linux_4_2_7_0.tar.gz

          Extract the package into the HomeSeer directory: sudo tar -xvf /usr/local/HomeSeer/linux_4_2_7_0.tar.gz

          Comment


            #35
            Originally posted by SteveW View Post
            Your installation directory may be in a different location than mine, so modify these commands as appropriate. Mine is installed in /usr/local/HomeSeer

            Navigate to the directory above ../HomeSeer (e.g /usr/local)

            Get the package: sudo wget https://homeseer.com/updates4/linux_4_2_7_0.tar.gz

            Extract the package into the HomeSeer directory: sudo tar -xvf /usr/local/HomeSeer/linux_4_2_7_0.tar.gz
            thanks for the info. so the Install Update button the hs Setup page doesn't work,
            Mark

            HS3 Pro 4.2.19.5
            Hardware: Insteon Serial PLM | AD2USB for Vista Alarm | HAI Omnistat2 | 1-Wire HA7E | RFXrec433 | Dahua Cameras | LiftMaster Internet Gateway | Tuya Smart Plugs
            Plugins: Insteon (mine) | Vista Alarm (mine) | Omnistat 3 | Ultra1Wire3 | RFXCOM | HS MyQ | BLRadar | BLDenon | Tuya | Jon00 Charting | Jon00 Links
            Platform: Windows Server 2022 Standard, i5-12600K/3.7GHz/10 core, 16GB RAM, 500GB SSD

            Comment


              #36
              Originally posted by mnsandler View Post

              thanks for the info. so the Install Update button the hs Setup page doesn't work,
              My memory is getting fuzzy on the history, but I believe there was a bug (mistake) that broke the update function in the version you have. It was fixed in the new version, so this was just a one-time fluke. Future upgrades using the button will work fine.

              Comment


                #37
                Yes. From around HS4 4.2.6.0, the update button has worked in Linux. Just upgrade manually to the current version and the upgrade button should be functional.

                Comment


                  #38
                  How is it possible to start the "./go" or "autostart_hs" script automatically after systemstart?

                  I have found two scripts, " go & autostart_hs" in the "HomeSeer" folder.

                  My OS is Debian 10 x64.

                  Have someone a possible solution or idea? It would also be great, if this Runs without any logins on the Console.
                  The RaspberryPi Version can do it out of the box.

                  Comment


                    #39
                    On my debian i can´t find this package "apt-get install aplay", so i used this "apt-get install alsa-utils" which includes the alsa content.

                    Comment


                      #40
                      I remember from /HomeSeer/bin/homeSeer/ folder that there is a FFmpeg binary . I do not remember how old it is . I guess for tts it is enough

                      Comment


                        #41
                        Anyone know why I can't shutdown Homeseer from the Linux Tools Menu?
                        Every time I try it automatically restarts.
                        Here's my start/stop files:

                        Code:
                        [B]homeseer.service[/B]
                        
                        [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/stop_homeseer.sh
                        
                        [Install]
                        WantedBy=multi-user.target
                        
                        [B]stop_homeseer.sh[/B]
                        
                        #!/bin/bash
                        /usr/bin/curl --user root:xxxx 'http://127.0.0.1/LinuxTools' -H 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8' --data 'ConfirmShutdownhs=Yes' --compressed
                        while pgrep -f mono -U homeseer > /dev/null; do sleep 2; echo Waiting for HomeSeer to stop; done

                        Comment


                          #42
                          Originally posted by Demusman View Post
                          Anyone know why I can't shutdown Homeseer from the Linux Tools Menu?
                          Every time I try it automatically restarts.
                          Here's my start/stop files:
                          ...
                          The wait loop in you stop_homeseer.sh isn't effective; although that doesn't come into play when shutting down from the menu.

                          To fix, replace the last line with:
                          Code:
                          # 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

                          To investigate your issue, run this command to capture syslog output, then run the shutdown from the menu.
                          Code:
                          tail -f /var/log/syslog
                          The service is set to restart on failure, thus if the main process is exiting with an error it would probably display the symptom you're seeing.

                          On my HS4 test system, these syslog entries are displayed a few seconds after confirming the shutdown
                          Code:
                          Feb 18 13:56:09 HS4Pro systemd[1]: homeseer.service: Succeeded.
                          Feb 18 13:56:09 HS4Pro systemd[1]: homeseer.service: Consumed 2min 49.075s CPU time.

                          Comment


                            #43
                            Originally posted by zwolfpack View Post

                            To investigate your issue, run this command to capture syslog output, then run the shutdown from the menu.
                            Code:
                            tail -f /var/log/syslog
                            The service is set to restart on failure, thus if the main process is exiting with an error it would probably display the symptom you're seeing.

                            On my HS4 test system, these syslog entries are displayed a few seconds after confirming the shutdown
                            Code:
                            Feb 18 13:56:09 HS4Pro systemd[1]: homeseer.service: Succeeded.
                            Feb 18 13:56:09 HS4Pro systemd[1]: homeseer.service: Consumed 2min 49.075s CPU time.
                            I keep getting "Control process exited, code=exited, status=203/EXEC"
                            So I moved the stop script to /usr/bin/ and changed the start script to reflect that in ExecStop, thinking it was a permission issue.
                            No luck there either but now I'm also getting "homeseer.service: Failed to execute command: No such file or directory"
                            Is that referring to the stop script??


                            Code:
                            Feb 19 08:49:41 homeseer systemd[1306]: homeseer.service: Failed to execute command: No such file or directory
                            Feb 19 08:49:41 homeseer systemd[1306]: homeseer.service: Failed at step EXEC spawning /usr/bin/stop_homeseer.sh: No such file or directory
                            Feb 19 08:49:41 homeseer systemd[1]: homeseer.service: Control process exited, code=exited, status=203/EXEC
                            Feb 19 08:49:41 homeseer systemd[1]: homeseer.service: Failed with result 'exit-code'.
                            Feb 19 08:50:11 homeseer systemd[1]: homeseer.service: Scheduled restart job, restart counter is at 1.
                            Feb 19 08:50:11 homeseer systemd[1]: Stopped HomeSeer Home Automation.
                            Feb 19 08:50:11 homeseer systemd[1]: Started HomeSeer Home Automation.
                            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/bin/stop_homeseer.sh
                            
                            [Install]
                            WantedBy=multi-user.target

                            Comment


                              #44
                              You didn't need to move the script to /usr/bin, that won't make any difference.

                              The message
                              Code:
                              homeseer.service: Failed at step EXEC spawning /usr/bin/stop_homeseer.sh: No such file or directory
                              indicates either /usr/bin/stop_homeseer.sh isn't accessible, or that something within it isn't accessible.

                              Does the stop_homeseer.sh script have executable permissions set? Run
                              Code:
                              chmod +x stop_homeseer.sh
                              to set those.

                              Did you make changes I suggested to the stop_homeseer.sh script? What are it's current contents?

                              If you make changes to the homeseer.service unit file, run
                              Code:
                              sudo systemctl daemon-reload
                              to reread the file.

                              Comment


                                #45
                                It is executable.

                                I did not make any changes to it yet.
                                You said that wouldn't have any effect on it so I didn't want to change too many things at once.

                                Comment

                                Working...
                                X