Page 2 of 6

Re: Onkyo Reciver RS232 plugin

Posted: Wed Oct 08, 2008 10:57 pm
by Bartman
I converted the plugin to the new eg.SerialThread. Still some questions though but I have to get some sleep now.
It does trigger events but I don't know how wait for the terminator symbol so most data is torn in two parts.

Re: Onkyo Reciver RS232 plugin

Posted: Thu Oct 09, 2008 3:24 pm
by Bitmonster
If the messages have a fixed length, you can simply do .Read(length, timeout) inside the callback. If you can only find the end by searching for the terminator, you better read the bytes one by one. The callback will be called again, if not all chars have been consumed. So for a newline terminated event it should look like this:

Code: Select all

def MyReceiveCallback(self, serial):
    buffer = ""
    while True:
        b = serial.Read(1, 0.1)
        if b == "\n":
            self.TriggerEvent(buffer)
            return
        elif b == "":
            # nothing received inside timeout, possibly indicates erroneous data
            return
        buffer += b

Re: Onkyo Reciver RS232 plugin

Posted: Thu Oct 09, 2008 8:34 pm
by Bartman
I added a basic event evaluation and added some additional commands.

It seems that EG takes a few additional seconds to shutdown?!?!

Re: Onkyo Reciver RS232 plugin

Posted: Thu Oct 09, 2008 9:22 pm
by Bitmonster
Bartman wrote:It seems that EG takes a few additional seconds to shutdown?!?!
Are you sure, no other plugin or program has tried to access the COM port?

Re: Onkyo Reciver RS232 plugin

Posted: Thu Oct 09, 2008 9:51 pm
by Bartman
Bitmonster wrote:
Bartman wrote:It seems that EG takes a few additional seconds to shutdown?!?!
Are you sure, no other plugin or program has tried to access the COM port?
Isn't the access exclusiv by eg? At least I don't know of any programs.

Re: Onkyo Reciver RS232 plugin

Posted: Thu Oct 09, 2008 9:53 pm
by Bitmonster
Well, I'm not sure if the code handles errors right in the moment. They might be silently ignored and the thread might then get blocked.

Re: Onkyo Reciver RS232 plugin

Posted: Sat Dec 27, 2008 5:02 am
by Livin
Bartman,
did you get it working with the 805?
Any mods required? If yes, can you please post?

thx!

Re: Onkyo Reciver RS232 plugin

Posted: Mon Dec 29, 2008 12:20 am
by Livin
I tried using this via a USB->serial adapter... does not seem to work?

Anyone try this?

Re: Onkyo Reciver RS232 plugin

Posted: Mon Dec 29, 2008 4:13 pm
by Bartman
Livin wrote:I tried using this via a USB->serial adapter... does not seem to work?

Anyone try this?
I am using a adapter and it works flawlessly. In fact I never used a "real" serial port.
The adapter is transparent for the software.
Try if it works with other software like Hyperterminal.

Re: Onkyo Reciver RS232 plugin

Posted: Mon Dec 29, 2008 4:51 pm
by Livin
Bartman wrote:
Livin wrote:I tried using this via a USB->serial adapter... does not seem to work?

Anyone try this?
I am using a adapter and it works flawlessly. In fact I never used a "real" serial port.
The adapter is transparent for the software.
Try if it works with other software like Hyperterminal.
I should have clarified... EG sees the COM3 (the port with the adapter) but the receiver does not do anything when EG sends the commands. I have specifically tried to turn on Zone2 and set the Zone2 Input. I'll try some other things.

Is there a way to ensure EG is communicating with the Onkyo (like a debug mode) before I spend a ton of time trying other things?
... and/or is there a way to quickly use hyperterminal to check the comms?

thx

Re: Onkyo Reciver RS232 plugin

Posted: Mon Dec 29, 2008 4:54 pm
by Bartman
You can easily setup hypterterminal creating a new connection
Change the bitrate to 9600.
The turn the volume up or down and you should see some input.

Re: Onkyo Reciver RS232 plugin

Posted: Mon Jan 05, 2009 3:28 am
by Livin
not able to get it working... maybe it is the usb2serial adapter... I'll get a new one and try again.

Re: Onkyo Reciver RS232 plugin

Posted: Mon Jan 05, 2009 5:32 pm
by Bartman
wait.
There seems to be a bug in some of the plugins preventing the creation of new instances.

http://www.eventghost.org/forum/viewtop ... f=4&t=1185
do you get the same message?

Re: Onkyo Reciver RS232 plugin

Posted: Tue Jan 06, 2009 1:17 am
by Livin
I posted in the link you pasted in.

are you planning on putting out a new version that fixes the issues I posted?

Re: Onkyo Reciver RS232 plugin

Posted: Tue Jan 06, 2009 1:49 am
by Livin
Let me know when you put out a new build and I'll try it... thx