Giter VIP home page Giter VIP logo

soundtouch-nodejs's People

Contributors

geertsmichael avatar michael-geerts avatar yehya avatar zwrose avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

soundtouch-nodejs's Issues

Crashing homebridge since new firmwares

Hello,

I have a problem with homebridge-soundtouch. I think that is basing on SoundTouch-NodeJS, right?
That plugin is crashing since new firmware for SoundTouch 20 was released (FW 20.0.6)).

Log:

Nov 23 06:43:01 Server homebridge[28366]: /usr/lib/node_modules/homebridge-soundtouch/node_modules/soundtouch/api.js:67
Nov 23 06:43:01 Server homebridge[28366]:         var isAlive =  json.nowPlaying.source != SOURCES.STANDBY;
Nov 23 06:43:01 Server homebridge[28366]:                                        ^
Nov 23 06:43:01 Server homebridge[28366]: TypeError: Cannot read property 'source' of undefined
Nov 23 06:43:01 Server homebridge[28366]:     at /usr/lib/node_modules/homebridge-soundtouch/node_modules/soundtouch/api.js:67:40
Nov 23 06:43:01 Server homebridge[28366]:     at /usr/lib/node_modules/homebridge-soundtouch/node_modules/soundtouch/api.js:363:17
Nov 23 06:43:01 Server homebridge[28366]:     at IncomingMessage.<anonymous> (/usr/lib/node_modules/homebridge-soundtouch/node_modules/soundtouc                                                   h/utils/xmltojson.js:25:13)
Nov 23 06:43:01 Server homebridge[28366]:     at emitNone (events.js:111:20)
Nov 23 06:43:01 Server homebridge[28366]:     at IncomingMessage.emit (events.js:208:7)
Nov 23 06:43:01 Server homebridge[28366]:     at endReadableNT (_stream_readable.js:1064:12)
Nov 23 06:43:01 Server homebridge[28366]:     at _combinedTickCallback (internal/process/next_tick.js:139:11)
Nov 23 06:43:01 Server homebridge[28366]:     at process._tickCallback (internal/process/next_tick.js:181:9)
Nov 23 06:43:01 Server systemd[1]: homebridge.service: Main process exited, code=exited, status=1/FAILURE
Nov 23 06:43:01 Server systemd[1]: homebridge.service: Unit entered failed state.
Nov 23 06:43:01 Server systemd[1]: homebridge.service: Failed with result 'exit-code'.

handler problem

Hi

First of all, your node is really great, I can finally send direct orders to my bose Soundtouch.
The only problem I have, is to change the music from spotify. it crashes when i send the parameters.

I got this error:
Selecting to play new music source
/home/pi/SoundTouch-NodeJS/api.js:368
handler(json);
^

TypeError: handler is not a function
at Request._callback (/home/pi/SoundTouch-NodeJS/api.js:368:9)
at Request.self.callback (/home/pi/SoundTouch-NodeJS/node_modules/request/request.js:186:22)
at emitTwo (events.js:87:13)
at Request.emit (events.js:172:7)
at Request. (/home/pi/SoundTouch-NodeJS/node_modules/request/request.js:1163:10)
at emitOne (events.js:77:13)
at Request.emit (events.js:169:7)
at IncomingMessage. (/home/pi/SoundTouch-NodeJS/node_modules/request/request.js:1085:12)
at IncomingMessage.g (events.js:260:16)
at emitNone (events.js:72:20)

My URL sent is

http://10.10.22.52:5006/diningroom/select/SPOTIFY/*****/spotify:track:4TfnvCrnjbXYu8XrjC4yF1

but it crashes all the time. I have a reaction on the Ipad that want to change the song but the node crashes and nothing happen.

Do you have an idea from what it could be ?

Thank you

Select type property

Had trouble with the select API call because of the missing 'type' property. Will submit a PR for the fix I used.

Not working anymore, still maintain ?

When trying to run the sample.js file, it crash

