Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error #1

Open
klingbing opened this issue Feb 26, 2017 · 3 comments
Open

Error #1

klingbing opened this issue Feb 26, 2017 · 3 comments

Comments

@klingbing
Copy link

I keep getting this when trying to run this plugin

ERROR LOADING PLUGIN homebridge-bluesound:
[2/26/2017, 5:03:07 PM] Error: Cannot find module 'xml2js'
at Function.Module._resolveFilename (module.js:470:15)
at Function.Module._load (module.js:418:25)
at Module.require (module.js:498:17)
at require (internal/module.js:20:19)
at Object. (/usr/local/lib/node_modules/homebridge-bluesound/index.js:4:14)
at Module._compile (module.js:571:32)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)

Any way to resolve? thanks!

@JayWizz
Copy link
Owner

JayWizz commented Feb 27, 2017

Hi
You need to install the xml2js module globally.
You can use npm to install it: sudo npm install xml2js -g
Once I get some free time, I will make sure that this is noted in the readme.
Hope this helps :-)

@klingbing
Copy link
Author

thanks for your swift reply! I made it work, installed everything, added homebridge and the Node 2 to the Apple Home app.
It constantly "pings" like this:

[3/4/2017, 11:59:54 AM] [living] Setting state to Play
[3/4/2017, 11:59:54 AM] [living] HTTP set power function succeeded!
[3/4/2017, 11:59:55 AM] [living] Light received power http://192.168.1.65:11000/Status state is currently 1

I then "switched off" the Node 2 in the Home app which resulted in:

[3/4/2017, 11:59:55 AM] [living] Setting state to Pause
[3/4/2017, 11:59:55 AM] [living] HTTP set power function succeeded!
[3/4/2017, 11:59:55 AM] [living] HTTP set power function succeeded!
/usr/local/lib/node_modules/homebridge-bluesound/index.js:96
		if (stringState == "play" || straingState == "stream") {
		                             ^
ReferenceError:

 straingState is not defined
    at pollingtoevent.<anonymous> (/usr/local/lib/node_modules/homebridge-bluesound/index.js:96:32)
    at emitOne (events.js:77:13)
    at pollingtoevent.emit (events.js:169:7)
    at done (/usr/local/lib/node_modules/homebridge-bluesound/node_modules/polling-to-event/index.js:63:20)
    at /usr/local/lib/node_modules/homebridge-bluesound/index.js:53:7
    at Request._callback (/usr/local/lib/node_modules/homebridge-bluesound/index.js:156:4)
    at Request.self.callback (/usr/local/lib/node_modules/homebridge-bluesound/node_modules/request/request.js:187:22)
    at emitTwo (events.js:87:13)
    at Request.emit (events.js:172:7)
    at Request.<anonymous> (/usr/local/lib/node_modules/homebridge-bluesound/node_modules/request/request.js:1126:10)

I was unable to launch homebridge after that, kept getting above error UNTIL I via the BlusOS App started a Tidal stream (instead of a TuneIn stream)

I now get the "pings" again

[3/4/2017, 12:18:29 PM] [living] Setting state to Play
[3/4/2017, 12:18:29 PM] [living] HTTP set power function succeeded!
[3/4/2017, 12:18:30 PM] [living] Light received power http://192.168.1.65:11000/Status state is currently 1

But the Apple Home App will not recognize homebridge any more.

Before I dig any further into trying to get this to work, can you maybe give me an idea of how (which app?) you use this plugin? Is it simply to turn on/off a bluesound player? Can you make the player play a specific preset?

thanks again for your help!

@vdsc007
Copy link

vdsc007 commented Jan 27, 2018

Hi,
I also try this plugin,
it's necessary to modify index.js file (in /var/lib/node_modules/homebridge-bluesound/index.js
and change this line
if (stringState == "play" || straingState == "stream") {

with this line
if (stringState == "play" || stringState == "stream") {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants