ReceiveIR not working for the first IR comand after pause

The place where software developers meet

Moderator: marcus

ReceiveIR not working for the first IR comand after pause

Postby alexirion » Sat 6. Nov 2010, 16:17

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
alexirion
 
Posts: 9
Joined: Sat 6. Nov 2010, 15:48

Re: ReceiveIR not working for the first IR comand after pause

Postby IRTrans » Sat 6. Nov 2010, 18:05

Hi,
so far we do not know this problem.

Does the irserver show the IR Codes in "Detected IR Commands" ?

IRTrans
IRTrans
Administrator
 
Posts: 2115
Joined: Mon 21. Apr 2008, 23:32

Re: ReceiveIR not working for the first IR comand after pause

Postby alexirion » Sun 7. Nov 2010, 13:15

Hello,

I'm running under ubuntu server. I now set the options -loglevel 4 -debug_code -timestamp to get the ir comands logged by the server. I let you know about the logs, when I reproduced the problem.

Regards,
--Alex
alexirion
 
Posts: 9
Joined: Sat 6. Nov 2010, 15:48

Re: ReceiveIR not working for the first IR comand after pause

Postby alexirion » Sun 7. Nov 2010, 16:03

Hello!

now, I reproduced the issue and added the server logs - see at the end. Apparently adding it as attachment resulted in the error message: This file extension is not allowed.

At 16:42:32 I pressed the remote for sending the comand shutterrearup from remote groundcontrol.
The logs show, that this comand was not received by the server - instead there is the following line:

2010-11-07 16:42:32.724 IRTRans LAN IRSend ACK: 230

What does this mean?

At 16:42:34 I send the comand rolloup from remote groundcontrol - it was succefully detected by the server.

The same for the following comand shutterrearup from remote groundcontrol.

Regards,
--Alex

Server log:
2010-11-07 14:10:12.943 Init Server Socket done
2010-11-07 14:10:12.943 IRServer Version 6.03.02
2010-11-07 14:10:12.943 Init Events done
2010-11-07 14:10:12.974 Name : IRTrans LAN
2010-11-07 14:10:12.974 Version: E6.04.40
2010-11-07 14:10:12.974 FW SNo : 43906
2010-11-07 14:10:12.974 Capab : Power On; Dual Transmitter Drivers; 128KB IR Flash;
2010-11-07 14:10:12.974 FW Cap : 0x1186171
2010-11-07 14:10:12.974 FW Cap2: 0xc95a1c63
2010-11-07 14:10:12.974 USB SNo: 00-22-3e-07-00-1d
2010-11-07 14:10:12.974 Node : 192.168.178.101

2010-11-07 14:10:12.974 Init communication ...
2010-11-07 14:10:12.976 [ 0]: IRTrans LAN : IR VER: E6.04.40 ETH VER: L1.07.50 SN: 43906
MAC:00-22-3e-07-00-1d IP Addr: 192.168.178.101
2010-11-07 14:10:12.976 Chdir to DB OK
2010-11-07 14:10:12.976 Read routing OK
2010-11-07 14:10:12.976 Read Switches OK
2010-11-07 14:10:12.976 Open DIR: 0
2010-11-07 14:10:12.976 Get Dirent: 224
2010-11-07 14:10:12.976 Remote azur650r compiled:2010-11-07 14:10:12.976 1 Timings - 2010-11-07 14:10:12.976 4 Commands
2010-11-07 14:10:12.977 Remote mediacenter compiled:2010-11-07 14:10:12.977 1 Timings - 2010-11-07 14:10:12.977 2 Commands
2010-11-07 14:10:12.977 Remote groundcontrol compiled:2010-11-07 14:10:12.977 1 Timings - 2010-11-07 14:10:12.977 20 Commands
2010-11-07 14:10:12.987 Remote ptae4000 compiled:2010-11-07 14:10:12.987 3 Timings - 2010-11-07 14:10:12.987 2 Commands
2010-11-07 14:10:12.987 Get Dirent: 0
2010-11-07 14:10:12.987 Total: 4 Remotes - 6 Timings - 28 Commands - 0 Calib. Commands
2010-11-07 14:10:12.987 0 Togglec. - 2 CCF Data - 0 CCF RAW - 0 CCF Error
2010-11-07 14:10:48.313 [0.0] shutterrightdown groundcontrol
2010-11-07 14:11:26.496 [0.0] shutterrearup groundcontrol
2010-11-07 14:11:29.646 [0.0]: 10010000001101 14
2010-11-07 14:49:27.885 IRTRANS TCP/IP Socket connection request
2010-11-07 14:49:27.885 IRTRANS TCP/IP Client 0 accepted from 127.0.0.1
2010-11-07 14:49:27.886 IRTRANS TCP/IP Socket connection request
2010-11-07 14:49:27.887 IRTRANS TCP/IP Client 1 accepted from 127.0.0.1
2010-11-07 14:50:13.795 Client [0] disconnect
2010-11-07 14:50:13.795 Client [1] disconnect
2010-11-07 14:50:22.205 IRTRANS TCP/IP Socket connection request
2010-11-07 14:50:22.205 IRTRANS TCP/IP Client 0 accepted from 127.0.0.1
2010-11-07 14:50:22.206 IRTRANS TCP/IP Socket connection request
2010-11-07 14:50:22.206 IRTRANS TCP/IP Client 1 accepted from 127.0.0.1
2010-11-07 14:51:27.715 Client [0] disconnect
2010-11-07 14:51:27.715 Client [1] disconnect
2010-11-07 14:51:35.555 IRTRANS TCP/IP Socket connection request
2010-11-07 14:51:35.555 IRTRANS TCP/IP Client 0 accepted from 127.0.0.1
2010-11-07 14:51:35.556 IRTRANS TCP/IP Socket connection request
2010-11-07 14:51:35.556 IRTRANS TCP/IP Client 1 accepted from 127.0.0.1
2010-11-07 15:38:02.506 Client [0] disconnect
2010-11-07 15:38:02.506 Client [1] disconnect
2010-11-07 15:38:49.915 IRTRANS TCP/IP Socket connection request
2010-11-07 15:38:49.915 IRTRANS TCP/IP Client 0 accepted from 127.0.0.1
2010-11-07 15:38:49.916 IRTRANS TCP/IP Socket connection request
2010-11-07 15:38:49.916 IRTRANS TCP/IP Client 1 accepted from 127.0.0.1
2010-11-07 15:39:00.975 Client [0] disconnect
2010-11-07 15:39:00.975 Client [1] disconnect
2010-11-07 15:39:57.365 IRTRANS TCP/IP Socket connection request
2010-11-07 15:39:57.365 IRTRANS TCP/IP Client 0 accepted from 127.0.0.1
2010-11-07 15:39:57.366 IRTRANS TCP/IP Socket connection request
2010-11-07 15:39:57.366 IRTRANS TCP/IP Client 1 accepted from 127.0.0.1
2010-11-07 16:42:32.724 IRTRans LAN IRSend ACK: 230
2010-11-07 16:42:34.964 [0.0] rolloup groundcontrol
2010-11-07 16:42:39.915 [0.0] shutterrearup groundcontrol

2010-11-07 16:42:59.975 Network connection [0] closed
2010-11-07 16:42:59.975 Client [1] disconnect
alexirion
 
Posts: 9
Joined: Sat 6. Nov 2010, 15:48


Return to APIs

Who is online

Users browsing this forum: No registered users and 9 guests