bencevans / node-sonos

🔈 Sonos Media Player Interface/Client

Home Page:https://www.npmjs.com/package/sonos

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Playback broken with latest sonos version?

AUTplayed opened this issue · comments

Expected Behavior

device.play(https://example.com/music.mp3) should play the music

Current Behavior

it returns a 500 Internal Server Error

Error: Request failed with status code 500
at createError (...\node_modules\axios\lib\core\createError.js:16:15)
at settle (...\node_modules\axios\lib\core\settle.js:17:12)
at IncomingMessage.handleStreamEnd

<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>701</errorCode></UPnPError></detail></s:Fault></s:Body></s:Envelope>

Versions (and Environment)

Node version: 10.16.0
node-sonos version: 1.12.5
OS: windows

SoftwareVersion: '54.2-72031',
DisplaySoftwareVersion: '10.6',
HardwareVersion: '1.22.1.5-2',

Grouping and everything works great, but not playing a file...

Your node-sonos version seems incorrect, should be something like 1.1x.y

Can you try this example https://github.com/bencevans/node-sonos/blob/master/examples/playthis.js and share the results with us?

oh, i made a typo for the version there, I'll try the example anyway tho

Error occurred {"message":"Request failed with status code 500","name":"Error","stack":"Error: Request failed with status code 500\n at createError (D:\\Philipp\\LocalPrgrms\\sonosPi\\node_modules\\axios\\lib\\core\\createError.js:16:15)\n at settle (D:\\Philipp\\LocalPrgrms\\sonosPi\\node_modules\\axios\\lib\\core\\settle.js:17:12)\n at IncomingMessage.handleStreamEnd (D:\\Philipp\\LocalPrgrms\\sonosPi\\node_modules\\axios\\lib\\adapters\\http.js:237:11)\n at IncomingMessage.emit (events.js:203:15)\n at endReadableNT (_stream_readable.js:1129:12)\n at process._tickCallback (internal/process/next_tick.js:63:19)","config":{"url":"http://10.0.0.6:1400/MediaRenderer/AVTransport/Control","method":"post","data":"<s:Envelope xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\" s:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\"><s:Body><u:AddURIToQueue xmlns:u=\"urn:schemas-upnp-org:service:AVTransport:1\"><InstanceID>0</InstanceID><EnqueuedURI>https://archive.org/download/testmp3testfile/mpthreetest.mp3</EnqueuedURI><EnqueuedURIMetaData></EnqueuedURIMetaData><DesiredFirstTrackNumberEnqueued>0</DesiredFirstTrackNumberEnqueued><EnqueueAsNext>1</EnqueueAsNext></u:AddURIToQueue></s:Body></s:Envelope>","headers":{"Accept":"application/json, text/plain, */*","Content-Type":"text/xml; charset=utf8","SOAPAction":"\"urn:schemas-upnp-org:service:AVTransport:1#AddURIToQueue\"","User-Agent":"axios/0.19.0","Content-Length":498},"transformRequest":[null],"transformResponse":[null],"timeout":0,"xsrfCookieName":"XSRF-TOKEN","xsrfHeaderName":"X-XSRF-TOKEN","maxContentLength":-1}}

but yeah, still the same

I even switched to the version of your github master, but no changes

This seems a case of WOMM (works on my machine)
mac|node 12.13.1|sonos Version: 10.6 (build 54272031)
Current version from repository. did an npm install before trying.

node-sonos % SONOS_HOST=192.168.96.56 node examples/playthis.js 
Yeay

huh, I figured out that it only works for me if the device is ungrouped, pretty weird..
I'll try some other stuff in the following days..

What the play command does is sending an item to the queue, this can only be used if the device is using the queue.

Each group of Sonos speakers has one "coordinator" managing the queue and streaming it to all other speakers. You should be able to send the play command to the coordinator.

The coordinator is always the player you picked when you created the group. So if you clicked the kitchen speaker and added the living room the kitchen speaker is the boss managing the queue. This is also the player that would be able to handle the next, previous..... Commands.

Closing this issue for now, you can re-open if you think you still have an issue with this.

doesn't work when sending play command to group master..