Menu

#30 mhgui harmony touch

open
None
1
2015-04-16
2014-11-20
chris
No

Hi,
if I try to sync my harmony touh the program gives me the following error:

chris@chris-VirtualBox:~$ mhgui
Unhandled exception in thread started by <bound method BackgroundTask.ThreadFunction of <main.BackgroundTask instance at 0x7ff056601440>>
Traceback (most recent call last):
File "/usr/local/bin/mhgui", line 128, in ThreadFunction
result = self.backgroundFunction(*self.backgroundFunctionArgs)
File "/usr/local/bin/mhgui", line 824, in SyncHarmonyTouch
uris = mhMgr.GetJson2Uris("HarmonyTouch")
File "/usr/local/share/congruity/mhmanager.py", line 984, in GetJson2Uris
return self.client.service['Discovery'].GetJson2Uris(clientTypeId, \
File "/usr/lib/python2.7/dist-packages/suds/client.py", line 403, in getattr
return getattr(m, name)
File "/usr/lib/python2.7/dist-packages/suds/client.py", line 494, in getattr
return self[name]
File "/usr/lib/python2.7/dist-packages/suds/client.py", line 507, in getitem
raise MethodNotFound, qn
suds.MethodNotFound: Method not found: 'Discovery.DiscoveryPortType.GetJson2Uris'

Discussion

  • Scott Talbert

    Scott Talbert - 2014-11-21

    Hi, so the Harmony Touch support is currently a work in progress. I don't have a Harmony Touch myself, and the person who was helping me test hasn't replied in several months. If you are willing to help debug, I would very much appreciate it. In order to test the support, you will need to use the harmony_touch branch from MHGUI git. Also, you will need to use a patch for concordance as well - the latest version is attached. In theory, I had made some changes that have never been tested, so it might be working at this point.

    When you run the git version of mhgui, you'll need to run it with the --use-local-wsdl option.

     

    Last edit: Scott Talbert 2014-11-21
  • Ivo Clarysse

    Ivo Clarysse - 2015-04-11

    Tried both the master and the harmony_touch branch.

    mhgui starts, login works, lists both 'Harmony Ultimate' and 'Harmony Ultimate Hub'.

    After selecting 'Harmony Ultimate' remote, mhgui crashes with:

    $ /opt/local/bin/python2.7 mhgui --use-local-wsdl
    No handlers could be found for logger "suds.umx.typed"
    Exception in thread Thread-3:
    Traceback (most recent call last):
      File     "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 810, in __bootstrap_inner
    self.run()
      File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 763, in run
        self.__target(*self.__args, **self.__kwargs)
      File "mhgui", line 124, in ThreadFunction
        result = self.backgroundFunction(*self.backgroundFunctionArgs)
      File "mhgui", line 593, in LoadData
        self.devices = mhMgr.GetDevices(self.remote.Id)
      File "/Users/ivo/src/git/congruity-code/mhmanager.py", line 339, in GetDevices
        deviceIds).Device
      File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/suds/client.py", line 542, in __call__
    [..]
      File      "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/suds/umx/typed.py", line 80, in start
        raise TypeNotFound(content.node.qname())
    TypeNotFound: Type not found: 'a:Manufacturer'
    
     
  • Ivo Clarysse

    Ivo Clarysse - 2015-04-13

    I needed to include 'Manufacturer' and 'Model' as members of the AutoDetectedDevice type to get mhgui to work with my Harmony Ultimate.

    mhgui was barfing on an autodetected Chromecast device, which looks like:

    <a:AutoDetectedDevice>
        <a:Class>Chromecast</a:Class>
        <a:Id>a909e710-9365-d94f-0815-a4282a719e4f</a:Id>
        <a:Manufacturer>Google</a:Manufacturer>
        <a:Model>Chromecast</a:Model>
        <a:Name>Living Room</a:Name>
        <a:USN>uuid:a909e710-9365-d94f-0815-a4282a719e4f::urn:dial-multiscreen-org:service:dial:1</a:USN>
    </a:AutoDetectedDevice>
    
     

    Last edit: Ivo Clarysse 2015-04-14
  • Scott Talbert

    Scott Talbert - 2015-04-14

    Ivo, thanks for your patch. I have applied it. I think you are the first person to contribute a patch to MHGUI, so thanks. :-)

    Were you actually able to sync successfully after that?

    BTW, I do plan to eventually merge the devices (ie, eliminate the fact that you see both the 'Harmony Ultimate' and the 'Harmony Ultimate Hub' within MHGUI) like the official software does.

     
  • Ivo Clarysse

    Ivo Clarysse - 2015-04-14

    No, sync fails with

    DEBUG (debug_print_packet): ff 03 ff 01 01 04 00 00 00 00 00 00 00 00 00 00
    DEBUG (UpdateConfig): DATA 50, sending 62 bytes, 8418 bytes left
    DEBUG (UpdateConfig): DATA 51, sending 62 bytes, 8356 bytes left
    DEBUG (UpdateConfig): DATA 52, sending 62 bytes, 8294 bytes left
    DEBUG (HID_WriteReport): Failed to write to device: -1 ((null))
    

    (full concordance debug output attached)

    Tested on master branch.

    On the harmony_touch branch, sync causes the following exception:

    Unhandled exception in thread started by <bound method BackgroundTask.ThreadFunction of <__main__.BackgroundTask instance at 0x113d1dfc8>>
    Traceback (most recent call last):
      File "mhgui", line 128, in ThreadFunction
         result = self.backgroundFunction(*self.backgroundFunctionArgs)
      File "mhgui", line 827, in SyncHarmonyTouch
        response = self.ParseJSONResponse(self.MHReadFile(HLAPI))
      File "mhgui", line 798, in MHReadFile
        libconcord.mh_read_file(filename, buf, buflen, dataRead)
    ctypes.ArgumentError: argument 4: <type 'exceptions.TypeError'>: expected LP_c_uint instance instead of c_int
    

    Note that Logitech's MyHarmony doesn't seem to support USB-based sync any more. Pressing the 'Sync' button in Logitech's desktop app triggers a message requesting the user to initiate sync from the remote. (I'm guessing the remote then uses RF to trigger the Hub to sync over TCP/IP).

    Maybe the XMPP service running on the Hub, as in https://github.com/jterrace/pyharmony, can be used to trigger sync ?

     

    Last edit: Ivo Clarysse 2015-04-14
  • Scott Talbert

    Scott Talbert - 2015-04-15

    It definitely won't work on master - all of the Harmony Touch and related work (Ultimate, Hub, etc.) has been done on harmony_touch.

    That's an odd error that you're seeing on harmony_touch. Are you using concordance 1.2 (or master)?

    The official software has to still support USB sync, as the Touch doesn't have any other kind of connectivity, as far as I'm aware.

     
  • Ivo Clarysse

    Ivo Clarysse - 2015-04-15

    I'm using concordance 1.2 / master. On the harmony_touch branch, mhgui crashes at startup with the following error on my system (MacPorts-based Python 2.7 installation on OS X 10.10.3):

      File "mhgui", line 2788, in _SetPage
        self.sizer_top_right.Add(self.cur_page, 1, wx.EXPAND)
      File     "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/wx-3.0-osx_cocoa/wx/_core.py", line 14457, in Add
        return _core_.Sizer_Add(*args, **kwargs)
    wx._core.PyAssertionError: C++ assertion "!sizer || m_containingSizer != sizer" failed at ../src/common/wincmn.cpp(2470) in SetContainingSizer(): Adding a window to the same sizer twice?
    

    After commenting the 'self.sizer_top_right.Add(..' line, mhgui does start up and I got the ctypes.ArgumentError reported earlier.

    When changing the invocation of libconcord.mh_read_file(..) in MHReadFile to use ctypes.c_uint() instead of ctypes.c_int(), the Harmony Ultimate remote does indicate 'Syncing config' on its display, but mhgui crashes with:

    DEBUG (FindRemote): Testing: 05AC, 0259
    DEBUG (FindRemote): Testing: 05AC, 0259
    DEBUG (FindRemote): Testing: 046D, C12B
    DEBUG (FindRemote): Found a Harmony!
    DEBUG (WriteFile): msg_write_file
    DEBUG (debug_print_packet): ff 01 80 02 01 00 04 00 00 00 6d 00 00 00 00 00
    DEBUG (WriteFile): msg_ack
    DEBUG (WriteFile): DATA sending 45 bytes, 0 bytes left
    DEBUG (WriteFile): after writing file
    DEBUG (debug_print_packet): ff 03 82 01 01 00 00 00 00 00 00 00 00 00 00 00
    DEBUG (reset_sequence): msg_reset_seq
    DEBUG (debug_print_packet): ff 07 83 01 01 00 00 00 00 00 00 00 00 00 00 00
    DEBUG (ReadFile): msg_read_file
    DEBUG (debug_print_packet): ff 01 80 02 01 01 04 00 00 00 76 00 00 00 00 00
    DEBUG (ReadFile): msg_ack
    DEBUG (debug_print_packet): ff 04 81 02 01 01 01 03 00 00 00 00 00 00 00 00
    DEBUG (debug_print_packet): 82 be 52 65 73 70 6f 6e 73 65 2c 7b 22 65 72 72
    DEBUG (debug_print_packet): 83 b8 6c 6f 67 69 74 65 63 68 2e 63 6f 6e 66 69
    DEBUG (ReadFile): data_read=118
    DEBUG (reset_sequence): msg_reset_seq
    DEBUG (debug_print_packet): ff 07 82 01 01 01 00 00 00 00 00 00 00 00 00 00
    DEBUG (WriteFile): msg_write_file
    DEBUG (debug_print_packet): ff 01 80 02 01 02 04 00 00 00 76 00 00 00 00 00
    DEBUG (WriteFile): msg_ack
    DEBUG (WriteFile): DATA sending 36 bytes, 0 bytes left
    DEBUG (HID_ReadReport): USB read timed out
    DEBUG (WriteFile): Failed to read from remote
    Unhandled exception in thread started by <bound method BackgroundTask.ThreadFunction of <__main__.BackgroundTask instance at 0x1112a8440>>
    Traceback (most recent call last):
      File "mhgui", line 128, in ThreadFunction
        result = self.backgroundFunction(*self.backgroundFunctionArgs)
      File "mhgui", line 829, in SyncHarmonyTouch
        self.MHWriteFile(HLAPI, TOUCH_SYNC_START_MSG)
      File "mhgui", line 804, in MHWriteFile
        libconcord.mh_write_file(filename, buf, len(data))
      File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/libconcord.py", line 124, in __call__
        raise LibConcordException(self.func_name, result)
    libconcord.LibConcordException: libconcord function 'mh_write_file' failed with error code 3 ('Error while reading from the remote')
    
     

    Last edit: Ivo Clarysse 2015-04-15
  • Scott Talbert

    Scott Talbert - 2015-04-16

    Well, I just bought a Harmony Touch (I really need to stop doing that) on eBay, so I'll be able to work on this easily myself shortly.

     

Log in to post a comment.

MongoDB Logo MongoDB