node sample.js 
Started Searching...
Lifestyle --> 192.168.1.12
/Users/jaumard/Downloads/test/node_modules/soundtouch/api.js:266
    if (json.nowPlayingUpdated != undefined) {
            ^

TypeError: Cannot read property 'nowPlayingUpdated' of undefined
    at SoundTouchAPI.socketUpdate (/Users/jaumard/Downloads/test/node_modules/soundtouch/api.js:266:13)
    at WebSocketConnection.<anonymous> (/Users/jaumard/Downloads/test/node_modules/soundtouch/api.js:253:21)
    at emitOne (events.js:96:13)
    at WebSocketConnection.emit (events.js:191:7)
    at WebSocketConnection.processFrame (/Users/jaumard/Downloads/test/node_modules/websocket/lib/WebSocketConnection.js:547:26)
    at /Users/jaumard/Downloads/test/node_modules/websocket/lib/WebSocketConnection.js:321:40
    at _combinedTickCallback (internal/process/next_tick.js:73:7)
    at process._tickCallback (internal/process/next_tick.js:104:9)

Can't select STORED_MUSIC

server.js crashes when trying to select a STORED_MUSIC with the following error messages:

SoundTouch-NodeJS/api.js:382
handler(json);
 ^
TypeError: handler is not a function
   at Request._callback (/Users/the/Google Drive Privat/Coding/soundtouch/node-soundtouch/SoundTouch-NodeJS/api.js:382:9)
   at Request.self.callback (/Users/the/Google Drive Privat/Coding/soundtouch/node-soundtouch/SoundTouch-NodeJS/node_modules/request/request.js:186:22)
   at emitTwo (events.js:126:13)
   at Request.emit (events.js:214:7)
   at Request.<anonymous> (/Users/the/Google Drive Privat/Coding/soundtouch/node-soundtouch/SoundTouch-NodeJS/node_modules/request/request.js:1163:10)
   at emitOne (events.js:116:13)
   at Request.emit (events.js:211:7)
   at IncomingMessage.<anonymous> (/Users/the/Google Drive Privat/Coding/soundtouch/node-soundtouch/SoundTouch-NodeJS/node_modules/request/request.js:1085:12)
   at Object.onceWrapper (events.js:313:30)
   at emitNone (events.js:111:20)

What I sent was:

localhost:5006/Office/select/STORED_MUSIC/55076f6e-6b79-1d65-a4eb-00089bea8bd7%2F0/0%241%2417%243338%2421161

I got the information out of:

OW PLAYING UPDATED { nowPlaying: 
{ deviceID: '08DF1F1A065C',
 source: 'STORED_MUSIC',
 sourceAccount: '55076f6e-6b79-1d65-a4eb-00089bea8bd7/0',
 ContentItem: 
  { source: 'STORED_MUSIC',
    location: '0$1$17$3338$21001',
    sourceAccount: '55076f6e-6b79-1d65-a4eb-00089bea8bd7/0',
    isPresetable: 'true',
    itemName: 'Bla bla' }
....

So I urlencoded the sourceAccount valueand the location to the above mentioned REST call.
Interestingly I saw by using the sample.js

NOW SELECTION UPDATED { preset: 
{ id: '0',
 ContentItem: 
  { source: 'STORED_MUSIC',
    type: '55076f6e-6b79-1d65-a4eb-00089bea8bd7/0',
    location: 'function %28json%29 {\n        res.json%28json%29;\n    }',
    sourceAccount: '0$1$17$3338$21161',
    isPresetable: 'true',
    itemName: 'Select using API' } } }
NOW PLAYING UPDATED { nowPlaying: 
 { deviceID: '08DF1F1A065C',
 source: 'INVALID_SOURCE',
 ContentItem: { source: 'INVALID_SOURCE', isPresetable: 'true' } } }
Powered On
Not playing

As it looks some source code is passed into the REST call (see location). The sourceAccount while decoded correctly was displayed in type. So I guess something is beeing mixed up.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.