Page 1 of 1

Recommended Delay Between IR Codes

PostPosted: Thu 1. Jul 2010, 23:17
by rhodesy22
Hey,

I'm in the middle of creating software that sends multiple ir commands of which I can set an interval between them.

I keep sending commands too quickly after one another and it then freezes up the IR Trans unit leaving it unusable until I restart it by re-inserting the power.

It would be great if you had a known tolerance. I realise I could wait for "has space available" however that would be an unknown interval where as I need to use set intervals.

Thanks

Luke

Re: Recommended Delay Between IR Codes

PostPosted: Thu 1. Jul 2010, 23:18
by rhodesy22
P.S. I'm sending protocols via TCP.

Re: Recommended Delay Between IR Codes

PostPosted: Thu 1. Jul 2010, 23:52
by IRTrans
Hi,
which IRTrans Device are you using and how exactly are you sending codes ?

All protocols do support a status code. Once the status code has been received the next code can be sent.

Even if that is not done the IRTrans usually does not freeze.

IRTrans

Re: Recommended Delay Between IR Codes

PostPosted: Mon 5. Jul 2010, 13:00
by rhodesy22
Hi,

I'm using the IR Trans WiFi module and I'm making a TCP connection on port 21000.

As an example:

I learn a code for volume up on the TV.

I can then send the code I learnt back to the IR Trans.

I send this code back through the IR Trans 5 times at 0.1 second intervals.

I realise I can send code the first time, then wait for the response result or wait for the "Has Available Space" stream event, and then send the second code, but then I'm likely to get irregular intervals (which is very much undesired for the application I'm creating).

I'm looking for a more fluid action, so if for example you knew that it's won't ever allow me to send more than one code per 0.3 seconds, then I could put that limit in.

Thanks

Re: Recommended Delay Between IR Codes

PostPosted: Mon 5. Jul 2010, 13:17
by rhodesy22
After the IRTrans crashes, if I try and connect just via a terminal screen (telnet 192.168.1.3 21000) I either get a timeout of a connection refused.

Re: Recommended Delay Between IR Codes

PostPosted: Mon 5. Jul 2010, 14:07
by IRTrans
Hi,
the only way to handle this correctly is to wait for the result code. Using "Has available space" will not help either as that only refers to the sending side.

You cannot send IR Codes with constant delays as the IR Codes themselves have a different length.

Of course the device should not hang after you have sent to many codes. We will check why that happens. However, you will still need to wait for the result code.

IRTrans

Re: Recommended Delay Between IR Codes

PostPosted: Mon 5. Jul 2010, 14:14
by rhodesy22
Hey,

I've found out what the issue was. I was making a new connection to the irtrans with each command send and that was causing the overload/connection refusal. I now just setup the connection the one time, then when I send the code I check to see if it's already connect (if not it connects) then sends the code and processes the next code in the queue.

Thanks for your help!

Re: Recommended Delay Between IR Codes

PostPosted: Mon 5. Jul 2010, 14:38
by IRTrans
OK, then the device did not crash - you simply used up all TCP connections and did not close the ones no longer in use.

It will take some time (depending on the OS of your PC) until such connections are closed and the resources in the IRTrans can be used again.

IRTrans