OnkyoISCP plugin

Do you have questions about writing plugins or scripts in Python? Meet the coders here.
MarkMash1ne
Posts: 4
Joined: Thu Dec 03, 2015 7:34 pm

Re: OnkyoISCP plugin

Post by MarkMash1ne » Thu Dec 03, 2015 7:38 pm

Hello Users,

I can not continue with the plugin.
When I use the Onkyo Remote I receive messages in EventGhost. If I send commands to my Onkyo AVR 636, nothing happens.
The app NRControl works well with manual commands.

Has anyone any idea what's going on?

greetings

MarkMash1ne
Posts: 4
Joined: Thu Dec 03, 2015 7:34 pm

Re: OnkyoISCP plugin

Post by MarkMash1ne » Tue Dec 08, 2015 12:11 am

With this change in the script works sending commands with my new Onkyo, but not permanently.
onkyoiscpscripz.PNG
if you do nothing, breaks after a maximum of one minute from the connection. it works again at the restart of EventGhost.
onkyoiscperror1.PNG

WoLpH
Experienced User
Posts: 96
Joined: Mon Dec 10, 2012 3:57 am

Re: OnkyoISCP plugin

Post by WoLpH » Tue Dec 08, 2015 11:43 am

That's a bit weird, with the current code it always reconnects without an issue for me. And that fix is also a bit strange... does that Onkyo use a different protocol somehow?
Author of the book Mastering Python. Got Python questions? Perhaps I can help :)

MarkMash1ne
Posts: 4
Joined: Thu Dec 03, 2015 7:34 pm

Re: OnkyoISCP plugin

Post by MarkMash1ne » Tue Dec 08, 2015 4:30 pm

It now works with this modification. But that is stupid and makes me crazy that EC after a short time again reporting an interruption of the connection on port 60128.
I've attempts WLAN and LAN. The connection is not stable, as if something interferes.

When sending a code example MVLUP, I can click on "test" 30x, nothing happens, and suddenly the connection is back and many Commandos go on once. And then again interrupted connection. Very strange.

The same phenomenon I have with the TCP plugins if I want to receive from smartfone TCP Events.
I do not know enough about TCP, can not solve the problem.

MarkMash1ne
Posts: 4
Joined: Thu Dec 03, 2015 7:34 pm

Re: OnkyoISCP plugin

Post by MarkMash1ne » Tue Dec 08, 2015 7:04 pm

Sorry, but I have found the mistake in my System.
My suspicion was confirmed. I have now installed the correct network driver for my Realtek chip manually. The connection will now remain stable.
So the plugin works definite with the modification in the photo above in my post. :mrgreen:
I will still continue testing.

WoLpH
Experienced User
Posts: 96
Joined: Mon Dec 10, 2012 3:57 am

Re: OnkyoISCP plugin

Post by WoLpH » Wed Dec 09, 2015 1:11 am

Well, apparently you're not the first one with the issue: https://github.com/mikerodrigues/onkyo_ ... y/issues/8

Apparently the TX-NR636 implements the protocol slightly stricter. I'll have to test your patch to make sure it won't break for other systems... or perhaps I can make it configurable but I don't have enough time for that right now.

I'm tracking the issue on Github currently: https://github.com/WoLpH/EventGhost-Onk ... n/issues/1
Author of the book Mastering Python. Got Python questions? Perhaps I can help :)

Tomkun
Posts: 22
Joined: Wed Sep 14, 2011 4:40 am

Re: OnkyoISCP plugin

Post by Tomkun » Wed Dec 16, 2015 11:35 pm

WoLpH wrote:Well, apparently you're not the first one with the issue: https://github.com/mikerodrigues/onkyo_ ... y/issues/8

Apparently the TX-NR636 implements the protocol slightly stricter. I'll have to test your patch to make sure it won't break for other systems... or perhaps I can make it configurable but I don't have enough time for that right now.

I'm tracking the issue on Github currently: https://github.com/WoLpH/EventGhost-Onk ... n/issues/1
It doesn't work with the NR-646 either. Is there a version we can use to test, or can you show us how to edit it so that it will work?

WoLpH
Experienced User
Posts: 96
Joined: Mon Dec 10, 2012 3:57 am

Re: OnkyoISCP plugin

Post by WoLpH » Thu Dec 17, 2015 2:41 pm

Tomkun wrote:
WoLpH wrote:Well, apparently you're not the first one with the issue: https://github.com/mikerodrigues/onkyo_ ... y/issues/8

Apparently the TX-NR636 implements the protocol slightly stricter. I'll have to test your patch to make sure it won't break for other systems... or perhaps I can make it configurable but I don't have enough time for that right now.

I'm tracking the issue on Github currently: https://github.com/WoLpH/EventGhost-Onk ... n/issues/1
It doesn't work with the NR-646 either. Is there a version we can use to test, or can you show us how to edit it so that it will work?
You can try the new version: https://github.com/WoLpH/EventGhost-Onkyo-ISCP-plugin
Author of the book Mastering Python. Got Python questions? Perhaps I can help :)

Tomkun
Posts: 22
Joined: Wed Sep 14, 2011 4:40 am

Re: OnkyoISCP plugin

