Hello!
I'm using the IRTrans C shared libray in my home automation software to access IRTrans. (The ethernet version was used.)
I use the function ReceiveIR(socket) in a loop to receive IR comands. At startup time I once call ConnectIRTransServer(socket) for initialization.
Everything then works fine, but when the first IR comand comes in after a long while with no IR comand beeing send(> 2 hours), then the first comand is not received by ReceiveIR(), that means, it does not return. A second press of the IR remote then leads to the correct result and subsequent calls are also working fine until again, a long pause with no IR signals happen. Then the first press is ignored again.
For the first press, to "wake-up" the system it does not matter which IR comand it is, a command not in the database also works.
I found the following workaround for this issue:
In the loop I connect to the server, wait with a pselect and a timeout of some seconds on the socket, call ReceiverIR() or when the time out happened close the connection to the server by DisconnectIRTransServer() and open the connection again.
So, with repeative opening and closing the connection, the issue of the first IR comand beeing ignored is gone.
Now, my question is, how this behaviour can be explained and if there might be a proper solution?
Regards,
--Alex