| View previous topic :: View next topic |
| Author |
Message |
Polymorphic169
Joined: 25 Jan 2010 Posts: 2
|
Posted: Mon Jan 25, 2010 1:03 am Post subject: Windows and IR off the HDhomeRun |
|
|
Ok, so I'm trying to get the IR to actually be worth while on windows without some goofy install of lirc. So I wrote up a c# program to nab the packets coming off the hdhomerun. Problems is, they are ALWAYS different. I've tried now four remotes, and at least 5 or more bytes are different every time. I found a start and end bytes easy, its 0x00 and 0xC0. After that everything goes nuts. I thought it was a sequence so I recorded a bunch at once, nope, didn't work. Played back later and not a single remote code matched. I'm losing my mind!
| Code: | using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Sockets;
using System.Text;
namespace HDHomeRunIRLearn
{
class Program
{
private const int listenPort = 5000;
private static void StartListener()
{
bool done = false;
bool foundByte1 = false;
bool foundByte2 = false;
byte[] buffer = new byte[2048];
int bufferPointer = 0;
bool foundStart = false;
int startLocation = 0;
UdpClient listener = new UdpClient(listenPort);
IPEndPoint groupEP = new IPEndPoint(IPAddress.Any, listenPort);
try
{
while (!done)
{
Console.WriteLine("Waiting for broadcast");
byte[] bytes = listener.Receive(ref groupEP);
System.IO.File.AppendAllText("test.txt", Environment.NewLine);
for (int i = 0; i < bytes.Length; i++)
{
System.IO.File.AppendAllText("test.txt", Convert.ToString(bytes[i], 16) + ",");
Console.WriteLine(Convert.ToString(bytes[i], 2));
}
Console.WriteLine("Received broadcast from {0} :\n {1}\n",
groupEP.ToString(),
Encoding.ASCII.GetString(bytes, 0, bytes.Length));
}
}
catch (Exception e)
{
Console.WriteLine(e.ToString());
}
finally
{
listener.Close();
}
}
static void Main(string[] args)
{
StartListener();
//return 0;
}
}
} |
|
|
| Back to top |
|
 |
whurlston2
Joined: 07 Jan 2007 Posts: 1048
|
Posted: Tue Jan 26, 2010 5:59 am Post subject: |
|
|
| MCE remotes use "toggle bit" commands so they alternate. If you press a button 6 times, hits 1, 3 and 5 should be the same and hits 2, 4 and 6 should be the same. |
|
| Back to top |
|
 |
Polymorphic169
Joined: 25 Jan 2010 Posts: 2
|
Posted: Wed Jan 27, 2010 12:17 am Post subject: |
|
|
Remotes used
Samsung HDTV remote
Old 32" CRT remote
Computer remote (non-mce this thing is ancient)
Onkyo receiver remote
Also I captured well over 6 or more "remote packets" for each remote key, none of them ever matched. |
|
| Back to top |
|
 |
nickk Silicondust
Joined: 13 Jan 2004 Posts: 7979
|
Posted: Wed Jan 27, 2010 1:35 am Post subject: |
|
|
Hi,
The data is a sequence of 16-bit little-endian numbers with the following format:
Bit 15: high/low state.
Bits 14:0: duration of state in 0.1ms units.
ie basically run-length encoding with a 1-bit value field and a 15-bit length field.
From this you are draw the waveform and correlate.
Nick |
|
| Back to top |
|
 |
SFischer1
Joined: 29 Sep 2008 Posts: 1
|
Posted: Wed Mar 31, 2010 2:29 am Post subject: All for ONE and ONE for all, one remote company in the begin |
|
|
Hi,
Take a look around the JP1 forums and files.
Lots of device codes and other information there. You will be able to understand the IR remotes and how they do not interfere with other brands. That's why they all seem different.
My learning remote has been able to learn all the remotes I have and then I have been able to replace them all with just one (Four identical RCA RCU810s).
For your purposes you can set up a set of codes that will not interfere with other remotes.
http://www.hifi-remote.com/ofa/
http://www.hifi-remote.com/forums/
SHF |
|
| Back to top |
|
 |
NeoMatrixJR
Joined: 12 Aug 2010 Posts: 2
|
Posted: Thu Aug 12, 2010 10:55 pm Post subject: any luck |
|
|
| Any luck with this? |
|
| Back to top |
|
 |
|