gw-wiscon / homebridge-onkyo-avr

Homebridge module for Onkyo AVRs (tested on TX-NR609)
10 stars 39 forks source link

Straight after installing #1

Closed AppleTechy closed 8 years ago

AppleTechy commented 8 years ago

I tried running the homebridge after installing and when it tried to instalize the plugin I received this error "/usr/local/lib/node_modules/homebridge/lib/api.js:47 throw new Error("The requested accessory '" + name + "' was not registered by any plugin."); ^

Error: The requested accessory 'OnkyoAVR' was not registered by any plugin. at API.accessory (/usr/local/lib/node_modules/homebridge/lib/api.js:47:13) at Server._loadAccessories (/usr/local/lib/node_modules/homebridge/lib/server.js:164:42) at Server.run (/usr/local/lib/node_modules/homebridge/lib/server.js:36:38) at module.exports (/usr/local/lib/node_modules/homebridge/lib/cli.js:23:16) at Object. (/usr/local/lib/node_modules/homebridge/bin/homebridge:17:22) at Module._compile (module.js:435:26) at Object.Module._extensions..js (module.js:442:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:311:12) at Function.Module.runMain (module.js:467:10) at startup (node.js:136:18) at node.js:963:3 "

gw-wiscon commented 8 years ago

Are you sure the plugin is installed correctly? Try to execute the following command: sudo npm install -g homebridge-onkyo-avr

AppleTechy commented 8 years ago

Yes I am positive it was correctly installed. What is on the line that is saying was incorrect? Did I some how screw up the IP address or something and that is causing the error? @gw-wiscon

gw-wiscon commented 8 years ago

The log states that no plug-in can be found that registers the name "OnkyoAVR". This is mostly indictating an installation issue. Can you try to install again, and sent me the log?

toshibochan commented 8 years ago

I able to install, but some time crash my server. And I can only turn on and off. I can't change inputs?

gw-wiscon commented 8 years ago

The crash, I have seen too. Unsure what caused it. Still investigating.

The plugin is very young, I just had time to make it control the power. If you have time to extend it, then please do so.

gw-wiscon commented 8 years ago

Can you please update to the latest version, I believe I have resolved the crash issue.

AppleTechy commented 8 years ago

Ok I can give it a shot. I ended up buying a Harmony hub as to not have to worry about plugins for everything but I am more than happy to test the plugin for you some more

gw-wiscon commented 8 years ago

Please do.

uronito commented 8 years ago

Hi another time jejeje

i have onkyo tx nr-646 and the plugin dont activate the avr and dont deactivate avr.

Thanks

Onkyo remote app is working

uronito commented 8 years ago

I have a modification for models 2015.

Your plugin works perfectly.

Thanks

toshibochan commented 8 years ago

I'm not home for a month, when I back I will test! Thanks for update!

uronito commented 8 years ago

In the last version if onkyo is unplugged from plug plugin crash.

Before launch onkyo.Connect should check httprequest.

Thanks

gw-wiscon commented 8 years ago

I know. The code needs a change, I need to build a PowerON / PowerOFF fucntion that checks the connectivity and connects if no connection exist, contains a try/catch block to catch errors, etc. Requires just some time.

uronito commented 8 years ago

0.1.31 don't crash if onkyo is unplugged but if onkyo is unplugged and turn on from plugin, homebridge change state to on and plugin log says Setting power On......... and is waiting

Thanks

gw-wiscon commented 8 years ago

Yeah, just solved the crash. Reconnect is another matter. The module I found is not very helpful.

Most likely need to switch to another one. Will see tomorrow.

uronito commented 8 years ago

http://jsfiddle.net/GSSCD/203/

whith this javascript can check if the ip onkyo is online and then connect to onkyo.

But would have implement Img Object in node.

Can you see?

Thanks

gw-wiscon commented 8 years ago

Did a major rewrite, can you test?

AppleTechy commented 8 years ago

Yep.

On Saturday, February 6, 2016, gw-wiscon notifications@github.com wrote:

Did a major rewrite, can you test?

— Reply to this email directly or view it on GitHub https://github.com/gw-wiscon/homebridge-onkyo-avr/issues/1#issuecomment-180736306 .

uronito commented 8 years ago

Hi gw wiscon,

Plugin crash at load.

