robertvorthman / homebridge-marantz-volume

Homebridge plugin to control Marantz/Denon receiver volume with Siri commands
MIT License
21 stars 16 forks source link

Crashing Homebridge when Amp Is Off #9

Closed simonrb2000 closed 7 years ago

simonrb2000 commented 7 years ago

Hey,

Been using this for months now and it is very good. I noticed when we were out or in bed that Homebridge would crash or it wouldn't update devices from within HomeKit apps. Today I disconnected the power from my amp and Homebridge crashed. It appears that if the Amp suddenly isn't contactable then it messes up my homebridge.

Could you test with your setup, as when we are out or go to bed the amp is turned off at the mains and this is when we get the problems.

Cheers!!! :D

robertvorthman commented 7 years ago

That's weird. Mine doesn't do that, but I'll test it again to make sure.

simonrb2000 commented 7 years ago

Cheers dude. Let me know if I can send you any logs or anything. :)

simonrb2000 commented 7 years ago

Did you check this out? I'll explain what I'm getting. Homekit is working just fine via the the native Home App and everything updates fine (eDomoticz). If I unplug my Denon amp then all my device change to saying 'Updating'. If I use Siri it will eventually send the command however it responds saying it didn't hear back. If I plug my Denon amp back in, a 30 secs or so later it starts to work again! So Homebridge doesn't crash, I think its spending all its efforts trying to communicate with the Denon amp which is now uncontactable...

Cheers Robert! :)

robertvorthman commented 7 years ago

I looked into this. I replicated the issue of all Homebridge accessories hanging by unplugging my receiver's ethernet cable. I am not an expert in Homebridge plugins, but it seems I was missing a line of code that allowed execution to continue even if the receiver did not respond. I have updated this plugin which seems to have resolved the issue. Please update to the new version by running "npm install -g homebridge-marantz-volume" again and let me know if I can close the issue.

simonrb2000 commented 7 years ago

Thanks for the update. I updated and now when the amp is off it crashes homebridge. I have a screen shot I could email you if the errors

simonrb2000 commented 7 years ago

| \ | | ()
| | | | | | _ __ | | | / | ' ` \ / | | |/ _| / | |/ / () | | | | | | () | |_| | ( / / |_/ \/|| || ||/ ||**/**|

Last login: Sat Nov 12 02:16:33 2016 from simons-mbp

Saturday, 12 November 2016, 2:21:01 am GMT Linux 4.4.26-v7+ armv7l GNU/Linux Uptime.............: 5 days, 02h50m54s Memory.............: 147060kB (Free) / 947736kB (Total) Load Averages......: 0.26, 0.34, 0.33 (1, 5, 15 min) Running Processes..: 138 IP Addresses.......: 192.168.1.26

pi@raspberrypi:~$ sudo systemctl status homebridge -l ● homebridge.service - HomeBridge Service Loaded: loaded (/lib/systemd/system/homebridge.service; enabled) Active: failed (Result: exit-code) since Sat 2016-11-12 02:19:17 GMT; 1min 47s ago Process: 7346 ExecStart=/usr/bin/homebridge (code=exited, status=1/FAILURE) Main PID: 7346 (code=exited, status=1/FAILURE)

Nov 12 02:19:17 raspberrypi homebridge[7346]: at self.callback (/usr/lib/node_modules/homebridge-marantz-volume/node_modules/request/request.js:186:22) Nov 12 02:19:17 raspberrypi homebridge[7346]: at emitOne (events.js:77:13) Nov 12 02:19:17 raspberrypi homebridge[7346]: at Request.emit (events.js:169:7) Nov 12 02:19:17 raspberrypi homebridge[7346]: at Request.onRequestError (/usr/lib/node_modules/homebridge-marantz-volume/node_modules/request/request.js:845:8) Nov 12 02:19:17 raspberrypi homebridge[7346]: at emitOne (events.js:77:13) Nov 12 02:19:17 raspberrypi homebridge[7346]: at ClientRequest.emit (events.js:169:7) Nov 12 02:19:17 raspberrypi homebridge[7346]: at Socket.socketErrorListener (_http_client.js:269:9) Nov 12 02:19:17 raspberrypi homebridge[7346]: at emitOne (events.js:77:13) Nov 12 02:19:17 raspberrypi systemd[1]: homebridge.service: main process exited, code=exited, status=1/FAILURE Nov 12 02:19:17 raspberrypi systemd[1]: Unit homebridge.service entered failed state. pi@raspberrypi:~$

