Sending codes directly to IRTrans serial port

Software related support

Moderator: marcus

Sending codes directly to IRTrans serial port

Postby motorollin » Sat 3. Jan 2009, 10:43

Hi

I'm developing a custom home automation application and want the IRTrans to control it. My Mac sees the IRTrans (v3.6) as a serial port. In RealBasic I can open the port and receive data when I press a button on a remote. The data looks something like "S01110110100010010010000011011111320". If I send the same string back to the serial port for the IRTrans, nothing happens and the port returns "E" (I guess "error").

Can anyone explain what I'm doing wrong?

TIA
motorollin
 
Posts: 6
Joined: Sat 3. Jan 2009, 10:38

Re: Sending codes directly to IRTrans serial port

Postby IRTrans » Sat 3. Jan 2009, 13:56

Hi,
that is not the way to control the IRTrans devices. The "S01110110100010010010000011011111320" is only the data part of the IR Code.
To send a code the complete timing information has to be known. The complete (binary) interface is very complex.

We therefore suggest to use one of the IRTrans software applications (iRed or irserver) to talk to the IRTrans devices.
The irserver application also contains APIs for own programms to control the IRTrans.

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

Re: Sending codes directly to IRTrans serial port

Postby motorollin » Sat 3. Jan 2009, 14:30

Hi

Thanks for the information. I was originally going to use iRed for this but I can't work out how to read what the IRTrans has received through the TCPSocket. My app connects to the iRed server on port 8765 and can send IR codes, but can't read button presses coming in to the IRTrans. That's why I decided to try to code it myself, though it looks like this will not be possible.

Do you know whether it is possible for iRed to report back to the TCP socket what codes it has received?

Thanks again.
motorollin
 
Posts: 6
Joined: Sat 3. Jan 2009, 10:38

Re: Sending codes directly to IRTrans serial port

Postby IRTrans » Sat 3. Jan 2009, 16:37

Hi,
try port 21000 of iRed. This port should give you the IRTrans client protocol.

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

Re: Sending codes directly to IRTrans serial port

Postby motorollin » Sat 3. Jan 2009, 17:01

Thanks. I have just created a socket in my app to localhost:21000 and it connects successfully, but no data is ever received when I press buttons on the remote. I have tested a button which is already learned and bound to a button in iRed. Is there anything else I need to do to get iRed to pass information about button presses to the client?
motorollin
 
Posts: 6
Joined: Sat 3. Jan 2009, 10:38

Re: Sending codes directly to IRTrans serial port

Postby IRTrans » Sat 3. Jan 2009, 18:18

Hmm, no idea.

iRed is not written by ourselfs, therefore we can only guess here.

You might contact the iRed team (you got the Email with your iRed licence mail).

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

Re: Sending codes directly to IRTrans serial port

Postby motorollin » Sat 3. Jan 2009, 18:26

Ok, I will contact them. Many thanks for all your help!
motorollin
 
Posts: 6
Joined: Sat 3. Jan 2009, 10:38

Re: Sending codes directly to IRTrans serial port

Postby motorollin » Sun 4. Jan 2009, 13:43

I contacted Robert Fischer, author of iRed, and he said that port 21000 is for sending commands *to* iRed only, not for reading stuff back. So I don't know what the difference is between that port and the one which you configure on the Network tab of iRed preferences (default 8765).
motorollin
 
Posts: 6
Joined: Sat 3. Jan 2009, 10:38

Re: Sending codes directly to IRTrans serial port

Postby IRTrans » Sun 4. Jan 2009, 16:51

As I do not know the internal of iRed I can only tell you how it normally works:

Port 21000 is the IRTrans Control port. It uses the IRTrans protocol.

Port 8765 is the LIRC port. It uses the LIRC protocol.

I cannot tell you why there is no info about received codes on that ports when using iRed.

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

Re: Sending codes directly to IRTrans serial port

Postby motorollin » Sun 4. Jan 2009, 17:35

I had another reply from Robert and he explained that port 21000 is used between iRed and the IRTrans, and port 8765 is used for external control of iRed. I think this is what I had misunderstood. Anyway, I am using a USB IRTrans so port 21000 isn't useful to me.

I have worked around the problem using an undocumented feature of iRed which allows you to call a command line program when iRed receives something. It passes the name of the received button to this program. I wrote a small C program which is executed when iRed receives something, parses the button name, opens a socket to my application, and sends the name of the button. This way iRed can tell my application what button was pressed.
motorollin
 
Posts: 6
Joined: Sat 3. Jan 2009, 10:38


Return to Software

Who is online

Users browsing this forum: No registered users and 44 guests