Closed themessings closed 9 years ago
Is your server running? What do you see when you "./node server.js" from the node-sonos-http-api directory?
here is the process I have been running and the output I see.
pi@raspberrypi ~ $ sudo npm -v 2.11.2 pi@raspberrypi ~ $ node -v v0.12.6
pi@raspberrypi ~ $ sudo npm install npm WARN package.json sonos-http-api@0.16.0 No license field. npm WARN engine require-fu@1.0.0: wanted: {"node":"0.10.x"} (current: {"node":"0 .12.6","npm":"2.11.2"}) require-fu@1.0.0 node_modules/require-fu
async@0.2.10 node_modules/async
node-static@0.7.7 node_modules/node-static ├── mime@1.3.4 ├── colors@1.1.2 └── optimist@0.6.1 (wordwrap@0.0.3, minimist@0.0.10)
sonos-discovery@0.15.3 node_modules/sonos-discovery ├── easysax@0.1.14 ├── html-entities@1.0.10 └── winston@0.8.3 (cycle@1.0.3, stack-trace@0.0.9, isstream@0.1.2, eyes@0.1.8, c olors@0.6.2, pkginfo@0.3.0) pi@raspberrypi ~ $ node server.js no settings file found, will only use default settings http server listening on port 5005 module.js:489 throw err; ^ SyntaxError: /home/pi/presets.json: Unexpected token ] at Object.parse (native) at Object.Module._extensions..json (module.js:486:27) at Module.load (module.js:355:32) at Function.Module._load (module.js:310:12) at Module.require (module.js:365:17) at require (module.js:384:17) at /home/pi/lib/actions/preset.js:23:17 at FSReqWrap.cb as oncomplete
On Tue, Aug 4, 2015 at 2:14 AM, Ryan Graciano notifications@github.com wrote:
Is your server running? What do you see when you "./node server.js" from the node-sonos-http-api directory?
— Reply to this email directly or view it on GitHub https://github.com/rgraciano/echo-sonos/issues/2#issuecomment-127491172.
There's a syntax error in your presets.json file - try copy/pasting it into a JSON syntax checker like http://jsonlint.com
On Tue, Aug 4, 2015 at 5:36 AM themessings notifications@github.com wrote:
here is the process I have been running and the output I see.
pi@raspberrypi ~ $ sudo npm -v 2.11.2 pi@raspberrypi ~ $ node -v v0.12.6
pi@raspberrypi ~ $ sudo npm install npm WARN package.json sonos-http-api@0.16.0 No license field. npm WARN engine require-fu@1.0.0: wanted: {"node":"0.10.x"} (current: {"node":"0 .12.6","npm":"2.11.2"}) require-fu@1.0.0 node_modules/require-fu
async@0.2.10 node_modules/async
node-static@0.7.7 node_modules/node-static ├── mime@1.3.4 ├── colors@1.1.2 └── optimist@0.6.1 (wordwrap@0.0.3, minimist@0.0.10)
sonos-discovery@0.15.3 node_modules/sonos-discovery ├── easysax@0.1.14 ├── html-entities@1.0.10 └── winston@0.8.3 (cycle@1.0.3, stack-trace@0.0.9, isstream@0.1.2, eyes@0.1.8, c olors@0.6.2, pkginfo@0.3.0) pi@raspberrypi ~ $ node server.js no settings file found, will only use default settings http server listening on port 5005 module.js:489 throw err; ^ SyntaxError: /home/pi/presets.json: Unexpected token ] at Object.parse (native) at Object.Module._extensions..json (module.js:486:27) at Module.load (module.js:355:32) at Function.Module._load (module.js:310:12) at Module.require (module.js:365:17) at require (module.js:384:17) at /home/pi/lib/actions/preset.js:23:17 at FSReqWrap.cb as oncomplete
On Tue, Aug 4, 2015 at 2:14 AM, Ryan Graciano notifications@github.com wrote:
Is your server running? What do you see when you "./node server.js" from the node-sonos-http-api directory?
— Reply to this email directly or view it on GitHub <https://github.com/rgraciano/echo-sonos/issues/2#issuecomment-127491172 .
— Reply to this email directly or view it on GitHub https://github.com/rgraciano/echo-sonos/issues/2#issuecomment-127586495.
well... I tried to start over by re-installing everything and now have a new error.
pi@raspberrypi ~ $ npm install npm WARN package.json sonos-http-api@0.16.0 No license field. npm ERR! Linux 3.18.11-v7+ npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" npm ERR! node v0.12.6 npm ERR! npm v2.11.2 npm ERR! path /home/pi/node_modules/node-static/node_modules/.bin/mime npm ERR! code EACCES npm ERR! errno -13
npm ERR! Error: EACCES, unlink '/home/pi/node_modules/node-static/node_modules/.bin/mime' npm ERR! at Error (native) npm ERR! { [Error: EACCES, unlink '/home/pi/node_modules/node-static/node_modules/.bin/mime'] npm ERR! errno: -13, npm ERR! code: 'EACCES', npm ERR! path: '/home/pi/node_modules/node-static/node_modules/.bin/mime' } npm ERR! npm ERR! Please try running this command again as root/Administrator. npm ERR! error rolling back Error: EACCES, unlink '/home/pi/node_modules/node-static/node_modules/.bin/mime' npm ERR! error rolling back at Error (native) npm ERR! error rolling back { [Error: EACCES, unlink '/home/pi/node_modules/node-static/node_modules/.bin/mime'] npm ERR! error rolling back errno: -13, npm ERR! error rolling back code: 'EACCES', npm ERR! error rolling back path: '/home/pi/node_modules/node-static/node_modules/.bin/mime' }
npm ERR! Please include the following file with any support request: npm ERR! /home/pi/npm-debug.log pi@raspberrypi ~ $
No need to reinstall everything - just need to open up presets.json in a text editor and fix the typo. You could also paste it in here and I'll point it out On Wed, Aug 5, 2015 at 11:26 AM themessings notifications@github.com wrote:
well... I tried to start over by re-installing everything and now have a new error.
pi@raspberrypi ~ $ npm install
npm WARN package.json sonos-http-api@0.16.0 No license field.
npm ERR! Linux 3.18.11-v7+ npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" npm ERR! node v0.12.6 npm ERR! npm v2.11.2 npm ERR! path /home/pi/node_modules/node-static/node_modules/.bin/mime npm ERR! code EACCES npm ERR! errno -13
npm ERR! Error: EACCES, unlink '/home/pi/node_modules/node-static/node_modules/.bin/mime' npm ERR! at Error (native) npm ERR! { [Error: EACCES, unlink '/home/pi/node_modules/node-static/node_modules/.bin/mime'] npm ERR! errno: -13, npm ERR! code: 'EACCES', npm ERR! path: '/home/pi/node_modules/node-static/node_modules/.bin/mime' } npm ERR! npm ERR! Please try running this command again as root/Administrator. npm ERR! error rolling back Error: EACCES, unlink '/home/pi/node_modules/node-static/node_modules/.bin/mime' npm ERR! error rolling back at Error (native) npm ERR! error rolling back { [Error: EACCES, unlink '/home/pi/node_modules/node-static/node_modules/.bin/mime'] npm ERR! error rolling back errno: -13, npm ERR! error rolling back code: 'EACCES', npm ERR! error rolling back path: '/home/pi/node_modules/node-static/node_modules/.bin/mime' }
npm ERR! Please include the following file with any support request: npm ERR! /home/pi/npm-debug.log pi@raspberrypi ~ $
— Reply to this email directly or view it on GitHub https://github.com/rgraciano/echo-sonos/issues/2#issuecomment-128099795.
Hey Ryan,
Here is my preset file.
{
"test": {
"players": [
{
"roomName": "master suite",
"volume": 30
}
],
"state": "PLAYING",
"favorite": "Rock",
"uri": "x-rincon-stream:RINCON_0000000000001500",
"playMode": "SHUFFLE",
"pauseOthers": true
},
"rap": {
"players": [
{
"roomName": "deck",
"volume": 30
},
{
"roomName": "pool",
"volume": 30
},
{
"roomName": "master suite",
"volume": 30
},
{
"roomName": "kitchen5",
"volume": 40
},
{
"roomName": "kitchen",
"volume": 50
}
],
"state": "PLAYING",
"favorite": "Rap",
"uri": "x-rincon-stream:RINCON_0000000000001500",
"playMode": "SHUFFLE",
"pauseOthers": true
},
"pop rap": {
"players": [
{
"roomName": "deck",
"volume": 30
},
{
"roomName": "pool",
"volume": 30
},
{
"roomName": "master suite",
"volume": 30
},
{
"roomName": "kitchen5",
"volume": 40
},
{
"roomName": "kitchen",
"volume": 50
}
],
"state": "PLAYING",
"favorite": "Rap (Pop)",
"uri": "x-rincon-stream:RINCON_0000000000001500",
"playMode": "SHUFFLE",
"pauseOthers": true
},
"rock": {
"players": [
{
"roomName": "deck",
"volume": 30
},
{
"roomName": "pool",
"volume": 30
},
{
"roomName": "kitchen5",
"volume": 40
},
{
"roomName": "master suite",
"volume": 30
},
{
"roomName": "kitchen",
"volume": 50
}
],
"state": "PLAYING",
"favorite": "Rock",
"uri": "x-rincon-stream:RINCON_0000000000001500",
"playMode": "SHUFFLE",
"pauseOthers": true
}
}
On Wed, Aug 5, 2015 at 4:12 PM, Ryan Graciano notifications@github.com wrote:
No need to reinstall everything - just need to open up presets.json in a text editor and fix the typo. You could also paste it in here and I'll point it out On Wed, Aug 5, 2015 at 11:26 AM themessings notifications@github.com wrote:
well... I tried to start over by re-installing everything and now have a new error.
pi@raspberrypi ~ $ npm install
npm WARN package.json sonos-http-api@0.16.0 No license field.
npm ERR! Linux 3.18.11-v7+ npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" npm ERR! node v0.12.6 npm ERR! npm v2.11.2 npm ERR! path /home/pi/node_modules/node-static/node_modules/.bin/mime npm ERR! code EACCES npm ERR! errno -13
npm ERR! Error: EACCES, unlink '/home/pi/node_modules/node-static/node_modules/.bin/mime' npm ERR! at Error (native) npm ERR! { [Error: EACCES, unlink '/home/pi/node_modules/node-static/node_modules/.bin/mime'] npm ERR! errno: -13, npm ERR! code: 'EACCES', npm ERR! path: '/home/pi/node_modules/node-static/node_modules/.bin/mime' } npm ERR! npm ERR! Please try running this command again as root/Administrator. npm ERR! error rolling back Error: EACCES, unlink '/home/pi/node_modules/node-static/node_modules/.bin/mime' npm ERR! error rolling back at Error (native) npm ERR! error rolling back { [Error: EACCES, unlink '/home/pi/node_modules/node-static/node_modules/.bin/mime'] npm ERR! error rolling back errno: -13, npm ERR! error rolling back code: 'EACCES', npm ERR! error rolling back path: '/home/pi/node_modules/node-static/node_modules/.bin/mime' }
npm ERR! Please include the following file with any support request: npm ERR! /home/pi/npm-debug.log pi@raspberrypi ~ $
— Reply to this email directly or view it on GitHub <https://github.com/rgraciano/echo-sonos/issues/2#issuecomment-128099795 .
— Reply to this email directly or view it on GitHub https://github.com/rgraciano/echo-sonos/issues/2#issuecomment-128133821.
Not sure what you've gotten into by trying to reinstall, but this presets.json file seems fine. You should try to run the server with "node server.js"
I am very new to all of this so my apologies for asking dumb questions. my first project is to connect my Pi2 to my Sonos system by following the following directions. https://github.com/rgraciano/echo-sonos
I successfully
Install node.js on a server on the same network as your Sonos.
Grab https://github.com/jishi/node-sonos-http-api and run it on that server. Take the node-sonos-http-api/presets.json that I have here and drop it into your node-sonos-http-api root directory. Modify it to use your speaker names and your favorite stations. Don't worry about the "uri" field - it's unused. Make sure the preset names are lowercase (like "test" and "rock" in my example).
but when I try to test by hitting http://yourserverip:5005/zones it locks up
I also tried testing with the following and I get the "failed: Address family not supported by protocol" error
pi@raspberrypi ~ $ wget http://localhost:5005/resumeall --2015-07-29 03:04:03-- http://localhost:5005/resumeall Resolving localhost (localhost)... 127.0.0.1, ::1 Connecting to localhost (localhost)|127.0.0.1|:5005... failed: Connection refused. Connecting to localhost (localhost)|::1|:5005... failed: Address family not supported by protocol.
Any thoughts?