Thursday, February 21, 2008

iPod touch home controller project PART 3

IR SERVER 

In order to separate interface from the IR engine, I'll use a socket connection between them.
The interface will open a socket to the server and write the IR code string.
On the other side, the server loads the IR module and listen for IR codes from the socket. When received, the code is sent to the IR module and blasted !
Here's a simple PHP script that sends an IR code to the socket server :


$fd = fsockopen('192.168.1.20', '9494',  $errno, $errstr, 30);
if ($fd) {
fwrite($fd, utf8_encode('0000 006C ... 0015 0E4A'));
}


This screenshot shows the debug output of the socket server running and intercepting this code.




The next step is the PHP client that will also store the codes in a database

2 comments:

Anonymous said...

Are you going to finish this? I am really interested in this because it would be a lot less expensive to get an ipod than a remote like this one:
http://us.marantz.com/Products/2181.asp

PoorRichardMutt said...

I'm working on a Mac Mini media center and I was planning on using an iPod touch as a remote for the mini. And it would be even better to use it for the TV too. Is there an adapter for Bluetooth to Infrared? Or another way to use an iPod touch as tv remote?