Announcement

Collapse
No announcement yet.

"INFO: Plugin start is pending" and I cannot stop the plugin

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

    "INFO: Plugin start is pending" and I cannot stop the plugin

    I am looking for days now... when I start my HS4 plugin from the HS4 plugin management page, all seems fine. I can use and configure everything just fine. But the status remains "INFO: Plugin start is pending". I cannot stop it either, the plugin just keeps running. All other communications between HS4 and the plugin work just fine!

    Thanks!
    stefxx

    #2
    Anyone? Please?
    stefxx

    Comment


      #3
      Steff,

      I am closing the HSPI.Initialize by setting the AbstractPlugin.Status = PluginStatus.Ok() once the plugin finished the init successfully. Not sure if that is needed, but I do think this ends initialization here. You could try this?
      -- Wim

      Plugins:RFXCOM, HSTouch Server, Squeezebox, BLGData, Restart, Jon00's Perfmon and Network monitor, WeatherXML, BLBackup, TenScripting, BC4, Pushover, PHLocation, JowiHue, Zwave, Sonos
      650 devices ---- 336 events ----- 40 scripts

      Comment


        #4
        Thanks! Unfortunately, that doesn't solve the issue. If I compile the sample plugin, it does work so it must be something in my plugin. Some property I missed...? I would hate to start again from the sample or template and start copying stuff until it breaks again...

        Any other thoughts?
        stefxx

        Comment


          #5
          I have rechecked my initialization here, but there is nothing special I am doing, except setting the status. Below a copy of the initiate process for me, maybe I am overlooking something here myself:

          Code:
           Protected Overrides Sub Initialize()
                  Try
                      IFACE_NAME = Id
                      Console.WriteLine("plugin is starting")
                      'Enable internal debug logging to console
                      LogDebug = True
                      'Setup anything that needs to be configured before a connection to HomeSeer is established
                      ' like initializing the starting state of anything needed for the operation of the plugin
          
                      'Such as initializing the settings pages presented to the user (currently saved state is loaded later)
                      InitializeSettingsPages()
          
                      'Or adding an event action or trigger type definition to the list of types supported by your plugin
                      TriggerTypes.AddTriggerType(GetType(AnyOnOffTrigger))
                      ActionTypes.AddActionType(GetType(JowiHueActions))
          
                      HS = HomeSeerSystem
                      SetTraceOptions(True)
                      OSType = HomeSeerSystem.GetOsType()
                      HSVersion = HomeSeerSystem.Version
                      AppPath = HomeSeerSystem.GetAppPath()
                      JowiHueDatabase = If(Debugger.IsAttached, "Data Source=JowiHue.db;ReadUncommitted=True;Version=3;Pooling=True;Max Pool Size=100;", "Data Source=" & AppPath & "\Data\JowiHue\JowiHue.db;ReadUncommitted=True;Version=3;Pooling=True;Max Pool Size=100;")
                      If OSType = HomeSeer.PluginSdk.Constants.EOsType.Linux Then JowiHueDatabase = JowiHueDatabase.Replace("\", "/")
                      TemperatureScaleF = HomeSeerSystem.GetINISetting("settings", "gGlobalTempScaleF", True)
                      HS.RegisterEventCB(HomeSeer.PluginSdk.Constants.HSEvent.CONFIG_CHANGE, IFACE_NAME)
                      BackupDB()
                      LoadSettings()
                      SetTraceOptions(True)
          
                      Log("Starting plugin JowiHue " & My.Application.Info.Version.ToString & " on " & If(OSType = HomeSeer.PluginSdk.Constants.EOsType.Linux, "Linux", "Windows"))
                      Log("settings loaded")
                      Log("Database location " & JowiHueDatabase, LogLevel.Debug)
          
                      InitDatabase()
                      StartMainTimers()
          
                      ' Initialize feature pages
                      Log("Registering feature pages", LogLevel.Debug)
                      HomeSeerSystem.RegisterFeaturePage(Id, "AddBridges.html", "Add new bridge")
                      HomeSeerSystem.RegisterFeaturePage(Id, "Bridges.html", "Bridge Maintenance")
                      HomeSeerSystem.RegisterFeaturePage(Id, "Creativity.html", "Creativity settings")
          
                      Status = PluginStatus.Ok()
                  Catch ex As Exception
                      Log(GetExceptionInfo(ex))
                      '   Status = PluginStatus.Fatal("Big issue occured")
                  End Try
              End Sub
          -- Wim

          Plugins:RFXCOM, HSTouch Server, Squeezebox, BLGData, Restart, Jon00's Perfmon and Network monitor, WeatherXML, BLBackup, TenScripting, BC4, Pushover, PHLocation, JowiHue, Zwave, Sonos
          650 devices ---- 336 events ----- 40 scripts

          Comment


            #6
            Thanks. Really strange, I am doing the same with status but it isn't reflected in the plugin page. Also, as I said before, stopping doesn't work. But all other communication work just fine...
            stefxx

            Comment


              #7
              Hi Stefxx, just a suggestion, something that happened to me at some point .... Check that you are not causing an uncaught exception somewhere. As you can see, Wim wrapped his whole init procedure in a try/catch wrapper, make sure you do the same ... and whatever other procedure HS4 will call at init. First thing I always did when I went to HS3 or HS4 was to instrument the hell out of all the funky procedures that came with the new HS structure. I'm quite sure that at some point, the log statements I had added WERE actually the problem where a typo caused an exception to happen that wasn't caught but also didn't show in HS logs ....
              Don't have my code here in front but can look at it again what "more" I added, ie imports of interfaces, log statements, return values etc to get it going. Actually don't recall having any issues w porting to HS4 in this camp (ie init phase)

              Comment


                #8
                Thanks!

                Actually, I made some progress finally! My plugin is already published through the updater, and that explains why I did not have this issue before. As soon as you install a plugin through the official updater, a HSPI_*.exe.json file gets created during installation. When I remove that file and restart HS4, everything works!

                After some more digging it turns out that he name and id in the json file are from the updater. And the Name and Id property in the plugin should be EXACTLY the same. Only then, my issues disappeared.

                And it even solved the issue I had with the AccessLevel here: https://github.com/HomeSeer/Plugin-SDK/issues/74

                So, a warning to anyone that hasn't published their plugin yet, double check your plugin name and id before you do.

                Again, thanks for the help! Time to release a fix to the updater...
                stefxx

                Comment


                  #9
                  I have experienced the same or similar issue with HS4 updater. In my case the .json file contained the wrong product name for the plugin so it caused issues with being able to enable/disable the plugin and apparently affected other plugins as well. Since this is something created by HST all we can do it report and hope for the best.

                  Comment

                  Working...
                  X