[My Onkyo] Getting power state /usr/local/lib/node_modules/homebridge-onkyo-avr/index.js:87 this.log( "eventError: %s", error, response); ^ ReferenceError: error is not defined at Object.HttpStatusAccessory.eventError (/usr/local/lib/node_modules/homebr idge-onkyo-avr/index.js:87:30) at EventEmitter.emit (events.js:107:17) at command_to_iscp (/usr/local/lib/node_modules/homebridge-onkyo-avr/node_mo dules/eiscp/eiscp.js:185:18) at EventEmitter.self.command (/usr/local/lib/node_modules/homebridge-onkyo-a vr/node_modules/eiscp/eiscp.js:445:14) at Object.HttpStatusAccessory.getPowerState (/usr/local/lib/node_modules/hom ebridge-onkyo-avr/index.js:163:13) at HttpStatusAccessory.pollingtoevent.longpolling (/usr/local/lib/node_modul es/homebridge-onkyo-avr/index.js:63:9) at null._onTimeout (/usr/local/lib/node_modules/homebridge-onkyo-avr/node_mo dules/polling-to-event/index.js:77:5) at Timer.listOnTimeout (timers.js:110:15) root@DiskStation:/usr/local/lib/node_modules/homebridge-onkyo-avr/node_modules/e iscp# cd .. root@DiskStation:/usr/local/lib/node_modules/homebridge-onkyo-avr/node_modules#

uronito commented 8 years ago

Excuse plugin load well, i had write tx646 in config.json

The problem is when turn on onkyo or turn off, the plugin stops responding for about 30 seconds

if onkyo is unplugged, plugin crash

Thanks

gw-wiscon commented 8 years ago

which version did you load?

This looks like a problem, I already solved.

uronito commented 8 years ago

wowwwww!!!!!!

The plugin works perfect, but if the receiver is unplugged and send some command, the plugin stops responding (polling state) for 10 seconds or so

missing only if the receiver is unplugged and send the on command , the state returned Homebridge off , as you have achieved in the plug- philips

Thanksssss!!!!!!

AppleTechy commented 8 years ago

For some reason when I go to run it I get(My receiver is powered on an running when I started homebridge), [FR Onkyo AVR] Initializing OnkyoAVR accessory... [FR Onkyo AVR] start long poller.. [FR Onkyo AVR] Getting power state /usr/local/lib/node_modules/homebridge-onkyo-avr/index.js:87 this.log( "eventError: %s", error, response); ^

ReferenceError: error is not defined at Object.HttpStatusAccessory.eventError (/usr/local/lib/node_modules/homebridge-onkyo-avr/index.js:87:30) at emitOne (events.js:77:13) at EventEmitter.emit (events.js:169:7) at command_to_iscp (/usr/local/lib/node_modules/homebridge-onkyo-avr/node_modules/eiscp/eiscp.js:185:18) at EventEmitter.self.command (/usr/local/lib/node_modules/homebridge-onkyo-avr/node_modules/eiscp/eiscp.js:445:14) at Object.HttpStatusAccessory.getPowerState (/usr/local/lib/node_modules/homebridge-onkyo-avr/index.js:179:13) at HttpStatusAccessory.pollingtoevent.longpolling (/usr/local/lib/node_modules/homebridge-onkyo-avr/index.js:63:9) at null._onTimeout (/usr/local/lib/node_modules/homebridge-onkyo-avr/node_modules/polling-to-event/index.js:77:5) at Timer.listOnTimeout (timers.js:92:15)

AppleTechy commented 8 years ago

In my config I have this set { "accessory": "OnkyoAVR", "name": "FR Onkyo AVR", "ip_address": "192.168.1.40", "model" : "HT-RC270", "poll_status_interval": "900" } Did I do something wrong in my config?

uronito commented 8 years ago

hi,

the model must be: "TX-NR609"

you must be write "TX-NR609" in model.

AppleTechy commented 8 years ago

@uronito Ok. Why is that an included field in the config then?

uronito commented 8 years ago

For test purposes,

depend on the model eiscp.js must be modificated.

Can you test it and say me if works?

Thanks

AppleTechy commented 8 years ago

@uronito Test the plugin or modify the eisc.js to change the model?

uronito commented 8 years ago

test the plugin with modification of config.json-----> "model" : "TX-NR609"

Thanks

AppleTechy commented 8 years ago

@uronito Ok. I changed it in the config and it seems to be running smoothly.. Will there be an audio up/down function added?

AppleTechy commented 8 years ago