simonrb2000 commented 7 years ago

Sorry for all the comments lol. It homebridge will not start and stay running unless the amp is turned on and reachable. :-( the previous version was better haha.

robertvorthman commented 7 years ago

Could you please share your config.json, or just the part about this plugin?

robertvorthman commented 7 years ago

Do you have homebridge-denon installed? Please remove it from your config.json and test my plugin independently from other plugins that also talk to your Denon.

simonrb2000 commented 7 years ago

Yours is the only one I use for contact with the amp, I don't even use it for power.. Its only used for Volume.. I am out and about today.. Will try tomorrow mate. It all works perfectly when the amp is contactable.

Only two things in my config is eDomtoicz and your plugin.

simonrb2000 commented 7 years ago

{ "bridge": { "name": "Homebridge", "username": "DD:33:4E:F4:DF:31", "port": 51927, "pin": "031-45-154" },

"accessories": [{
    "accessory": "marantz-volume",
    "name": "Stereo Volume",
    "host": "192.168.1.12",
    "maxVolume": 80
}],

"platforms": [{
    "platform": "eDomoticz",
    "name": "eDomoticz",
    "server": "127.0.0.1",
    "port": "8080",
    "roomid": "4",
    "loadscenes": "0",
    "mqttenable": 1,
    "mqttserver": "127.0.0.1",
    "mqttport": "1883",
    "mqttauth": 0,
    "mqttuser": "",
    "mqttpass": ""
}]

}

robertvorthman commented 7 years ago

I don't know. I can't replicate the issue so I'm not sure how to fix it. Can't you just leave the amp on? How big a deal is this?

simonrb2000 commented 7 years ago

Was a big deal. I would never leave the amp plugged in when not at the house or asleep. The power cable runs through the wall in trunking - probably safe but is all wired in and turns off automatically. Reason its not a big deal is I spent the last day getting Domoticz to control my Denon via a dimmer and exposed that to HomeKit and it appears to work. I uninstalled this plugin and turned everything off, HomeKit still works and doesn't crash so I'll stop using this plugin.

Such a shame it can't be replicated. Maybe its just my setup that has it! So you can unplug your amp and HomeKit still works?

robertvorthman commented 7 years ago

I use my amp's second zone for my Amazon Echo Dot so I don't want to unplug its power, but I unplugged the ethernet cable and it is not on Wi-Fi and Homebridge still works.

simonrb2000 commented 7 years ago

Must just be mine then. You can close this if you wish - I have had to stop using it due to this issue. Since removing it my Homebridge hasn't crashed and works just fine when the Amp is unplugged :)

Thanks for looking into it! :D

JacobOJ commented 7 years ago

@simonrb2000

I had the same issue with homebridge crashing when the amp has no power. I have fixed it, for me at least, in this pull request: https://github.com/robertvorthman/homebridge-marantz-volume/pull/12

Maybe it works for you, aswell.

simonrb2000 commented 7 years ago

Thanks for this! I have switched from the homebridge plugin now. I control it a different way. Thanks though and hope it helps others! Cheers

On 22 Mar 2017, at 18:25, JacobOJ notifications@github.com<mailto:notifications@github.com> wrote:

@simonrb2000https://github.com/simonrb2000

I had the same issue with homebridge crashing when the amp has no power. I have fixed it, for me at least, in this pull request:

12https://github.com/robertvorthman/homebridge-marantz-volume/pull/12

Maybe it works for you, aswell.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/robertvorthman/homebridge-marantz-volume/issues/9#issuecomment-288494290, or mute the threadhttps://github.com/notifications/unsubscribe-auth/APQCALI-OnQGVfbRm8sMmvW6Xmzr2BpAks5roWeUgaJpZM4KrRfu.