View Full Version : Problems with IP and Scheduler plugins??

July 15th, 2012, 12:13 AM
Hoping the Girder Gurus out there might have some idea what is going on with this very strange issue I am having:

I use the Girder IP plugin to communicate with a TCP event sink that tells Girder what is going on inside Windows Media Center on my HTPC (http://vmccontroller.codeplex.com/releases/view/23251). Based on the MCE section I am in (movies, music, etc.) and the media state (play, pause, stop) I trigger various events to adjust lighting, sound modes, volume, etc. Been using this setup for a few years now and it works like a charm - most of the time!

The problem I am having is that every few hours now (the exact amount of time seems to be random), the IP connection from Girder to the MCE event sink seems to either drop or hang. If I manually re-initialize the connection in Girder, all is well again. I am having a very hard time isolating whether or not the problem is with Girder or not, but I am thinking it is since re-initializing the connection on the girder side fixes the problem every time and I never have to do anything on the HTPC/MCE side.

So, I thought I'd be smart and create a scheduled event to automatically re-initialize the IP connection in Girder every 15 minutes - to be sure that the IP connection remains up all the time. This seems to have created another issue that is even more strange - after a few hours, the scheduler seems to stop firing this event, even though it is set to run perpetually! End result...once the scheduler stops automatically re-initializing the IP connection for me, I eventually lose my connection to MCE and my HTPC automation stops working once again.

So now I have two issues to solve - fixing the IP issue would probably be the best option, but now I'm wondering if there are other issues with Girder going on here because I have never seen the scheduler behave this way (I use it for other timers that run perpetually and they all work just fine).

Can anyone suggest what I might check to resolve this IP connectivity (and scheduler) issue?

July 17th, 2012, 11:07 AM
Anyone have any ideas?

July 17th, 2012, 11:29 AM
No clue what problem you are having. Can you try installing Girder 5.1 ? (Into a different directory!)

July 17th, 2012, 09:13 PM
Hi Ron,

Before your response I re-installed the latest 5.0 build and re-built everything from scratch and that seems to have fixed the scheduler issue... but the IP connectivity issue remains. I can work around it with the schedule now but it still doesn't make sense why Girder would just drop the IP connection after a few hours with nothing to show in the logs...

Isn't 5.1 an alpha version at this point?

July 22nd, 2012, 09:17 PM
Any further suggestions Ron?

July 22nd, 2012, 09:47 PM
Could it be a timeout issue? Maybe the connection is dropping because of lack of data?

Did you try to put some debug output on the disconnect even on the Girder side?

July 23rd, 2012, 10:40 AM
Will girder timeout the connection if there is no data coming through after a certain period of time? That could definitely be the case because sometimes my HTPC could go for a couple of days without being used so for sure the connection will sit idle for long periods of time. Data is only sent to Girder if someone presses a button on the MCE remote. If Girder is set to automatically time out the connection, is there any way to prevent this from happening?

I am not much of a programmer... do I need to configure girder to output certain data to log files or do I need to add some lua code to produce this debug output?

July 23rd, 2012, 10:46 AM
that's probably our culprit. Can you just send a ping/pong message back and forth every now and again?

July 27th, 2012, 08:07 PM
I don't have any control over the MCE side... if nothing happens in MCE then nothing gets sent to girder. It is just an event sink, and by that I mean that the MCE side will not accept any input from Girder nor will it respond to anything Girder might send to it.

Would it be sufficient for Girder to just send a ping or something out without getting a response? Is so, do you have an example of lua code I can use to do this?

July 27th, 2012, 09:52 PM
I just had a thought, could it be that your server is being garbage collected by Lua? Are you holding a reference to it in the global namespace? Maybe post your code.

July 27th, 2012, 10:24 PM
LOL I have no iea what any of that means... as i said, my programming knowlege is limited :-)

i am attaching my code... other than the "if" statements, this is pretty much straight from the example in the user manual.


August 4th, 2012, 07:17 PM
Any further thoughts Ron? I've attached my code in the previous post. Thanks.

August 6th, 2012, 09:44 AM
can you change print(data) to print(data,code) and let it run for a bit and see if we get the disconnect or not.

August 10th, 2012, 09:02 PM
Thanks Ron, I've made the change. I haven't noticed any disconnect messages yet but I will keep monitoring it for a while.

Is there any way to increase the buffer in the lua console? It would be nice if I could scroll back further in time in the log window as I know I'm missing a lot of info especially after it runs overnight.

August 14th, 2012, 10:46 PM
Ron I've been monitoring this for several days now and I don't see any disconnect messages coming though. I guess that means the other end is just timing out then and Girder does not see this? Is there anything else I can check? I can confirm that the connections do eventually drop because if I have Girder re-establish the connection within a certain period of time before the first connection drops, I get a response back to Girder telling me that I have 2 connections active.

Do I need to live with my "workaround" of having Girder force a reconnect every few hours?

August 15th, 2012, 07:59 AM
Reconnecting every few hours looks like a good solution.

August 15th, 2012, 09:28 PM
Ok thanks for your help.