Announcement

Collapse
No announcement yet.

Weird startup behavior -- looking for some help (Windows 10)

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

    Weird startup behavior -- looking for some help (Windows 10)

    Hi, I am looking for some guidance on the proper way to start things up and was hoping there's someone who's figured this out.

    System: Windows 10
    HS4, JowiHue plugin, and DeConz for a Conbee II gateway

    I have crashes sometimes that cause the computer to reboot. I have disabled windows updates so it's not that.

    I was finally able to find an article https://docs.homeseer.com/pages/view...ageId=17466614 that showed how to create a windows task and start HS4.exe on system logon. This is the first time I'm able to get HS4 to start on reboot, and it works.


    However, here's my dilemma:


    Original setup:

    1. I had the DeConz program in my "startup" folder so it would start after a reboot.
    2. When HS4 finally started from the "task" I created, it complained that the http (port 80) port was busy and it wouldn't start. I assume the DeConz started up something on port 80.
    3. This scenario didn't work because hs4 didn't start up.

    New setup:

    1. I created another Windows task for DeConz to start up one minute after logon so HS4 would have a chance to grab port 80. I removed the "startup folder" shortcut for this.
    2. This all works and things start up properly, but now the JowiHue plugin seems to not be connected to the DeConz gateway (no devices work).


    So my questions are:

    1. Can I change the default http port for DeConz so it doesn't occupy port 80? Maybe then it can start first and everything will just work because the gateway will be "up" when HS4 starts.
    2. How do I get JowiHue to "auto reconnect" to a gateway if the gateway was offline temporarily?

    Thanks for any tips here!

    Dennis

    #2
    OK, quick update here, I think I found the problem but have new questions :-)

    I looked carefully at now it appears the Phoscon interface is coming up on port 8080. Originally when I had set this up with JowiHue it was on port 8090 for some reason (don't know why).

    So the bridge under JowiHue shows port 8090 instead of 8080. I don't think I want to remove the bridge and add it back since it might recreate all my devices from DeConz and mess up all the events. If I'm mistaken there please let me know but I think the JowiHue plugin will see this as a new bridge and all new devices.

    So now I need to do one of these options:

    1) Figure out how to change Phoscon to use port 8090, unless that's just not standard / not easy
    2) Try to go into the JowiHue config and look for the bridge IP/port and update it there.

    I'm going to try #2 and maybe things will just work as long as DeConz always uses port 8080 from now on....

    Comment


      #3
      OK, yeah, I'm stuck. The jowihue config is a .db file and I don't think I can edit it. Is it sql?

      Anyway, I'll wait for replies to this.

      Comment


        #4
        Another update here:

        Having temporarily given up on the above I went ahead and did some other things:

        1) I shutdown DeConz
        2) I went ahead and updated the f/w of the Conbee II to the latest version deCONZ_ConBeeII_0x26720700.bin using the GCF flasher utility.
        3) I started up DeConz and went to the Phoscon site to verify the version and somehow now it's on port 8090 (?)

        Now HS4's JowiHue is back to connecting to it and things are all working now.

        I wonder if the latest f/w defaults to port 8090 now?

        Anyway, I may reboot sometime to see what the behavior is going to be like. Currently, here's how it's setup:

        1) The Windows machine is set to log in automatically as the default user
        2) Upon login, the task scheduler has a task to start HS4.exe, which works
        3) One minute later another task schedule will start DeConz

        Hopefully everything just works and DeConz comes up on port 8090, which is what JowiHue is expecting.

        Comment


          #5
          Reading through this post that is pinned to the top of the forum might offer some insights on startup options

          https://forums.homeseer.com/forum/hs...41#post1500741

          Comment


            #6
            Thanks, I am taking a look at that. One thing to note, I've read about setting parameters for the startup of DeConz, i.e. "You can change the port used for Phoscon by adding a parameter "--http-port=xxxxx" to the startup command of deCONZ." but am not too sure how to do this.

            Usually when it starts it runs the deconz.exe file. Should I make a batch file that passes the flags and then point my task and desktop shortcut to that batch file instead?

            I feel like I should know how to do this but I've been more of a linux guy now for a long time :-)

            Comment


              #7
              No worries, Linux and Windows are more related under the hood than most people realize. The command line structure directly borrows from the original implementation of Unix.

              I'm assuming you've already successfully setup Homeseer to automatically startup with an administrative user as per HST's docs?
              https://docs.homeseer.com/display/HS...HS4+on+Windows

              If you have that setup then I can show you my auto start for deconz.

              Comment


                #8
                dmcentire I use 'startup delayer', it is free. Here is the screen shot for the setup. deCONZ goes first and then there is a delay for HS. The port you want is the ws not the http.

                Here is a what I have. I used port 89 because it is not used.

                Click image for larger version  Name:	pic1.png Views:	0 Size:	91.6 KB ID:	1507761

                You can verify the port has been changed by opening in notepad and going to c:\users\xxxx\AppData\Local\dresdin-electronik\deCONZ\config.ini

                Look for these lines below. The port should equal the port you put in the --ws-port=xx line after the deCONZ.exe in startup delayer or whatever you are using. If it doesn't change it to match and save the ini file

                [http]
                appcache=true
                port=89

                Comment


                  #9
                  TC1 - yes I followed those exact instructions but from a different link (in my first post above). This does work and starts up HS4 after a reboot (which I was really happy about since I have tried many other options/programs to try and get it to reliably start on boot).

                  Now the starting up of DeConz is the next thing to confirm, however, if the default web socket (or web site?) port is 8090 then HS4/JH will connect just fine, and start with no conflict on TCP 80. I am assuming Phoscon's http web server's is running on port 8090 because I can browse to it and get the login page. I assume JH is using the same port 8090 since that's how it's set up in the plugin.... but then the question of "web socket" comes into play. What's that used for? Something that gets set up when you first pair the JH plugin with the ConBee somehow via the Phoscon website? Not sure there.

                  For me just ensuring port 80 remains free for HS4 and that the JH plugin can talk to DeConz over port 8090 are the most important elements for this to be reliable for me after a reboot.

                  Back to my original question of how to properly pass flags to the DeConz exe - via a batch file or by modifying the Windows shortcut?

                  Comment


                    #10
                    cowinger - Thanks for the startup delayer recommendation. I vaguely recall trying to use this some time ago but it didn't work out for me for some reason. But the Windows task scheduler works great for me and reliably starts the software after a login (again I have my win box auto login with my default user).

                    I'm back to the difference between a web server and web socket -- what uses the web socket? I know on my setup the web server is running in port 8090. JH is also configured to use that same port. So I'm not sure where the web socket comes into play. Maybe the connection between Phoscon / ConBee II / DeConz uses it?

                    So if I want to ensure that the web server is listening on 8090, so JH can connect to it, should I add the --http-port=8090 in the DeConz startup config?

                    Comment


                      #11
                      deCONZ uses the websocket for direct communication with the plugin. Whenever a sensor triggers the notification is send to the plugin through a websocket directly. This websocket uses a different port by default then the web server.
                      By default the webserver of deCONZ will use port 80, if you want a different port to be used, you will need to add the --http-port parameter.

                      The advised startup sequence for deCONZ and HS on the same machine is to start deCONZ first, so the plugin can connect immediately during startup, otherwise it may miss some events.

                      Be aware that if you change the http port of deCONZ, the plugin will at first not find deCONZ. After running for 5 to 10 minutes it should discover the change and correct the internal settings.

                      Wim
                      -- Wim

                      Plugins: JowiHue, RFXCOM, Sonos4, Jon00's Perfmon and Network monitor, EasyTrigger, Pushover 3P, rnbWeather, BLBackup, AK SmartDevice, Pushover, PHLocation, Zwave, GCalseer, SDJ-Health, Device History, BLGData

                      1210 devices/features ---- 392 events ----- 40 scripts

                      Comment


                        #12
                        dmcentire , here's how you configure the startup parameters in Windows Task Scheduler (note, I'm running Windows 7 but should be same for 10)

                        As you can see here, I have two tasks for starting deconz and HS4. The deconz one should be setup using the same method as HS4, ie, a privileged user identity is used. Use the same account as HS4 since that is the one that is auto-logging on.
                        Click image for larger version

