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

Error invoking play when device name has a space in it #2

Open
skarotech opened this issue Jul 25, 2018 · 4 comments
Open

Error invoking play when device name has a space in it #2

skarotech opened this issue Jul 25, 2018 · 4 comments

Comments

@skarotech
Copy link

There seems to be an error when invoking the play command when a device name has a space in it, eg

"Dining Room"

{"playbackState": "play"}

The error returned is

{"message":"Got status 500 when invoking /MediaRenderer/AVTransport/Control","stack":"Error\n at Object.invoke (/home/pi/sonos-swagger-api-master/node_modules/sonos-discovery/lib/helpers/soap.js:95:10)\n at Player.play (/home/pi/sonos-swagger-api-master/node_modules/sonos-discovery/lib/models/Player.js:442:15)\n at Promise.resolve.then.then (/home/pi/sonos-swagger-api-master/api/helpers/playpause.js:32:39)\n at bound (domain.js:280:14)\n at runBound (domain.js:293:12)\n at tryCatcher (/home/pi/sonos-swagger-api-master/node_modules/bluebird/js/release/util.js:16:23)\n at Promise._settlePromiseFromHandler (/home/pi/sonos-swagger-api-master/node_modules/bluebird/js/release/promise.js:512:31)\n at Promise._settlePromise (/home/pi/sonos-swagger-api-master/node_modules/bluebird/js/release/promise.js:569:18)\n at Promise._settlePromise0 (/home/pi/sonos-swagger-api-master/node_modules/bluebird/js/release/promise.js:614:10)\n at Promise._settlePromises (/home/pi/sonos-swagger-api-master/node_modules/bluebird/js/release/promise.js:693:18)\n at Async._drainQueue (/home/pi/sonos-swagger-api-master/node_modules/bluebird/js/release/async.js:133:16)\n at Async._drainQueues (/home/pi/sonos-swagger-api-master/node_modules/bluebird/js/release/async.js:143:10)\n at Immediate.Async.drainQueues (/home/pi/sonos-swagger-api-master/node_modules/bluebird/js/release/async.js:17:14)\n at runCallback (timers.js:672:20)\n at tryOnImmediate (timers.js:645:5)\n at processImmediate [as _immediateCallback] (timers.js:617:5)","code":"error"}

This error does not happen when the device name is a single word, eg "Lounge"

Also - when invoking a pause command, there is no error and it works, the issue is just the play command.

@antxxxx
Copy link
Owner

antxxxx commented Jul 27, 2018

I cant reproduce this - it works fine for me when I send a play or pause command to the endpoint whether the room name is one or two words.

Can you include the path and verb you are sending the request to when it crashes. If you cant get it from the calling application, it should appear in the node.js logs - eg

[2018-07-27 14:19:53.200] [DEBUG] app.js - request came into PUT /players/Dad%20Bedroom/state
[2018-07-27 14:19:53.202] [DEBUG] zoneDetail.js - params { playbackState: 'play' }
[2018-07-27 14:20:00.299] [DEBUG] app.js - request came into PUT /players/Dad%20Bedroom/state
[2018-07-27 14:20:00.302] [DEBUG] zoneDetail.js - params { playbackState: 'pause' }

@skarotech
Copy link
Author

http command is : http://192.168.1.128:10010/players/Dining%20Room/state
body of post is : {"playbackState": "play"}

Have attached log file of the node.js app.

sonos_log.txt

@antxxxx
Copy link
Owner

antxxxx commented Jul 28, 2018

Thanks for that - attaching the log was really helpful.
I think the issue is that there is nothing in the queue when you try to send a play command to the player.

I can reproduce this now by turning a sonos off then on again so the queue is empty and then trying to send a play command to the sonos and I get the same error. Can you confirm this is the same for you. You can check this in the sonos app - the play button should be disabled for you when you get this error

I will have a look into it so it can return a more meaningful error

@antxxxx
Copy link
Owner

antxxxx commented Jul 28, 2018

I have pushed a change so that it returns a 500 error with message saying it cant play if this happens.

Can you try it out and see if it fixes your issue

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

No branches or pull requests

2 participants