Announcement

Collapse
No announcement yet.

Help with HS4 in Docker on a Synology NAS

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

    Help with HS4 in Docker on a Synology NAS

    I have a synology NAS and am new to Docker. I'm hoping someone can help me.

    I have downloaded @e1ite 's image and have been able to get it running within Docker on my Synology NAS.

    However, I am not sure how to access it now. When I click the link that was generated on the Synology desktop, it shows me an overview of the container itself. When I try to access it via the NAS IP and the assigned local port (for example 192.168.1.5:32797 - because 32797 was assigned to port 80) I get an error message stating "This page isn't working."

    What have I missed? How can i best troubleshoot this?

    I appreciate your help!

    Ed

    #2
    You could start from scratch with this image I updated this morning (not tested though). I find using macvlan and assigning an IP to your container works better (don't have to worry about ports). Here's how to do it.

    Ssh into your DiskStation
    Code:
    ssh -p SSH-PORT admin@SYNO-IP
    Then
    Code:
    sudo -i
    Then run the following substituting your subnet and gateway IP with yours. Assuming your router IP is 192.168.1.1 within the 192.168.1.0 subnet. This will allow creation of a Docker container with its own IP within your subnet.

    Code:
    docker network create -d macvlan --subnet=192.168.1.0/24 --gateway=192.168.1.1 -o parent=eth0 pub_net
    Get the latests image by doing this:
    Code:
    docker pull fastfreddi/ubuntu-baseimage-homeseer:latest
    Then run this command, while substituting the ip for the address that you wish your Docker Container to have within your subnet (I put in 192.168.1.6, you may have to adjust router setting to reserve this IP). The device=/dev/ttyACM0:/dev/ttyACM0 is what my z-wave show up as, make sure your device show up as this or adjust as needed. You can add what ever other USB device you might be using that you hope to make visible to the container.

    Code:
    [COLOR=#000000][FONT=Courier New][FONT=Courier][COLOR=#111111]docker run -d \[/COLOR][/FONT][/FONT][/COLOR]
    [COLOR=#000000][FONT=Courier New][FONT=Courier][COLOR=#111111]--net=pub_net --ip=192.168.1.6 \[/COLOR][/FONT][/FONT][/COLOR]
    [COLOR=#000000][FONT=Courier New][FONT=Courier][COLOR=#111111]--device=/dev/ttyACM0:/dev/ttyACM0 \[/COLOR][/FONT][/FONT][/COLOR]
    [COLOR=#000000][FONT=Courier New][FONT=Courier][COLOR=#111111]--name=Syno-HomeSeer --restart unless-stopped \[/COLOR][/FONT][/FONT][/COLOR]
    [COLOR=#000000][FONT=Calibri][FONT=Courier][COLOR=#111111]-v /etc/localtime:/etc/localtime:ro \[/COLOR][/FONT][/FONT][/COLOR]
    [COLOR=#000000][FONT=Courier New][FONT=Courier][COLOR=#111111]fastfreddi/ubuntu-baseimage-homeseer:latest[/COLOR][/FONT][/FONT][/COLOR]
    The docker run command is only used to create the container. Do not use docker run again after. After that you want to use docker start Syno-HomeSeer or docker stop Syno-HomeSeer.

    I think I remembered everything!


    To access and change things within the container:

    Code:
    docker exec -it Syno-HomeSeer /bin/bash

    To update the HomeSeer version, ssh into Synology and run (with sudo or root)(just substitute 4_1_10_0 with the version you want:
    (this assumes the file format from HomeSeer is still https://homeseer.com/updates4/linux_4_1_9_0.tar.gz)

    Code:
    sudo docker exec -i Syno-HomeSeer bash upgrade 4_1_10_0
    Then open Task Scheduler in Synology GUI.

    Create a triggered task called: HomeSeer Start
    Select user “root”
    Choose event: Boot-up
    Then in task settings, type: docker start Syno-HomeSeer

    Create a triggered task called: HomeSeer Stop
    Select user “root”
    Choose event: Shutdown
    Then in task settings, type: docker stop Syno-HomeSeer

    Enable both tasks and save settings.

    To access the web interface the first time, type in your browser you IP with /register.html to get things going:

    Code:
    http://192.168.1.6/register.html

    Comment


      #3
      Ok I've tested the image, seems to work, however there's an issue with HomeSeer not shutting down properly with the container. I will troubleshoot and correct the issue.

      Comment


        #4
        Ok, I've made some changes to the Docker image to deal with proper shutdown of HomeSeer both from within the container and with the docker stop command. The instructions above have been updated with a different docker run command to ensure proper supervisor function in the container.

        Comment


          #5
          Originally posted by FastFreddi View Post
          Ok, I've made some changes to the Docker image to deal with proper shutdown of HomeSeer both from within the container and with the docker stop command. The instructions above have been updated with a different docker run command to ensure proper supervisor function in the container.
          WOW! Thanks so much for all of your work on this. Amazing! I will give this a shot as soon as I can and let you know how I do. I may have a few questions along the way as I am just learning, so please bear with me. Thanks again!

          Ed

          Comment


            #6
            No problem. If you want to wait, there's one more change to implement to facilitate updates to HomeSeer.

            Comment


              #7
              Originally posted by FastFreddi View Post
              No problem. If you want to wait, there's one more change to implement to facilitate updates to HomeSeer.
              where do I find your image? and what would teh difference be in using your image vs. e1ite 's? Thanks again!

              ***Never mind! I just saw the Pull command!***
              But what what would the difference be in using your image vs. e1ite 's? Thanks again!

              Comment


                #8
                I suspect the guys working on e1ite put more work in it than me. I originally created this image specifically for Synology 4 years ago, at the time had to use a custom version of Docker which was impractical. The biggest difference between both images that I can see is that mine use Ubuntu Base Image which uses Runit as the supervisor process. e1ite uses a Mono base image with S6 overlay as the supervisor process. Ultimately both should use about the same amount of ressources. Mine gracefully shuts down HomeSeer, whereas e1ites does not. You could run the e1ite image with macvlan described above if you wanted. The macvlan way is better than using the net=host or specifying individual ports as it provides the container with its own IP on your network.

                Comment


                  #9
                  Ok just building new image now with upgrade script built-in. I'll edit post #2 with instructions.

                  Comment


                    #10
                    Originally posted by FastFreddi View Post
                    Ok just building new image now with upgrade script built-in. I'll edit post #2 with instructions.
                    Thanks a lot FastFreddi - your tag is very appropriate - you are fast!

                    Ed

                    Comment


                      #11
                      Very happy to have found this thread and that it's as fresh as can be. I was running HS3 on Synology for a number of years and decided it was time to move to HS4 in order to gain support for Hue natively. I have a couple tweaks to do still and will report back once I have any relevant notes.

                      I did want to extend my thanks to FastFreddi for the contribution in this space. HS on Docker is super light weight and works like a charm for HS3 and HS4. I don't see the need to run on Windows as I do not have a need for the additional features gained with HS running on Windows. The only down side is if you every have a need to contact support, it's a bit of a barrier to gain traction when you are not on physical.

                      Comment


                        #12
                        What Synology NAS are you running HS4 on? I'm looking at DS812s right now, wondering if they're powerful enough (I'm sure they would be, heck I'm running HomeSeer on a Pi4 right now).

                        Comment


                          #13
                          I just found this thread today, and gave it a go. So now I am up running HS4 in Docker on Synology. I got DEconz running in another container with a Conbee USB Zigbee stick. Works fine with JowiHue plugin, it connects to DEConz with no issues. All Zigbee devices immediately found and working.
                          Then I installed the AK Shelly plugin to contol all my Shelly devices from HS4. End of joy, and I am stuck. The plugin crashes and restarts in a loop.
                          Could there be something missing in the Docker image?

                          Here are the log lines from AK Shelly:
                          ----------------------------------------------
                          10/12/2023 20:16:59 HomeSeer Warning I/O interface AK Shelly is down, executable is not running, restarting ...
                          10/12/2023 20:16:51 HomeSeer Info Plugin AK Shelly with ID: AKShelly and Instance: has disconnected
                          10/12/2023 20:16:51 AK Shelly Warning Mono.Unix.UnixIOException: ###
                          10/12/2023 20:16:51 AK Shelly Warning Inner Exception(1): No such file or directory [ENOENT].
                          10/12/2023 20:16:51 AK Shelly Warning System.IO.FileNotFoundException: ### ---> Mono.Unix.UnixIOException: ### [ENOENT].
                          at: Mono.Unix.UnixMarshal.ThrowExceptionForLastError () [0x00005] in :0
                          at: Mono.Unix.UnixMarshal.ThrowExceptionForLastErrorIf (System.Int32 retval) [0x00007] in :0
                          at: NDesk.DBus.Transports.UnixSocket.Connect (System.Byte[] remote_end) [0x00011] in :0
                          at: NDesk.DBus.Transports.UnixNativeTransport.OpenUnix (System.String path) [0x00060] in :0
                          at: NDesk.DBus.Transports.UnixNativeTransport.Open (System.String path, System.Boolean abstract) [0x0002a] in :0
                          at: NDesk.DBus.Transports.UnixTransport.Open (NDesk.DBus.AddressEntry entry) [0x00040] in :0
                          at: NDesk.DBus.Transports.Transport.Create (NDesk.DBus.AddressEntry entry) [0x00041] in :0
                          at: NDesk.DBus.Connection.OpenPrivate (System.String address) [0x00033] in :0
                          at: NDesk.DBus.Connection..ctor (System.String address) [0x00075] in :0
                          at: NDesk.DBus.Bus..ctor (System.String address) [0x00007] in :0
                          at: NDesk.DBus.Bus.Open (System.String address) [0x00031] in :0
                          at: Mono.Zeroconf.Providers.AvahiDBus.DBusManager.ConnectToSyste mBus () [0x0001e] in :0
                          at: Mono.Zeroconf.Providers.AvahiDBus.DBusManager.IterateThread (System.Object o) [0x00013] in :0
                          at: System.Threading.QueueUserWorkItemCallback.WaitCallback_Cont ext (System.Object state) [0x0000e] in :0
                          at: System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x0008d] in :0
                          at: System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00000] in :0
                          at: System.Threading.QueueUserWorkItemCallback.System.Threading. IThreadPoolWorkItem.ExecuteWorkItem () [0x0002a] in :0
                          at: System.Threading.ThreadPoolWorkQueue.Dispatch () [0x00096] in :0
                          at: System.Threading._ThreadPoolWaitCallback.PerformWaitCallback () [0x00000] in :0
                          10/12/2023 20:16:51 AK Shelly Error FileNotFoundException - UnhandledException!!!: No such file or directory
                          10/12/2023 20:16:34 AK Shelly Trace Finished AfterUpdate() 87 ms
                          10/12/2023 20:16:34 AK Shelly Trace Finished Update() 28 ms
                          10/12/2023 20:16:30 HomeSeer Info Done rebuild of device references cache
                          10/12/2023 20:16:30 HomeSeer Info Starting rebuild of device references cache...
                          10/12/2023 20:16:29 HomeSeer Starting Plug-In Plugin AK Shelly started successfully in 295 milliseconds
                          10/12/2023 20:16:29 AK Shelly Info 10/12/2023 8:16:29 PM AK Shelly ver. 4.0.5.24 (4.0.5.154)
                          10/12/2023 20:16:29 HomeSeer Starting Plug-In Initializing plugin AK Shelly ...
                          10/12/2023 20:16:28 HomeSeer Starting Plug-In AK Shelly loaded in 15014 milliseconds
                          10/12/2023 20:16:14 HomeSeer Info Plugin AKShelly with instance AK Shelly has connected. IP:127.0.0.1:33012​

                          Thanks!

                          Comment


                            #14
                            Got this response from the plugin author:

                            ---------------------
                            It looks like it's crashing trying to start Avahi mDNS browser. It's common on Linux, but I have exception handler around mDNS code, so it shouldn't crash.

                            Can you try setting up Avahi https://forums.homeseer.com/forum/hs...conf-discovery

                            Also, you can filter HS log by plugin (FROM FILTER) and EXPORT hs log to file.

                            [EDIT]

                            What I mean - the Avahi exception is normal when Avahi is not setup, but the UnhandledException which causes the crash may be something unrelated, FileNotFoundException, but it's not clear which file not found.

                            ---------------------

                            I am not able to SSH in to the HS4 IP (why not?). Listing services using Syno Container Manager does not list Avahi.
                            Trying to install Avahi fails.

                            I have no prior knowledge about Docker, so this might be a very stupid question. Isn't it possible to add functionality (as in installing stuff) to the OS the same way as in another Linux install?




                            Comment

                            Working...
                            X