Post by Tomkun » Fri Dec 18, 2015 6:12 am

Excellent, thanks so much. The test version appears to be working great!

blaher
Experienced User
Posts: 494
Joined: Thu Nov 17, 2011 1:27 am

Re: OnkyoISCP plugin

Post by blaher » Wed Dec 23, 2015 4:47 am

WoLpH wrote:
Tomkun wrote:
WoLpH wrote:Well, apparently you're not the first one with the issue: https://github.com/mikerodrigues/onkyo_ ... y/issues/8

You can try the new version: https://github.com/WoLpH/EventGhost-Onkyo-ISCP-plugin
It still works with my Integra DHC-9.9 too, thanks.

Mastiff
Experienced User
Posts: 872
Joined: Thu May 03, 2012 10:43 am

Re: OnkyoISCP plugin

Post by Mastiff » Sat Feb 25, 2017 9:42 am

I have a problem that kills EventGhost. I had it a lot before (when I had network problems with my Onkyo, which was fixed on the warranty), but now I have it occasionally. But it's very bad when it happens because my whole house audio system goes down, and so does the control of heating in the house, so if I don't catch it soon I can wake up to a very cold living room, like I did last weekend. Yesterday I found out that the Onkyo plug-in is the source. When something happens on the connection to the Onkyo (I don't know exactly what) I get red error messages all the way down the logger, and EG locks up:

Code: Select all

2017-02-24 22:54:25  ERROR: OnkyoISCP: [Errno 10054] En eksisterende tilkobling ble tvangslukket av den eksterne verten
2017-02-24 22:54:25  ERROR: OnkyoISCP: [Errno 10054] En eksisterende tilkobling ble tvangslukket av den eksterne verten
2017-02-24 22:54:25  ERROR: OnkyoISCP: [Errno 10054] En eksisterende tilkobling ble tvangslukket av den eksterne verten
2017-02-24 22:54:25  ERROR: OnkyoISCP: [Errno 10054] En eksisterende tilkobling ble tvangslukket av den eksterne verten
2017-02-24 22:54:25  ERROR: OnkyoISCP: [Errno 10054] En eksisterende tilkobling ble tvangslukket av den eksterne verten
2017-02-24 22:54:25  ERROR: OnkyoISCP: [Errno 10054] En eksisterende tilkobling ble tvangslukket av den eksterne verten
2017-02-24 22:54:25  ERROR: OnkyoISCP: [Errno 10054] En eksisterende tilkobling ble tvangslukket av den eksterne verten
In English that would be "An excisting connection was forcibly closed by external host".

The only way to stop it is to either kill the process or restart the automation VM. Is it possible to get some kind of error handling of that? Please?

WoLpH
Experienced User
Posts: 96
Joined: Mon Dec 10, 2012 3:57 am

Re: OnkyoISCP plugin

Post by WoLpH » Sun Feb 26, 2017 12:51 pm

Luckily the error codes are universal, 10054 is a very common one and officially translates to "Connection reset by peer.". Having that said... looks like your hardware is still broken but that obviously doesn't fix your issue and even if it's partially broken it shouldn't kill EventGhost.

Having that said... I don't think I can easily fix this, mostly because I cannot easily reproduce it myself and I'm not sure why this is happening. The code shouldn't keep repeating this, it should try once or maybe twice and stop trying after that.
Author of the book Mastering Python. Got Python questions? Perhaps I can help :)

Mastiff
Experienced User
Posts: 872
Joined: Thu May 03, 2012 10:43 am

Re: OnkyoISCP plugin

Post by Mastiff » Sun Feb 26, 2017 12:59 pm

it is kind of weird because while this was still going on (after a few seconds I understood that it wasn't going to work with the IR remote that fires the command in EG) I was able to connect to the same receiver from the app and change the input from that instead. So the app worked while the plug-in said that the host closed the connection. But I can't reproduce it on will either, having the app connected or not. I only know it's not in the app, and it's not in the network connection to the automation virtual machine, because I was able to check with VNC what was going on. So something made EG go into loop. Would it be possible to limit connection attempts to a fixed number, so it doesn't get into this loop? I have a five second timeout, btw, if that matters.

User avatar
topix
Experienced User
Posts: 441
Joined: Sat May 05, 2007 3:43 pm
Location: Germany
Contact:

Re: OnkyoISCP plugin

Post by topix » Mon Feb 27, 2017 5:01 pm

I had a short look at the plugin code on github. I'm not sure if python sockets are thread safe. Maybe it could have something to do with the problems?

And regarding the 10054, maybe check for it and as Mastiff suggested, try for a limited (configurable?) number to reconnect (with a wait time between attempts?).

WoLpH
Experienced User
Posts: 96
Joined: Mon Dec 10, 2012 3:57 am

Re: OnkyoISCP plugin

Post by WoLpH » Mon Feb 27, 2017 7:39 pm

You could try lowering the timeout a bit, I would assume that anything taking more than a few milliseconds is too much already but 1s might be safer.

Can you make certain it's not firing the event multiple times? I have actually seen it happen a few times over here as well, the last few years but it's never warranted a further look for me.
Author of the book Mastering Python. Got Python questions? Perhaps I can help :)

Post Reply