Comments (32)
Hi!
What happen if you browse to:
http://sonos_ip:1400/status from the heroku?
Where sonos_ip is the same as in you config file?
BR
Tilly
from zenmusic.
How does your Sonos setup look like? Are you pointing to a hub or player?
Found this in another forum:
I think this might be the problem, because it's a bridge it doesn't have all the audio services as it just provides a WiFi for your other sonos devices. Try using the IP address of a ZonePlayer (one that plays music) and see if that yields something more positive ;)
from zenmusic.
It's a player, just the one PLAY:3 speaker - pretty simple setup.
_____________________________
From: Henrik Tilly [email protected]
Sent: Friday, July 29, 2016 6:14 PM
Subject: Re: [htilly/zenmusic] HTTP 405 Issue? (#5)
To: htilly/zenmusic [email protected]
Cc: Author [email protected], matthewknee [email protected]
How does your Sonos setup look like? Are you pointing to a hub or player?
Found this in another forum:
I think this might be the problem, because it's a bridge it doesn't have all the audio services as it just provides a WiFi for your other sonos devices. Try using the IP address of a ZonePlayer (one that plays music) and see if that yields something more positive ;)
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
from zenmusic.
It works, I get a list of links
On Fri, Jul 29, 2016 at 6:04 PM +1000, "Henrik Tilly" [email protected] wrote:
Hi!
What happen if you browse to:
http://:1400/status from the heroku?
Where sonos_ip is the same as in you config file?
BR
Tilly
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
from zenmusic.
Seems to be a heroku issue. See:
http://stackoverflow.com/questions/15693192/heroku-node-js-error-web-process-failed-to-bind-to-port-within-60-seconds-of
Im on the road right now. Will have a closer look when I get back.
Have you tried it on a local computer?
/Tilly
from zenmusic.
Also found this:
slackapi/node-slack-sdk#39
from zenmusic.
.. and when U get it to run, please see #4
You will need to edit node_modules/sonos/lib/sonos.js and add two functions.
from zenmusic.
So after creating my first account in Heroku I think I managed to get it running..
BE AWARE, it´s an UGLY hack.. but it seems to work :)
Look in index.js and uncomment the Heoku part.
U will still need to edit the node_modules/sonos/lib/sonos.js file... see above.
BR
Tilly
from zenmusic.
Thanks Tilly! Really appreciate your help with this! I sorted the index.js file. Forgive me Im a bit of newbie...Since that node-sonos module is not in my github repo im not sure how to edit it? How exactly do I go about editing it or perhaps I should reinstall the whole module?
from zenmusic.
Try installing again. Fixed the package.json.
Should pull the latest commit including getQueue and addSpotifyQueue so you don´t need to edit the file.
BR
Tilly
from zenmusic.
Thanks Tilly - appreciate your help mate. I reinstalled everything from scratch - still getting that damn 405 error. See logs from fresh install below. Any ideas?
2016-08-05T11:52:16.560880+00:00 heroku[api]: Deploy de23a4b by [email protected]
2016-08-05T11:52:17.095582+00:00 heroku[web.1]: Restarting
2016-08-05T11:52:17.096129+00:00 heroku[web.1]: State changed from up to starting
2016-08-05T11:52:18.605505+00:00 heroku[web.1]: Starting process with command node index.js
2016-08-05T11:52:21.201257+00:00 heroku[web.1]: Process exited with status 143
2016-08-05T11:52:21.524767+00:00 app[web.1]: You have undefined unread undefined
2016-08-05T11:52:49.329491+00:00 app[web.1]: Received: message #music @mk 1470397969.000012 "status"
2016-08-05T11:52:49.329717+00:00 app[web.1]: term status
2016-08-05T11:52:49.823607+00:00 app[web.1]: Error: HTTP response code 405 for "urn:schemas-upnp-org:service:AVTransport:1#GetTransportInfo"
2016-08-05T11:52:49.823625+00:00 app[web.1]: at Request._callback (/app/node_modules/sonos/lib/sonos.js:138:23)
2016-08-05T11:52:49.823626+00:00 app[web.1]: at Request.self.callback (/app/node_modules/sonos/node_modules/request/request.js:198:22)
2016-08-05T11:52:49.823627+00:00 app[web.1]: at emitTwo (events.js:106:13)
2016-08-05T11:52:49.823627+00:00 app[web.1]: at Request.emit (events.js:191:7)
2016-08-05T11:52:49.823628+00:00 app[web.1]: at Request. (/app/node_modules/sonos/node_modules/request/request.js:1035:10)
2016-08-05T11:52:49.823628+00:00 app[web.1]: at emitOne (events.js:101:20)
2016-08-05T11:52:49.823629+00:00 app[web.1]: at Request.emit (events.js:188:7)
2016-08-05T11:52:49.823630+00:00 app[web.1]: at IncomingMessage. (/app/node_modules/sonos/node_modules/request/request.js:962:12)
2016-08-05T11:52:49.823631+00:00 app[web.1]: at emitNone (events.js:91:20)
2016-08-05T11:52:49.823631+00:00 app[web.1]: at IncomingMessage.emit (events.js:185:7)
2016-08-05T11:52:49.823632+00:00 app[web.1]: at endReadableNT (_stream_readable.js:975:12)
2016-08-05T11:52:49.823633+00:00 app[web.1]: at _combinedTickCallback (internal/process/next_tick.js:74:11)
2016-08-05T11:52:49.823633+00:00 app[web.1]: at process._tickCallback (internal/process/next_tick.js:98:9)
from zenmusic.
Also, in you configfile, the IP adress should be:
"sonos" : "1.2.3.4",
Do not enter the port number, i.e. "1.2.3.4:1400".
This will not work!
BR
Tilly
from zenmusic.
thats it! thanks for your all your help Tilly, we have a very happy office now!
from zenmusic.
ahh so close.
So most functions are working without a hitch, except the play function. Keep getting an "Unhandled rejection SlackRTMError: no channel id" error...see below
2016-08-07T01:11:03.916283+00:00 app[web.1]: Received: message #music-admin @mk 1470532263.000020 "search hotel california"
2016-08-07T01:11:03.917050+00:00 app[web.1]: term search
2016-08-07T01:11:04.443776+00:00 app[web.1]: { href: 'https://api.spotify.com/v1/search?query=hotel+california&offset=0&limit=3&type=track&market=US',
2016-08-07T01:11:04.443763+00:00 app[web.1]: { tracks:
2016-08-07T01:11:04.443780+00:00 app[web.1]: previous: null,
2016-08-07T01:11:04.443779+00:00 app[web.1]: offset: 0,
2016-08-07T01:11:04.443777+00:00 app[web.1]: items: [ [Object], [Object], [Object] ],
2016-08-07T01:11:04.443780+00:00 app[web.1]: total: 2142 } }
2016-08-07T01:11:04.443778+00:00 app[web.1]: next: 'https://api.spotify.com/v1/search?query=hotel+california&offset=3&limit=3&type=track&market=US',
2016-08-07T01:11:19.037885+00:00 app[web.1]: Received: message #music-admin @mk 1470532278.000024 "play Eagles - Hotel California"
2016-08-07T01:11:19.037931+00:00 app[web.1]: term play
2016-08-07T01:11:20.478748+00:00 app[web.1]: [ null, true ]
2016-08-07T01:11:20.508617+00:00 app[web.1]: Unhandled rejection SlackRTMError: no channel id
2016-08-07T01:11:20.508621+00:00 app[web.1]: at RTMClient._handleWsMessageViaEventHandler (/app/node_modules/@slack/client/lib/clients/rtm/client.js:460:12)
2016-08-07T01:11:20.508622+00:00 app[web.1]: at RTMClient.handleWsMessage (/app/node_modules/@slack/client/lib/clients/rtm/client.js:420:10)
2016-08-07T01:11:20.508623+00:00 app[web.1]: at WebSocket.wrapper (/app/node_modules/lodash/lodash.js:4597:19)
2016-08-07T01:11:20.508627+00:00 app[web.1]: at emitTwo (events.js:106:13)
2016-08-07T01:11:20.508628+00:00 app[web.1]: at WebSocket.emit (events.js:191:7)
2016-08-07T01:11:20.508629+00:00 app[web.1]: at /app/node_modules/ws/lib/Receiver.js:536:18
2016-08-07T01:11:20.508630+00:00 app[web.1]: at /app/node_modules/ws/lib/Receiver.js:368:7
2016-08-07T01:11:20.508630+00:00 app[web.1]: at /app/node_modules/ws/lib/PerMessageDeflate.js:249:5
2016-08-07T01:11:20.508631+00:00 app[web.1]: at afterWrite (_stream_writable.js:361:3)
2016-08-07T01:11:20.508631+00:00 app[web.1]: at onwrite (_stream_writable.js:352:7)
2016-08-07T01:11:20.508632+00:00 app[web.1]: at WritableState.onwrite (_stream_writable.js:89:5)
2016-08-07T01:11:20.508632+00:00 app[web.1]: at afterTransform (_stream_transform.js:79:3)
2016-08-07T01:11:20.508633+00:00 app[web.1]: at TransformState.afterTransform (_stream_transform.js:54:12)
from zenmusic.
Also getting an internal error for add function.
2016-08-07T01:17:22.957796+00:00 app[web.1]: Received: message #music-admin @mk 1470532642.000027 "add Eagles - Hotel California"
2016-08-07T01:17:22.957855+00:00 app[web.1]: term add
2016-08-07T01:17:23.328543+00:00 app[web.1]: { tracks:
2016-08-07T01:17:23.328556+00:00 app[web.1]: { href: 'https://api.spotify.com/v1/search?query=Eagles+-+Hotel+California&offset=0&limit=1&type=track&market=US',
2016-08-07T01:17:23.328557+00:00 app[web.1]: items: [ [Object] ],
2016-08-07T01:17:23.328557+00:00 app[web.1]: limit: 1,
2016-08-07T01:17:23.328558+00:00 app[web.1]: next: 'https://api.spotify.com/v1/search?query=Eagles+-+Hotel+California&offset=1&limit=1&type=track&market=US',
2016-08-07T01:17:23.328559+00:00 app[web.1]: offset: 0,
2016-08-07T01:17:24.354487+00:00 app[web.1]: Error: HTTP response code 500 for "urn:schemas-upnp-org:service:AVTransport:1#AddURIToQueue"
2016-08-07T01:17:24.354499+00:00 app[web.1]: at Request._callback (/app/node_modules/sonos/lib/sonos.js:138:23)
2016-08-07T01:17:24.354499+00:00 app[web.1]: at Request.self.callback (/app/node_modules/sonos/node_modules/request/request.js:198:22)
2016-08-07T01:17:24.354501+00:00 app[web.1]: at emitTwo (events.js:106:13)
2016-08-07T01:17:24.354501+00:00 app[web.1]: at Request.emit (events.js:191:7)
2016-08-07T01:17:24.354502+00:00 app[web.1]: at Request. (/app/node_modules/sonos/node_modules/request/request.js:1035:10)
2016-08-07T01:17:24.354503+00:00 app[web.1]: at emitOne (events.js:101:20)
2016-08-07T01:17:24.354503+00:00 app[web.1]: at Request.emit (events.js:188:7)
2016-08-07T01:17:24.354504+00:00 app[web.1]: at IncomingMessage. (/app/node_modules/sonos/node_modules/request/request.js:962:12)
2016-08-07T01:17:24.354505+00:00 app[web.1]: at emitNone (events.js:91:20)
2016-08-07T01:17:24.354506+00:00 app[web.1]: at IncomingMessage.emit (events.js:185:7)
2016-08-07T01:17:24.354506+00:00 app[web.1]: at endReadableNT (_stream_readable.js:975:12)
2016-08-07T01:17:24.354507+00:00 app[web.1]: at _combinedTickCallback (internal/process/next_tick.js:74:11)
2016-08-07T01:17:24.354508+00:00 app[web.1]: at process._tickCallback (internal/process/next_tick.js:98:9)
from zenmusic.
Small steps forward :)
1:
Is the bot invited to both channels specified in the config file?
2:
Also, what version of node are U running?
from zenmusic.
Yes very small... 👍
- Yes
- Latest current version
from zenmusic.
Hmm.. "play" is not intended to be used in that way. It´s an admin command if you have paused or stoped it earlier. Only works in the admin channel. Play takes no arguments..
Does "status" work?
That will indicate that you have a working network connection to the Sonos system.
Should reply with something like "Sonos is currently sleeping!" or similar =)
Works in both admin and non-admin channel.
Unless status works nor will add, append etc.
BR
Tilly
from zenmusic.
whoops, but yes status works. I tested and every function works except play and append !
I used the same example from your readme below. I did
search volbeat
that worked.
add add Volbeat - Still Counting
error!
In the logs im getting "Error: HTTP response code 500 for "urn:schemas-upnp-org:service:AVTransport:1#AddURIToQueue"
2016-08-08T06:05:22.442981+00:00 app[web.1]: Received: message #music-admin @mk 1470636322.000055 "search volbeat"
2016-08-08T06:05:22.443096+00:00 app[web.1]: term search
2016-08-08T06:05:22.782461+00:00 app[web.1]: { tracks:
2016-08-08T06:05:22.782477+00:00 app[web.1]: { href: 'https://api.spotify.com/v1/search?query=volbeat&offset=0&limit=3&type=track&market=AU',
2016-08-08T06:05:32.751444+00:00 app[web.1]: Received: message #music-admin @mk 1470636332.000059 "add Volbeat - Still Counting"
2016-08-08T06:05:32.751564+00:00 app[web.1]: term add
2016-08-08T06:05:33.248171+00:00 app[web.1]: { tracks:
2016-08-08T06:05:33.248182+00:00 app[web.1]: { href: 'https://api.spotify.com/v1/search?query=Volbeat+-+Still+Counting&offset=0&limit=1&type=track&market=AU',
2016-08-08T06:05:34.260487+00:00 app[web.1]: [ null, [ { '$': [Object] } ] ]
2016-08-08T06:05:34.940810+00:00 app[web.1]: Error: HTTP response code 500 for "urn:schemas-upnp-org:service:AVTransport:1#AddURIToQueue"
2016-08-08T06:05:34.940822+00:00 app[web.1]: at Request._callback (/app/node_modules/sonos/lib/sonos.js:138:23)
2016-08-08T06:05:34.940823+00:00 app[web.1]: at Request.self.callback (/app/node_modules/sonos/node_modules/request/request.js:198:22)
2016-08-08T06:05:34.940824+00:00 app[web.1]: at Request.emit (events.js:191:7)
2016-08-08T06:05:34.940825+00:00 app[web.1]: at Request. (/app/node_modules/sonos/node_modules/request/request.js:1035:10)
2016-08-08T06:05:34.940825+00:00 app[web.1]: at emitOne (events.js:101:20)
2016-08-08T06:05:34.940826+00:00 app[web.1]: at Request.emit (events.js:188:7)
2016-08-08T06:05:34.940827+00:00 app[web.1]: at IncomingMessage. (/app/node_modules/sonos/node_modules/request/request.js:962:12)
2016-08-08T06:05:34.940827+00:00 app[web.1]: at emitNone (events.js:91:20)
2016-08-08T06:05:34.940828+00:00 app[web.1]: at IncomingMessage.emit (events.js:185:7)
2016-08-08T06:05:34.940829+00:00 app[web.1]: at endReadableNT (_stream_readable.js:975:12)
2016-08-08T06:05:34.940824+00:00 app[web.1]: at Request.emit (events.js:191:7)
2016-08-08T06:05:34.940826+00:00 app[web.1]: at Request.emit (events.js:188:7)
2016-08-08T06:05:34.940827+00:00 app[web.1]: at emitNone (events.js:91:20)
2016-08-08T06:05:34.940829+00:00 app[web.1]: at endReadableNT (_stream_readable.js:975:12)
2016-08-08T06:05:34.940830+00:00 app[web.1]: at process._tickCallback (internal/process/next_tick.js:98:9)
2016-08-08T06:05:34.940824+00:00 app[web.1]: at Request.emit (events.js:191:7)
2016-08-08T06:05:34.940824+00:00 app[web.1]: at emitTwo (events.js:106:13)
2016-08-08T06:05:34.940826+00:00 app[web.1]: at Request.emit (events.js:188:7)
2016-08-08T06:05:34.940827+00:00 app[web.1]: at IncomingMessage. (/app/node_modules/sonos/node_modules/request/request.js:962:12)
2016-08-08T06:05:34.940829+00:00 app[web.1]: at endReadableNT (_stream_readable.js:975:12)
from zenmusic.
Ok. Then we know the problem.
For some reason the latest version of node-sonos isn´t pulled.
I added two function to node-sonos which is used by both "play" and "add".
This is the one you need:
https://github.com/bencevans/node-sonos/blob/master/lib/sonos.js
(funktions: getQueue and addSpotifyQueue)
In order to get the latest from git you will type the following on a regular computer:
npm install https://github.com/bencevans/node-sonos.git#bfb995610c8aa20bda09e370b0f5d31ba0caa6a0 --save
Now, this is a little hard in Heroku, but it should work anyway because in the package.json I have specified:
"sonos": "git+https://github.com/bencevans/node-sonos.git#bfb995610c8aa20bda09e370b0f5d31ba0caa6a0"
Your Sonos is updated with the latest version and you do have Spotify configured on it.. right !? ;)
from zenmusic.
Well.. I just installed "vim" in Heroku and it does pull the right version of node-sonos after a fresh install.
Im getting to know Heroku along the way =)
So, need to dig deeper in this.
You where running a PLAY:3, right?
No other units, bridges or anything else?
It seems to have problem working with the queue.
/tilly
from zenmusic.
thanks again tilly! Ill reinstall node-sonos now and see if that makes a difference.
Yes we have latest Sonos software installed and Spotify all setup...that part is working (i.e. search works fine)
Glad you are getting to know Heroku - its a pretty good service...
Yes we have just the single PLAY:3, nothing else connected....I can list the queue, flush it etc. just not add
from zenmusic.
still getting the same error :(
from zenmusic.
same here !
everything working except the ADD
from zenmusic.
any ideas tilly?
from zenmusic.
Hi.. yea.. I do have an idea, but I don´t know why =)
Try a new "git pull".
index.js has been updated with new functions.
The interesting thing is that when I run this version I get the 500 error. :-( but other report that it works!
Please try it and come back with feedback!
BR
Tilly
from zenmusic.
alrighty! appears to be working...Will check on Monday in the office its playing...
from zenmusic.
Nice!
from zenmusic.
Dif it work?
from zenmusic.
Yes it did!! Having lots of fun in the office, thanks for all your help Tilly!
from zenmusic.
We have a Zapier setup that fires off a theme song for meetings... You know a 'play now' function would be awesome...add a new song to queue and set to play right away...
from zenmusic.
I'll put it in the ToDo =)
/Tilly
from zenmusic.
Related Issues (20)
- Hmm. Can't call next HOT 7
- Error parsing DIDTL result HOT 1
- Admin Functionality HOT 2
- Receiving error when trying to start index.js HOT 2
- Feature Request: Add Album HOT 1
- Spotify Auth Token (I think) HOT 4
- On "next", print what song was playing and what song is next HOT 1
- index.js says "Online!" but says nothing else HOT 6
- Getting an error after following install instructions and running node index.js HOT 10
- Connecting zenbot to Sonos - StatusCodeError: 500 HOT 2
- setvolume only works for one speaker. Not two etc HOT 1
- Sorry @botname, no bots allowed! Gets spammed in channel assigned to bot HOT 2
- 'No bots allowed' HOT 4
- Setvolume response does not reflect requested volume level HOT 4
- Undefined HOT 3
- search, add, commands causes error HOT 3
- Spotify functions do not work and crash the server HOT 5
- Unable to Search I get an error when I do HOT 3
- Issue with the shuffle HOT 5
- error: Response not OK: missing_scope HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from zenmusic.