Name:	Capture.PNG
Views:	219
Size:	6.7 KB
ID:	1507939
                        Click image for larger version

Name:	Capture1.PNG
Views:	200
Size:	11.2 KB
ID:	1507940

                        On the Actions Tab either select New or Edit the one you already have:
                        Click image for larger version

Name:	Capture2.PNG
Views:	200
Size:	11.4 KB
ID:	1507941

                        Here you will enter the startup parameters in the "Add Arguments" section, I will list my contents but choose the ports that work for your particular network and other applications on your PC and where deconz is installed:
                        Click image for larger version

Name:	Capture3.PNG
Views:	195
Size:	7.1 KB
ID:	1507942

                        Add arguments:
                        --auto-connect=1 --dbg-error=1 --http-port=8080 --ws-port=8443

                        Start in:
                        C:\Program Files (x86)\deCONZ\bin\

                        Hope this helps.

                        Comment


                          #13
                          TC1, thank you for the in-depth reply and information. I'll try this out and see how it works. One thing to note, I found new errors in my logs about scheduler.dll not working properly and found this article. Turns out that you have to also add in the root directory of HS4 into the task scheduler in order for it to start properly.

                          Comment


                            #14
                            Originally posted by dmcentire View Post
                            TC1, thank you for the in-depth reply and information. I'll try this out and see how it works. One thing to note, I found new errors in my logs about scheduler.dll not working properly and found this article. Turns out that you have to also add in the root directory of HS4 into the task scheduler in order for it to start properly.
                            For deconz to start properly? It all depends on where you installed it. As you can see from my setup, I installed deconz into its own program folder so referencing HS4 in any way is not necessary. HS4 and deconz communicate via TCP/IP and need no knowledge of where each of them is installed. In terms of HS4, it's not just HS4 but any Windows application has to have a startup folder reference unless there is a reference to it added to the global Path variable. There will be inter-application communications going on between HS4, the Windows OS, and supporting DLL libraries. All of these applications have no prior knowledge of where each is installed, hence the need for global Path variables (pre-defined folder directory references) or references to a "Start in" folder as is the case of a launcher like Task Scheduler.

                            Comment


                              #15
                              I was referring to the startup config in the task manager of HS4, not DeConz. The startup folder needs to be set properly otherwise you'll get these in the logs continuously:


                              11/14/2021 08:07:59 AM HomeSeer Error Compiling script C:\Program Files (x86)\HomeSeer HS4\Temp\K2.vb: compiler initialization failed unexpectedly: The system cannot find the file specified.
                              11/14/2021 08:07:59 AM HomeSeer Error Compiling script C:\Program Files (x86)\HomeSeer HS4\Temp\K2.vb: could not find library 'Scheduler.dll'

                              Comment

                              Working...
                              X