ZachBenz wrote:Colorado4Wheeler wrote:I think I have located the issue, the people who didn't work initially must had created the server and just immediately click OK to save it because that's the only failure point because there was no validation to check if the ports and username were blank until I just added it to Beta 9, if you changed even one single field in the server it would have forced the three key fields to populate. Let me know if you think this is not a full solution, but I think it probably is.
I just installed v0.9 from a clean install, and even with clicking to select Farenheit, still had to reload the plugin once to get the server to start. Or am I misunderstanding?
Ok, after playing with this for a while, I found a key sign as to when the first HomeKit Bridge Server device is going to fail to start without a plugin reload after install of the plugin on a clean system: the existence of the directory ~/.config/configstore (which contains a single file: update-notifier-npm.json).
To reproduce:
1. Delete all your HomeKit Bridge Server devices in Indigo
2. Disable the HomeKit Bridge plugin in Indigo
3. Delete the folder /Library/Application Support/Perceptive Automation/Indigo 7/Preferences/Plugins/com.eps.indigoplugin.homekit-bridge
4. Delete the file /Library/Application Support/Perceptive Automation/Indigo 7/Preferences/Plugins/com.eps.indigoplugin.homekit-bridge.indiPref
5. Delete the director ~/.config/configstore (easiest to do in Terminal)
6. Enable the HomeKit Bridge plugin in Indigo, and click Save to accept the default Configure HomeKit Bridge settings
7. Create a new device in Indigo of type HomeKit Bridge Server, and click Save to accept the default HomeKit Bridge Server settings
In the Indigo event log you'll see messages like:
- Code: Select all
Feb 18, 2018 at 10:24:10 PM
HomeKit Bridge Server 'new device' has changed ports or users, validating config
HomeKit Bridge Warning Attempted to verify a null port on portIsOpen, this shouldn't happen.
HomeKit Bridge Warning Attempted to verify a null port on portIsOpen, this shouldn't happen.
And the HomeKit Bridge Server device's state will remain "Stopped".
Also, note that ~/.config will
not have a configstore directory in it
Now, reload the HomeKit Bridge plugin. The configstore directory is now created, and the HomeKit Bridge Server device will successfully start, with the Indigo event log showing something like:
- Code: Select all
Feb 18, 2018 at 10:26:36 PM
Reloading plugin "HomeKit Bridge 0.9.0"
Stopping plugin "HomeKit Bridge 0.9.0" (pid 2056)
Stopped plugin "HomeKit Bridge 0.9.0"
Starting plugin "HomeKit Bridge 0.9.0" (pid 2084)
Started plugin "HomeKit Bridge 0.9.0"
HomeKit Bridge Rebuilding configuration for 'new device'
HomeKit Bridge Attempting to start 'new device'
HomeKit Bridge HomeKit server 'new device' has been started
HomeKit Bridge HomeKit Bridge is loaded and ready to use
So, in summary, the presence/absence of the ~/.config/configstore directory is directly correlated with the first HomeKit Bridge Server device added on a clean install failing to start.
Given the file in that directory appears to be associated with NPM, I'm guessing this is occurring somewhere in the firing up of the javascript side of things...