Announcement

Collapse
No announcement yet.

Installing HS4 on Linux

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

    #61
    The archive with name starting 'hs4_sel' is a "patch" version; the one starting with 'linux' is a "full" version.

    The full version is organized such that when unwound, it creates a HomeSeer folder and puts everything in that. You perform the unarchive from the folder above, e.g. /usr/local.

    The patch version is organized such that you unwind it from within the HomeSeer folder itself (/usr/local/HomeSeer).
    To illustrate, list the first few entries of each archive:
    Code:
    tar taf linux_4_2_14_0.tar.gz | head
    tar taf hs4_sel_4_2_14_0.tar.gz | head
    Results of the full archive:
    Code:
    HomeSeer/
    HomeSeer/install.sh
    HomeSeer/temp/
    HomeSeer/run_command_raw.sh
    HomeSeer/hs_sentry.log
    HomeSeer/play_audio.sh
    HomeSeer/updatehslinux.sh
    HomeSeer/autostart_hs
    HomeSeer/run_command.sh
    HomeSeer/Grammar/
    Note HomeSeer/ at the start of each entry.

    For the patch archive
    Code:
    autostart_hs
    bin/
    bin/homeseer/
    bin/homeseer/PluginSdk.xml
    bin/homeseer/Mono.CSharp.dll
    bin/homeseer/Newtonsoft.Json.xml
    bin/homeseer/ffmpeg
    bin/homeseer/Newtonsoft.Json.Schema.dll
    bin/homeseer/Mail.dll
    bin/homeseer/RssToolkit.dll
    The two archives are virtually the same size. In the past (HS3), the patch versions were significantly smaller, and contained only files that had changed at some point. Nowadays with larger disk sizes, they probably decided it easier/more reliable to include everything with the patch. The extra 300 or so bytes is likely the (compressed) additional 'HomeSeer' path components for each file.

    Regarding your updater issue --- are you using an auto-start method? One of the auto-start methods published on the forum has been shown to break the updater - discussion/solution here: https://forums.homeseer.com/forum/hs...d-as-a-service

    Comment


      #62
      Thanks for the info. I am using systemd to auto start, so I will look into the linked thread.

      Comment


        #63
        Thanks to all the help in this thread I was able to retire my HS4-Pi edition and move it to LXC (Linux Containers) on a Linux (Debian) server. The instructions, if any one else wants to try this, are here: https://megascope.github.io/notes/homeseer_lxc.html

        Comment


          #64
          Any good place to start troubleshooting for a Homeseer.service that won't start? I initially installed on Ubuntu 22.04 and it ran fine for months. I took an Ubuntu update and now everything is crap. Is there a troubleshooting page for just Ubuntu users?

          Comment


            #65
            Did you use the 32 or 64 bit version? Would be great to be able to use the 64bit version as I have the 8gb version of the rpi4. Do you see any issues with attempting the 64 bit?

            Comment


              #66
              Originally posted by Bugman1400 View Post
              Any good place to start troubleshooting for a Homeseer.service that won't start? I initially installed on Ubuntu 22.04 and it ran fine for months. I took an Ubuntu update and now everything is crap. Is there a troubleshooting page for just Ubuntu users?
              If you check the status what does it say?

              sudo systemctl status homeseer

              Comment


                #67
                Originally posted by Demusman View Post

                If you check the status what does it say?

                sudo systemctl status homeseer
                It says "Unit homeseer.service could not be found."

                Comment


                  #68
                  Does the file still exist?
                  Are the permissions set correctly?

                  Comment


                    #69
                    Originally posted by Demusman View Post
                    Does the file still exist?
                    Are the permissions set correctly?
                    I don't think file exists, but at this point I may looking to do a fresh install. What's weird is that the Events all seem to still work so, some kind of service running. Is there a way to save the Devices and the Events to import back in after the fresh install?

                    Comment


                      #70
                      If the file doesn't exist a fresh install won't create it. It's a file you have to make yourself.
                      As for saving the devices/events, that's what the backup feature does. Or you can just copy the whole HomeSeer folder.
                      I don't think you need to do a fresh install though.

                      Comment


                        #71
                        Originally posted by Demusman View Post
                        If the file doesn't exist a fresh install won't create it. It's a file you have to make yourself.
                        As for saving the devices/events, that's what the backup feature does. Or you can just copy the whole HomeSeer folder.
                        I don't think you need to do a fresh install though.
                        Can you tell me more about creating the file or point me to the list of terminal commands that I need to enter?

                        Any info is greatly appreciated.

                        Comment


                          #72
                          Assuming you use nano for text editor...

                          sudo nano /etc/systemd/system/homeseer.service

                          Paste the following into it, make sure you make any changes needed like directory of your install.

                          Code:
                          [Unit]
                          Description=HomeSeer HS4 Home Automation Server
                          After=network-online.target remote-fs.target time-sync.target
                          Before=multi-user.target
                          
                          [Service]
                          WorkingDirectory=/usr/local/HomeSeer
                          ExecStart=/usr/bin/mono /usr/local/HomeSeer/HSConsole.exe --log
                          SyslogIdentifier=HomeSeer HS4
                          StandardOutput=null
                          Restart=on-failure
                          RestartSec=30
                          KillMode=none
                          TimeoutStopSec=300
                          ExecStop=/usr/local/HomeSeer/stop_homeseer.sh
                          
                          [Install]
                          WantedBy=multi-user.target​
                          save the file.
                          then:

                          sudo chmod 777 /etc/systemd/system/homeseer.service
                          ​sudo systemctl start homeseer
                          sudo systemctl enable homeseer

                          If you want to stop homeseer it would be:

                          sudo systemctl stop homeseer

                          But this will rely on a stop file.
                          I use:

                          Code:
                          #!/bin/bash
                          /usr/bin/curl --user root:<<password>> 'http://127.0.0.1/LinuxTools' -H 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8' --data 'ConfirmShutdownhs=Yes' --compressed
                          sleep 10s​
                          If you already have a stop file then it needs to be referenced in the start file above in the ExecStop field.

                          Comment


                            #73
                            HST Linux installation documentation doesn't provide guidance on how to do automatic startup. So if your previous install auto-starts, its most likely a customization of your own doing.

                            There are several methods that can be used for auto start. The two most common are

                            1) start via a systemd service. This is the "preferred" (most modern) method from a Linux standpoint.

                            2) start from /etc/rc.local. This is how HST does it in the units they sell. This method is considered deprecated, but it still works, and may be the easiest to implement.

                            First step I'd recommend is checking your /etc/rc.local file to see if you're starting it from there.

                            WRT to systemd service files, note that the service name can be whatever you like. A lot of folks use "homeseer.service", but could also be "Homeseer.service", "HomeSeer.service", "HS4.service", etc., etc. Names are case sensitive, so if yours is Homeseer.service, the command "systemctl status homeseer" isn't going to find it.

                            Comment


                              #74
                              Originally posted by Demusman View Post
                              Assuming you use nano for text editor...

                              sudo nano /etc/systemd/system/homeseer.service

                              Paste the following into it, make sure you make any changes needed like directory of your install.

                              Code:
                              [Unit]
                              Description=HomeSeer HS4 Home Automation Server
                              After=network-online.target remote-fs.target time-sync.target
                              Before=multi-user.target
                              
                              [Service]
                              WorkingDirectory=/usr/local/HomeSeer
                              ExecStart=/usr/bin/mono /usr/local/HomeSeer/HSConsole.exe --log
                              SyslogIdentifier=HomeSeer HS4
                              StandardOutput=null
                              Restart=on-failure
                              RestartSec=30
                              KillMode=none
                              TimeoutStopSec=300
                              ExecStop=/usr/local/HomeSeer/stop_homeseer.sh
                              
                              [Install]
                              WantedBy=multi-user.target​
                              save the file.
                              then:

                              sudo chmod 777 /etc/systemd/system/homeseer.service
                              ​sudo systemctl start homeseer
                              sudo systemctl enable homeseer

                              If you want to stop homeseer it would be:

                              sudo systemctl stop homeseer

                              But this will rely on a stop file.
                              I use:

                              Code:
                              #!/bin/bash
                              /usr/bin/curl --user root:<<password>> 'http://127.0.0.1/LinuxTools' -H 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8' --data 'ConfirmShutdownhs=Yes' --compressed
                              sleep 10s​
                              If you already have a stop file then it needs to be referenced in the start file above in the ExecStop field.
                              Oddly enough, when I tried to enable homeseer, I get the following error message...
                              sudo systemctl enable homeseer
                              Failed to enable unit: "multi-user.target​" is not a valid unit name.

                              ​Also, is there a reason why I'd be getting this....

                              sudo service homeseer status
                              ● homeseer.service - HomeSeer HS4 Home Automation Server
                              Loaded: loaded (/etc/systemd/system/homeseer.service; disabled; vendor preset: enabled)
                              Active: activating (auto-restart) (Result: exit-code) since Sun 2023-03-26 09:30:37 EDT; 8s ago
                              Process: 12924 ExecStart=/usr/bin/mono /Home/Public/HomeSeer/HSConsole.exe --log (code=exited, status=200/CHDIR)
                              Main PID: 12924 (code=exited, status=200/CHDIR)
                              CPU: 1ms


                              Comment

                              Working...
                              X