Announcement

Collapse
No announcement yet.

Installing HS4 on Linux

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

    Installing HS4 on Linux

    HS4 for Linux is a modified version of HS4 that runs under Linux. It is full HS4 with the following exceptions:

    * No VBScript support (.txt scripts). VB.Net scripting and C# scripting is supported

    HS4 for Linux does not require a distinct license. Your HS4 standard, HS4 SEL/Plus, or PRO license will work, though note that you can only use one license per installation.

    Linux can be a challenge for non-technical users, the Linux version of HS4 is targeted to the more technical user.

    It has been tested under Debian and Ubuntu.

    These instructions are for a Debian 7 install.
    1. Install Debian or Ubunutu per it's instructions. Ubuntu on WIndows 10 will also work.
    2. Install the following packages that are required by HS4:
      Note that MONO is required, but it is already installed with the Debian distribution. However, a few packages are missing:
      apt-get install mono-devel
      apt-get install mono-vbnc
      apt-get install flite
      apt-get install chromium-browser
      apt-get install aha
      apt-get install ffmpeg
      apt-get-install aplay
    3. If brltty is installed, this must be removed in order for a Z-Stick to work:
      apt-get remove brltty
    4. Download the latest HS4 tar file, latest release can be found here:https://docs.homeseer.com/display/HSPI/Release+Notes
    5. Download the latest "Linux Standard" tar file.
    6. Change directory to where you want to install it.
      Our default is:ch /usr/local
    7. untar with the command:
    8. tar xvf tar_filename
    9. Change directory into the newly created HomeSeer folder:
      cd HomeSeer
    10. Run HS4 using the "go" script:
      ./go

    Note that HS4 needs to run as root or with sudo (script uses sudo). This is because it listens on a port for the web server and MONO requires root to do this.

    Check the startup log for errors. If all is ok, you can access the web interface on a browser by accessing the IP address if the Linux system with:

    http://IP_ADDRESS

    By default, HS4 starts listening on port 80. If you happen to have the Apache web server installed port 80 may be in use. You can edit the HS4 config file in Config/settings.ini and change the setting:

    gWbSvrPort=80

    To a different port, then restart HS4.

    You can shut down HS4 from the console by hitting enter to get a prompt and then entering: shutdown
    Last edited by Rupp; November 17, 2021, 11:13 PM.
    website | buy now | support | youtube

    #2
    If you want aspx page to load ok on Linux :

    1. Ssh into hs4 box.

    2. Type this :

    Code:
    sudo nano /usr/bin/vbnc
    3. Remove every thing here and paste this:

    Code:
    #!/bin/bash
    exec /usr/bin/mono --gc-params=nursery-size=64m $MONO_OPTIONS /usr/lib/mono/4.5/vbc.exe "$@"
    So it'll look like in the picture.

    4. Press ctrl+o to save then hit enter.

    5. Press ctrl+z to leave nano.
    Attached Files

    Comment


      #3
      From my limited knowledge, the requirement for root when opening ports is only for "well known" ports, < 1024.

      If you set the configuration to open a high port, say 8080 or 9443, would that not allow running as a non root user?

      Comment


        #4
        Originally posted by Fellhahn View Post
        From my limited knowledge, the requirement for root when opening ports is only for "well known" ports, < 1024.

        If you set the configuration to open a high port, say 8080 or 9443, would that not allow running as a non root user?
        Yes. HS with non root user with high port works fine. never had any problems.

        Comment


          #5
          On Ubuntu 20.04.1 LTS

          sudo apt-get install aplay
          Reading package lists... Done
          Building dependency tree
          Reading state information... Done
          E: Unable to locate package aplay



          Comment


            #6
            Originally posted by rjh View Post

            By default, HS4 starts listening on port 80. If you happen to have the Apache web server installed port 80 may be in use. You can edit the HS4 config file in Config/settings.ini and change the setting:

            gWbSvrPort=80

            To a different port, then restart HS4.

            You can shut down HS4 from the console by hitting enter to get a prompt and then entering: shutdown
            I do have apache installed with port 80 in use. I did edit Config/settings.ini.

            There was no line such as gWbSvrPort=80, so i added it under [Settings] then saved.

            Upon restart I still get "02:22:41:5364:[Web Server]->Web Server started on port 80".

            Please note this is also a typographic error, the command should be gWebSvrPort=##.

            Comment


              #7
              For what it's worth, I have Homeseer4 running in docker successfully.

              I'm using this image: https://hub.docker.com/r/e1ite/docker-homeseer4

              And here's my docker compose

              Code:
              version: "3"
              services:
                homeseer:
                  container_name: homeseer
                  image: e1ite/docker-homeseer4:latest
                  restart: unless-stopped
                  ports:
                    - 9898:80    # remap homeseer port to 9898 since 80 is taken by Traefik reverse proxy
                    - 10200:10200
                    - 10300:10300
                    - 10401:10401
                    - 11000:11000
                  devices:
                    - /dev/ttyUSB0:/dev/ttyUSB0 # Zwave
                    - /dev/ttyUSB1:/dev/ttyUSB1 # Zigbee
                  volumes:
                    - "/mnt/docker/homeseer:/HomeSeer"
                    - "/etc/localtime:/etc/localtime:ro"
                  networks:
                    - infrastructure
              
              networks:
                infrastructure:
                  external: true
              The only issues that I have run into is that if its run in host/bridge mode, it can't see certain kinds of network devices, like Sonos. However if I run it in macvlan mode so it gets its own IP, it can't access the HS store.

              Still working on that issue. Have it running in host/bridge most for right now.

              The other issue is that Homeseer's basic auth doesn't play well with reverse proxies. Trying to figure out a way to disable it or get http forward auth working. I don't believe this is an issue limited to docker though

              Comment


                #8
                couple of question regarding the installation:

                apt-get install mono-devel
                apt-get install mono-vbnc

                For HS3 I used
                apt-get install -y mono-vbnc
                apt-get install -y mono-xsp4 (used to run ASP.NET 4.0 applications)
                This was good enough. Isn't installing mono-devel a little bit of an overkill?

                apt-get install aha
                from the description: reads the Input from a file or stdin and writes HTML-Code to stdout.
                Where is this used? I haven't used this for HS3

                apt-get-install aplay
                from the description: command line playback and recording
                Is this used for the tts same as flite?

                Comment


                  #9
                  Hi,

                  I use below "homeseer.service" for shutting down gracefully. Found elsewhere on the forum :

                  Code:
                  [Unit]
                  Description=HomeSeer HS3 Home Automation Server
                  After=network.target
                  
                  [Service]
                  WorkingDirectory=/opt/HomeSeer
                  ExecStart=/usr/bin/mono /opt/HomeSeer/HSConsole.exe --log
                  ExecStop=/opt/HomeSeer/stop_homeseer.sh
                  Restart=on-failure
                  TimeoutStopSec=90
                  
                  [Install]
                  WantedBy=multi-user.target
                  and the "stop_homeseer.sh":

                  Code:
                  #!/bin/bash
                  sudo /usr/bin/curl 'http://127.0.0.1/LinuxTools' -H 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8' --data 'ConfirmShutdownhs=Yes' --compressed
                  sleep 10s
                  Michel.

                  Comment


                    #10
                    Originally posted by GeekyDaddy
                    This is my installation method, then use my startup method in the previous post.
                    Code:
                    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_1_9_0.tar.gz -O homeseer.tar.gz
                    tar xvzf homeseer.tar.gz -C /opt
                    I keep getting this error when entering your installation commands.

                    pi@PI4HS4:~$ apt-get -y install mono-devel mono-vbnc flite chromium-browser aha ffmpeg alsa-base alsa-utils
                    E: Could not open lock file /var/lib/dpkg/lock-frontend - open (13: Permission denied)
                    E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), are you root?

                    I am root as the $ tells me.
                    Anyone know what the heck I am doing wrong?

                    Comment


                      #11
                      root gets a '#" prompt. '$' tells you you're not root.
                      Assuming you have sudo rights, prefix each of those commands with 'sudo' and you should be off to the races.

                      Comment


                        #12
                        Thanks for the help. I think I will just stick with the pi version of the HS.

                        Comment


                          #13
                          You're trying to connect securely: https://192.168.1.17
                          Try instead non-secure: http://192.168.1.17

                          Comment


                            #14
                            Is chromium (the browser) really needed for a homeseer runing as a daemon? When I did a test upgrade of HS3 to HS4 on ubuntu 18.04, that machine didn't have chromium (or anything GUI) installed on it, and HS4 appeared to work just fine.

                            The reason for not installing the chromium browser is to keep a LOT of x11 bloat off the system.

                            A similar argument could be made for not installing ffmpeg, though there are builds of ffmpeg that aren't dependent on x11. (or you could just compile your own.)

                            Edit: I just finished re-doing my HS4 linux machine (replaced the SSD drive, installed ubuntu server 20.04, removed a ton of ubuntu bloat, and then copied over my homeseer install from my previous ubuntu 18.04 machine.) I did NOT install chromium-browser and HS4 appears to work just fine.
                            Last edited by garyd9; November 18, 2021, 09:18 PM. Reason: editing on results of a 'new' ubuntu 20.04 headless machine

                            Comment


                              #15
                              Originally posted by garyd9 View Post
                              Is chromium (the browser) really needed for a homeseer runing as a daemon?
                              No ... its another enduring mystery why HST lists that as a requirement.

                              Comment

                              Working...
                              X