UniversalDevicesInc-PG3 / udi-harmony-poly

Harmony Hub NodeServer for Polyglot v2
MIT License
3 stars 2 forks source link

auto discover/sync fails #5

Closed richardsillito closed 6 years ago

richardsillito commented 6 years ago

Everything went fine with the add nodeserver, but after the reboot of the isy device there was no harmonycontroller node. I restarted the node server and still no joy.

Logs show the both harmony hubs (yes I have do have 2 hubs) profiles and devices appear to have been discovered, but seems to bail before the profile is created. See snip from the logs:

2018-01-20 15:29:04,260 DEBUG    write_profile:     Function: Index: 50, Name: Sleep,  Label: Sleep, Command: Sleep
2018-01-20 15:29:04,261 DEBUG    write_profile:     Function: Index: 51, Name: Info,  Label: Info, Command: Info
2018-01-20 15:29:04,261 DEBUG    write_profile:     Function: Index: 52, Name: PageDown,  Label: Page Down, Command: PageDown
2018-01-20 15:29:04,262 DEBUG    write_profile:     Function: Index: 53, Name: PageUp,  Label: Page Up, Command: PageUp
2018-01-20 15:29:04,263 DEBUG    write_profile:     Function: Index: 54, Name: Delete,  Label: Backspace, Command: Delete
2018-01-20 15:29:04,263 DEBUG    write_profile:     Function: Index: 55, Name: ',  Label: ', Command: '
2018-01-20 15:29:04,264 DEBUG    write_profile:     Function: Index: 56, Name: !,  Label: !, Command: !
2018-01-20 15:29:04,268 WARNING  /usr/lib/python3.5/threading.py:947: ResourceWarning: unclosed file <_io.TextIOWrapper name='profile/nls/en_us.txt' mode='w' encoding='UTF-8'>
2018-01-20 15:29:04,268 WARNING  /usr/lib/python3.5/threading.py:947: ResourceWarning: unclosed file <_io.TextIOWrapper name='profile/nodedef/custom.xml' mode='w' encoding='UTF-8'>
2018-01-20 15:29:04,269 WARNING  /usr/lib/python3.5/threading.py:947: ResourceWarning: unclosed file <_io.TextIOWrapper name='profile/editor/custom.xml' mode='w' encoding='UTF-8'>
jimboca commented 6 years ago

Which version is this? There have been a couple today, look for: HarmonyController:init: Initializing VERSION=2.0.5 in that log.

But don't update yet if you are not on that version, let me look at the unclosed file issues.

jimboca commented 6 years ago

Also, can you search for ERROR in the main polyglot log

richardsillito commented 6 years ago

I am on version 2.0.5. I did some trouble shooting and if I remove the mac device (this is device it was processing when it stopped) then it works just fine. Looks like it dies right after it process the "!" label.

jimboca commented 6 years ago

Ok, I just released 2.0.6 which should show the actual error in the log right after that line. Please do the Update from the nodeserver store, you can click 'Cancel' in the Update popup to not update the profile. Then run discover again.

richardsillito commented 6 years ago

Ok standby, I removed that device from both harmony hubs, so I will do the update and then add the device back in.

richardsillito commented 6 years ago

Just an FYI, looks like I have restart the nodeserver after the upgrade... Failed with the following error

HarmonyController:discover: pyharmony discover failed. May need to restart this nodeserver: [Errno 98] Address already in use

jimboca commented 6 years ago

Ah yes, I'll report that to @Einstein42

richardsillito commented 6 years ago

I think this confirms I am on version 2.0.6

2018-01-20 16:53:53,118 INFO Updating Driver harmonyctrl - GV1: 2.0 2018-01-20 16:53:53,118 INFO Updating Driver harmonyctrl - GV2: 6

Without the Mac device I was able to do a discovery. I added the Mac device and started a sync but got this error. I will once again restart the nodeserver to clear that.

2018-01-20 17:00:33,289 ERROR Hub:h7a85cf301c1bd:Kitchen:get_current_activity: Traceback (most recent call last): File "/home/dude/.polyglot/nodeservers/HarmonyHub/harmony_hub_nodes/HarmonyHub.py", line 138, in _get_current_activity File "/home/dude/.local/lib/python3.5/site-packages/pyharmony/client.py", line 85, in get_current_activity assert action_cmd.attrib['errorcode'] == '200' ca = self.client.get_current_activity() AssertionError 2018-01-20 17:00:33,289 INFO Updating Driver h7a85cf301c1bd - ST: 0 2018-01-20 17:00:38,149 DEBUG Hub:h7a85cf301c1bd:Kitchen:poll: Calling get_client st=0 2018-01-20 17:00:38,149 INFO Hub:h7a85cf301c1bd:Kitchen:get_client: Initializing PyHarmony Client 2018-01-20 17:00:41,060 INFO Updating Driver h7a85cf301c1bd - ST: 1 2018-01-20 17:00:41,060 INFO Hub:h7a85cf301c1bd:Kitchen:get_client: PyHarmony client= <pyharmony.client.HarmonyClient object at 0x7f0795288908> 2018-01-20 17:01:06,212 INFO HarmonyController:_set_num_hubs: 0 2018-01-20 17:01:06,212 INFO Updating Driver harmonyctrl - GV3: 0 2018-01-20 17:01:06,212 INFO Updating Driver harmonyctrl - GV7: 2 2018-01-20 17:01:06,212 INFO HarmonyController:discover: harmony_discover: starting... 2018-01-20 17:01:06,213 INFO Updating Driver harmonyctrl - GV7: 9 2018-01-20 17:01:06,213 ERROR HarmonyController:discover: pyharmony discover failed. May need to restart this nodeserver: [Errno 98] Address already in use 2018-01-20 17:01:06,213 WARNING /home/dude/.polyglot/nodeservers/HarmonyHub/harmony_hub_nodes/HarmonyController.py:176: ResourceWarning: unclosed <socket.socket fd=14, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('0.0.0.0', 0)>

richardsillito commented 6 years ago

The discovery completed without error?

And it loaded the Mac Computer Node to ISY.

I think you can close this one!

2018-01-20 17:06:09,374 DEBUG write_profile: Device: Mac Computer Id: 51860805 2018-01-20 17:06:09,542 INFO write_profile_zip: profile/editor/custom.xml as editor/custom.xml 2018-01-20 17:06:09,543 INFO write_profile_zip: profile/editor/editors.xml as editor/editors.xml 2018-01-20 17:06:09,543 INFO write_profile_zip: profile/nls/en_us.txt as nls/en_us.txt 2018-01-20 17:06:09,543 INFO write_profile_zip: profile/nodedef/custom.xml as nodedef/custom.xml 2018-01-20 17:06:09,543 INFO write_profile_zip: profile/nodedef/nodedefs.xml as nodedef/nodedefs.xml 2018-01-20 17:06:09,544 INFO write_profile: done. 2018-01-20 17:06:09,544 INFO HarmonyController:load_config: Loading Harmony config config.yaml 2018-01-20 17:06:09,813 INFO Updating Driver harmonyctrl - GV7: 5 2018-01-20 17:06:09,814 INFO Sending Install Profile command to Polyglot. 2018-01-20 17:06:09,814 INFO Updating Driver harmonyctrl - GV7: 6

richardsillito commented 6 years ago

Thanks for you help!

jimboca commented 6 years ago

Not sure what fixed it, but glad it's working.