No issues but this is what is appearing in terminal as I have it polling every 60 sec [FR Onkyo AVR] Getting power state [FR Onkyo AVR] Event - Power message received: true [FR Onkyo AVR] setPowerState -- context: statuspoll, ignore, state: true [FR Onkyo AVR] PWR Q: false - null -- current state: true [Harmony Hub] Error refreshing status: TypeError: Cannot read property 'result' of undefined [FR Onkyo AVR] Getting power state [FR Onkyo AVR] Event - Power message received: true [FR Onkyo AVR] setPowerState -- context: statuspoll, ignore, state: true [FR Onkyo AVR] PWR Q: false - null -- current state: true [Harmony Hub] Error refreshing status: TypeError: Cannot read property 'result' of undefined [FR Onkyo AVR] Getting power state [FR Onkyo AVR] Event - Power message received: true [FR Onkyo AVR] setPowerState -- context: statuspoll, ignore, state: true [FR Onkyo AVR] PWR Q: false - null -- current state: true

uronito commented 8 years ago

is correct.

in config.json

change "poll_status_interval": "900"

AppleTechy commented 8 years ago

@uronito Does it make a difference for your purposes on how often I have it polling? And do you have an ETA when a volume function will be added?

uronito commented 8 years ago

No diferences.

In models 2015 the data packet is diferent.

I don't know anything about volume function.

Thanks

AppleTechy commented 8 years ago

@uronito I think you would have to set it as a dimming light switch. Not sure how the sonos plugin does it though

uronito commented 8 years ago

I think that the sonos plugin work as a switch.

uronito commented 8 years ago

Homekit don't have capabilities for a work as a complete remote controller

AppleTechy commented 8 years ago

@uronito I know but you could say turn on Onkyo volume up. This then would turn up the audio by 1 or what ever the user has set it in the config. Then this Light auto turns off in 2 sec. Then you can say the command again which then sends the command. You could even build in an accessory for Volume up 1 2 or 5 volume bumps

uronito commented 8 years ago

would can make it but i don't see any utility.

AppleTechy commented 8 years ago

@uronito For me the utility in it is I have a relative who has a hard time seeing and the ability for them to adjust the tv volume would by voice command would be helpful as they can't see the remote and therefore can't change the volume on the tv.

uronito commented 8 years ago

Is a good utility but i don't have a lot of time.

you can do it so.

It's not very difficult.

AppleTechy commented 8 years ago

@uronito Can you point me in the right path to where I would add that? I don't have a ton of coding experience but willing to give it a try. I would make it a preset accessory and can I tell it to auto turn off after x amount of seconds?

AppleTechy commented 8 years ago

@uronito When I tried to use Charles Proxy to intercept any data between the mobile app and the receiver all I got was the initial connection?

uronito commented 8 years ago

hi gw wiscon,

if onkyo is unplugged and run homebridge, homebridge crash

Homebridge is running on port 51826. [My Philips TV] Polling [My Philips TV] Getting power state [My Onkyo] Getting power state /usr/local/lib/node_modules/homebridge-onkyo-avr/index.js:87 this.log( "eventError: %s", error, response); ^ ReferenceError: error is not defined at Object.HttpStatusAccessory.eventError (/usr/local/lib/node_modules/homebridge-onkyo-avr/index.js:87:30) at EventEmitter.emit (events.js:107:17) at /usr/local/lib/node_modules/homebridge-onkyo-avr/node_modules/eiscp/eiscp.js:413:10 at /usr/local/lib/node_modules/homebridge-onkyo-avr/node_modules/eiscp/node_modules/async/lib/async.js:987:13 at Immediate.q.process as _onImmediate at processImmediate as _immediateCallback root@DiskStation:/usr/local/lib/node_modules/homebridge-onkyo-avr/node_modules/eiscp#

In model tx-nr646 (models 2015) , have to change eiscp.js :

iscp_msg = new Buffer(data + '\x1A\x0d\x0a');

the rest works perfect

Regards

gw-wiscon commented 8 years ago

This looks like an error in the log statement. Let me check the code.

gw-wiscon commented 8 years ago

The line should be: this.log( "eventError: %s", response);

Can you try?

uronito commented 8 years ago

of course

giveme a minute

gw-wiscon commented 8 years ago

By the way, you have a Windows PC, an Onkyo AVR and a Philips TV?

uronito commented 8 years ago

wow, runs perfect now. The only thing if onkyo is unplugged and turn on in the plugin, don't get false state of power, it shown power on in homebridge.

Yes i have onkyo winpc and philipstv

Your 3 plugin :)

Regards

uronito commented 8 years ago

By the way, winpc runs perfect!!!!!!!