Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

group abort command is not working #63

Closed
ABrauser opened this issue Dec 9, 2019 · 2 comments · Fixed by #77
Closed

group abort command is not working #63

ABrauser opened this issue Dec 9, 2019 · 2 comments · Fixed by #77

Comments

@ABrauser
Copy link

ABrauser commented Dec 9, 2019

Hello, it seems that the group abort command is not working.

Group created with the command:
songpal group --url http://192.192.0.254:52323/dmr.xml create Multiroomtest uuid:00000000-0000-1010-8000-xxxxxxxxxxxxx uuid:00000000-0000-1010-8000-xxxxxxxxxx

Group try to abort:

C:\> songpal group --url http://192.168.0.254:52323/dmr.xml abort
Endpoint is required except when with 'discover'!
Aborting current group..
INFO:songpal.group:Calling X_Abort with {'MasterSessionID': 0}
Traceback (most recent call last):
  File "c:\users\Gwendolin\appdata\local\programs\python\python38\lib\runpy.py", line 192, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "c:\users\Gwendolin\appdata\local\programs\python\python38\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Users\Gwendolin\AppData\Local\Programs\Python\Python38\Scripts\songpal.exe\__main__.py", line 7, in <module>
  File "c:\users\Gwendolin\appdata\local\programs\python\python38\lib\site-packages\click\core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "c:\users\Gwendolin\appdata\local\programs\python\python38\lib\site-packages\click\core.py", line 717, in main
    rv = self.invoke(ctx)
  File "c:\users\Gwendolin\appdata\local\programs\python\python38\lib\site-packages\click\core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "c:\users\Gwendolin\appdata\local\programs\python\python38\lib\site-packages\click\core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "c:\users\Gwendolin\appdata\local\programs\python\python38\lib\site-packages\click\core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "c:\users\Gwendolin\appdata\local\programs\python\python38\lib\site-packages\click\core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "c:\users\Gwendolin\appdata\local\programs\python\python38\lib\site-packages\click\decorators.py", line 64, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
  File "c:\users\Gwendolin\appdata\local\programs\python\python38\lib\site-packages\click\core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "c:\users\Gwendolin\appdata\local\programs\python\python38\lib\site-packages\songpal\main.py", line 50, in wrapper
    return loop.run_until_complete(f(*args, **kwargs))
  File "c:\users\Gwendolin\appdata\local\programs\python\python38\lib\asyncio\base_events.py", line 608, in run_until_complete
    return future.result()
  File "c:\users\Gwendolin\appdata\local\programs\python\python38\lib\site-packages\songpal\main.py", line 713, in abort
    click.echo(await gc.abort())
  File "c:\users\Gwendolin\appdata\local\programs\python\python38\lib\site-packages\songpal\group.py", line 203, in abort
    res = await self.call("X_Abort", MasterSessionID=state.MasterSessionID)
  File "c:\users\Gwendolin\appdata\local\programs\python\python38\lib\site-packages\songpal\group.py", line 133, in call
    res = await act.async_call(**kwargs)
  File "c:\users\Gwendolin\appdata\local\programs\python\python38\lib\site-packages\async_upnp_client\client.py", line 514, in async_call
    raise UpnpError('Error during async_call(), status: %s, body: %s' %
async_upnp_client.client.UpnpError: Error during async_call(), status: 500, body: <?xml version="1.0"?><s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body><s:Fault><faultcode>s:Client</faultcode><faultstring>UPnPError</faultstring><detail><UPnPError xmlns="urn:schemas-upnp-org:control-1-0"><errorCode>811</errorCode><errorDescription>Action X_Abort failed
</errorDescription></UPnPError></detail></s:Fault></s:Body></s:Envelope>
@rytilahti
Copy link
Owner

Are the other commands working properly? That code was based on the description files, and none of it was tested by myself. The UPnP error codes 800-900 (like that 811 here) are vendor-specific, so it's hard to say what is wrong – it could be that the method excepts different parameters, or it could be something else..

Anyway, if you want to do some testing, you'll find all the commands and their parameters here: https://github.com/rytilahti/python-songpal/blob/master/songpal/group.py#L205 .

@maximoei
Copy link
Contributor

maximoei commented Aug 23, 2020

Hi @rytilahti! First of all, thanks for creating this even without owning a second device yourself 👍

I think I've found why abort is not working!
Actions like abort, add, remove are currently using the MasterSessionID as parameter, but in the state object, this is always 0; so this should be the SessionID.
MasterSessionID is used from the slave's perspective, For the Master, MasterSessionID=0; so all calls fail.

I'll try to PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants