jishi / node-sonos-web-controller

A web based controller for Sonos utilizing web sockets for a native look and feel
MIT License
248 stars 45 forks source link

First use issue with installation? #65

Closed Explorer-OL closed 5 years ago

Explorer-OL commented 5 years ago

Hi,

I am fairly new on this technology so please receive my apologies if I spell an issue as an obvious wrong installation.

I installed node.js and this sonos http api controller, when launching it I get a first set of error messages (1st copy/paste below), the server is running and when accessed it seems to crash at pulling the music arts (2nd copy paste below).

I am running this on a Windows 10 PC.

Any advice for the junior I am? Thanks OL

C:\Users\olivi\Downloads\Sonos API remote access\node-sonos-web-controller-master>node server.js http server listening on port 8070 (node:19080) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'startsWith' of undefined at isRadio (C:\Users\olivi\Downloads\Sonos API remote access\node-sonos-web-controller-master\node_modules\sonos-discovery\lib\prototypes\Player\getUriType.js:4:14) at Player.getUriType (C:\Users\olivi\Downloads\Sonos API remote access\node-sonos-web-controller-master\node_modules\sonos-discovery\lib\prototypes\Player\getUriType.js:18:10) at parseTrackMetadata.then.track (C:\Users\olivi\Downloads\Sonos API remote access\node-sonos-web-controller-master\node_modules\sonos-discovery\lib\models\Player.js:243:43) at process._tickCallback (internal/process/next_tick.js:68:7) (node:19080) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1) (node:19080) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code. queue-changed Cuisine (node:19080) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'startsWith' of undefined at isRadio (C:\Users\olivi\Downloads\Sonos API remote access\node-sonos-web-controller-master\node_modules\sonos-discovery\lib\prototypes\Player\getUriType.js:4:14) at Player.getUriType (C:\Users\olivi\Downloads\Sonos API remote access\node-sonos-web-controller-master\node_modules\sonos-discovery\lib\prototypes\Player\getUriType.js:18:10) at parseTrackMetadata.then.track (C:\Users\olivi\Downloads\Sonos API remote access\node-sonos-web-controller-master\node_modules\sonos-discovery\lib\models\Player.js:243:43) at process._tickCallback (internal/process/next_tick.js:68:7) (node:19080) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)

2nd error: fetching album art from undefined fetching album art from undefined fetching album art from undefined fetching album art from undefined fetching album art from undefined fetching album art from undefined 200 fs.js:128 throw new ERR_INVALID_CALLBACK(); ^

TypeError [ERR_INVALID_CALLBACK]: Callback must be a function at maybeCallback (fs.js:128:9) at Object.exists (fs.js:196:3) at ClientRequest. (C:\Users\olivi\Downloads\Sonos API remote access\node-sonos-web-controller-master\server.js:58:19) at Object.onceWrapper (events.js:286:20) at ClientRequest.emit (events.js:198:13) at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:556:21) at HTTPParser.parserOnHeadersComplete (_http_common.js:109:17) at Socket.socketOnData (_http_client.js:442:20) at Socket.emit (events.js:198:13) at addChunk (_stream_readable.js:288:12) at readableAddChunk (_stream_readable.js:269:11) at Socket.Readable.push (_stream_readable.js:224:10) at TCP.onStreamRead [as onread] (internal/stream_base_commons.js:94:17)

Explorer-OL commented 5 years ago

Hi again, I am running node v10.16.3

OL

Explorer-OL commented 5 years ago

Hi again, in continuing to explore previous issues logged here.

I downgraded to node version 8.11.3 as like another user.

The first error message continues but the Web controller is now working, not closing immediately.

Music arts are showing fine. Only the "now playing" does not seem to update as it does not display anything. Also I do not see any navigation option to go to music services like Deezer or explore the music library that would reside on a local PC/network. Are these features implemented actually?

Thanks OL

Explorer-OL commented 5 years ago

Hi Jishi, having made this to work for many/all of us is fantastic. Thank you for sharing your passion allowing us to enjoy Sonos in a different way!

OL

jishi commented 5 years ago

Hi, first verify that this app is allowing incoming traffic in the windows firewall (or any other firewall that might be in between your computer and sonos players).

The protocol requires two way connections. Although, if this was a problem I would expect it to not find the players...

I haven't used this for quite a while, so there might be something that isn't working correctly after some updates to the Sonos players, I'll have to check it out.

On Sat, 24 Aug 2019, 08:38 Explorer-OL, notifications@github.com wrote:

Hi Jishi, having made this to work for many/all of us is fantastic. Thank you for sharing your passion allowing us to enjoy Sonos in a different way!

OL

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/jishi/node-sonos-web-controller/issues/65?email_source=notifications&email_token=AAYE2I3HOYISU72RGEGX2ULQGDJPBA5CNFSM4IPFJZJKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5B2B6I#issuecomment-524525817, or mute the thread https://github.com/notifications/unsubscribe-auth/AAYE2IY2C53QLFVQHSRYQ4LQGDJPBANCNFSM4IPFJZJA .

Explorer-OL commented 5 years ago

Hi Jishi,

Appreciate you stepped in and also that fast as other members praised your reactivity and interest in the past.

Consider my tech level somewhat low medium as I stopped from programming/network about 15 years ago and only do that occasionally when I seek to overcome challenges like being able to control Sonos players for a different sub network.

I am now running with node version 6.0.0 While I have Sonos players and your web controller all on same network, they stand in a subnetwork versus the fiber network router. Ports are open by default, but surely no port forwarding is particularly set.

Yet with testing directly from subnetwork shows that the web controller finds and is able to interact. Also I found and ran npm test on your Sonos services and it seemed all green.

The web controller does see and interact with players and even refreshes somewhat if I use the official sonos controller app.

What I could not get to work are: -Pause musique (the icon stay on "play" not changing to allow pause and interaction does not seem to act (not even a message on the command prompt window that is running the web controller).

I can get the song to pause when just using the sonos HTTP API like this http://192.x.x.x:5005/pause

-"Now Playing" windows does not show music art nor other information -Music Services and local library, I do not even seem to find a link to call them. Am I looking wrongly?

OL

image

jishi commented 5 years ago

Music services and local library was never implemented, adding favorites was a low effort task and was the only requirement I had at the time. Also, the music search for streaming services are something that the official controller does, and it requires tokens that I have yet to figure out how to get a hold of.

I can't verify the controller functionality right now, I'll have to look when I get home on Monday at the earliest. Seems like there are some incompatibilities in newer node versions. Also the Sonos-discovery library is probably outdated compared to the http-api, upgrading thst might help.

On Sat, 24 Aug 2019, 10:59 Explorer-OL, notifications@github.com wrote:

Hi Jishi,

Appreciate you stepped in and also that fast as other members praised your reactivity and interest in the past.

Consider my tech level somewhat low medium as I stopped from programming/network about 15 years ago and only do that occasionally when I seek to overcome challenges like being able to control Sonos players for a different sub network.

I am now running with node version 6.0.0 While I have Sonos players and your web controller all on same network, they stand in a subnetwork versus the fiber network router. Ports are open by default, but surely no port forwarding is particularly set.

Yet with testing directly from subnetwork shows that the web controller finds and is able to interact. Also I found and ran npm test on your Sonos services and it seemed all green.

The web controller does see and interact with players and even refreshes somewhat if I use the official sonos controller app.

What I could not get to work are: -Pause musique (the icon stay on "play" not changing to allow pause and interaction does not seem to act (not even a message on the command prompt window that is running the web controller). -"Now Playing" windows does not show music art nor other information -Music Services and local library, I do not even seem to find a link to call them. Am I looking wrongly?

OL

[image: image] https://user-images.githubusercontent.com/54465223/63634905-033b8000-c65d-11e9-82a2-5db600591784.png

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/jishi/node-sonos-web-controller/issues/65?email_source=notifications&email_token=AAYE2IYRLNJFRO5BY4KWNR3QGDZ55A5CNFSM4IPFJZJKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5B4CKI#issuecomment-524534057, or mute the thread https://github.com/notifications/unsubscribe-auth/AAYE2I3CTKGDPIFKHYKZMULQGDZ55ANCNFSM4IPFJZJA .

Explorer-OL commented 5 years ago

Thanks Jishi

I stand clear now on music services/library as well as search on streaming.

Enjoy your week-end. OL