Your Universal Remote Control Center
RemoteCentral.com
Everything Else Forum - View Post
Previous section Next section Up level
Up level
The following page was printed from RemoteCentral.com:

Login:
Pass:
 
 

Topic:
Problems sending codes to Xfinity Box
This thread has 5 replies. Displaying all posts.
Post 1 made on Sunday December 18, 2016 at 22:54
mrage87
Lurking Member
Joined:
Posts:
November 2016
3
Hi guys

I'm trying to build a simple remote on an arduino uno using raw codes and the iremote library for my brother who has cerebral palsy.
Basically what happens is you push a button and it sends 4 button presses (3 digit channel number and ok/enter) from a list of pre programmed channels he likes.

The weird issue I'm having is that even though I've copied the codes for the xr2 remote and they work perfectly on my box they do not work on the box on his tv.
The codes original came from this site and also [Link: irdb.tk]. I had to convert the hex to raw format.

I believe his box is a PA PX001ANM and mine is a PA PR150BNM according to the xfinity website

I have the ir led literally an inch away in both tests but his box seems to only receive one or two of the button presses randomly.
I have no idea why his box would have such a huge issue. I would assume that since I'm repeating codes from a remote that works on both boxes there shouldn't be any compatibility issues.
Hopefully someone here has an idea because this is all way over my head at this point


Here is everything I have currently. I only have basic programming skills and this is the first time doing anything involving circuitry so please forgive me if there is a glaring issue somewhere.

My arduino setup is basicly 3 PWM -> 100 ohm resistor -> 38 khz ir led -> Ground

Codes copied from here and irdb that work on my box
unsigned int btn1[36] = {210, 896, 210, 1712, 210, 760, 210, 2800, 210, 1304, 210, 1304, 210, 1168, 210, 2664, 210, 13800, 210, 896, 210, 2664, 210, 760, 210, 760, 210, 760, 210, 896, 210, 760, 210, 760, 210, 80400};
unsigned int btn2[36] = {210, 896, 210, 1712, 210, 760, 210, 2800, 210, 1304, 210, 1304, 210, 1168, 210, 2664, 210, 13800, 210, 896, 210, 2528, 210, 760, 210, 760, 210, 760, 210, 1032, 210, 760, 210, 760, 210, 80400};
unsigned int btn3[36] = {210, 896, 210, 1712, 210, 760, 210, 2800, 210, 1304, 210, 1304, 210, 1168, 210, 2664, 210, 13800, 210, 896, 210, 2392, 210, 760, 210, 760, 210, 760, 210, 1168, 210, 760, 210, 760, 210, 80400};
unsigned int btn4[36] = {210, 896, 210, 1712, 210, 760, 210, 2800, 210, 1304, 210, 1304, 210, 1168, 210, 2664, 210, 13800, 210, 896, 210, 2256, 210, 760, 210, 760, 210, 760, 210, 1304, 210, 760, 210, 760, 210, 80400};
unsigned int btn5[36] = {210, 896, 210, 1712, 210, 760, 210, 2800, 210, 1304, 210, 1304, 210, 1168, 210, 2664, 210, 13800, 210, 896, 210, 2120, 210, 760, 210, 760, 210, 760, 210, 1440, 210, 760, 210, 760, 210, 80400};
unsigned int btn6[36] = {210, 896, 210, 1712, 210, 760, 210, 2800, 210, 1304, 210, 1304, 210, 1168, 210, 2664, 210, 13800, 210, 896, 210, 1984, 210, 760, 210, 760, 210, 760, 210, 1576, 210, 760, 210, 760, 210, 80400};
unsigned int btn7[36] = {210, 896, 210, 1712, 210, 760, 210, 2800, 210, 1304, 210, 1304, 210, 1168, 210, 2664, 210, 13800, 210, 896, 210, 1848, 210, 760, 210, 760, 210, 760, 210, 1712, 210, 760, 210, 760, 210, 80400};
unsigned int btn8[36] = {210, 896, 210, 1712, 210, 760, 210, 2800, 210, 1304, 210, 1304, 210, 1168, 210, 2664, 210, 13800, 210, 896, 210, 1712, 210, 760, 210, 760, 210, 760, 210, 1848, 210, 760, 210, 760, 210, 80400};
unsigned int btn9[36] = {210, 896, 210, 1712, 210, 760, 210, 2800, 210, 1304, 210, 1304, 210, 1168, 210, 2664, 210, 13800, 210, 896, 210, 1576, 210, 760, 210, 760, 210, 760, 210, 1984, 210, 760, 210, 760, 210, 80400};
unsigned int btn0[36] = {210, 896, 210, 1712, 210, 760, 210, 2800, 210, 1304, 210, 1304, 210, 1168, 210, 2664, 210, 13800, 210, 896, 210, 2664, 210, 760, 210, 760, 210, 760, 210, 896, 210, 760, 210, 760, 210, 80400}; // not actual code - test
unsigned int btnEnter[36] = {210, 896, 210, 1712, 210, 760, 210, 2800, 210, 1304, 210, 1304, 210, 1168, 210, 2664, 210, 13800, 210, 896, 210, 1848, 210, 760, 210, 760, 210, 1032, 210, 1440, 210, 760, 210, 760, 210, 80400};


Codes I pulled directly from my xr2 remote with analisysir. For some reason the codes seem repeated but I tested them anyway and they also work
unsigned int btn1[] = {220,896,228,1692,228,736,224,2788,228,1280,224,1280,228,1148,228,2656,224,13776,220,896,224,2660,224,736,224,736,224,740,220,896,228,732,228,732,228,80334,220,896,224,1700,224,736,224,2788,224,1284,224,1280,224,1152,224,2660,224,13776,228,888,224,1568,224,1828,224,740,220,740,220,896,228,732,228,736,224};
unsigned int btn2[] = {220,896,228,1692,228,732,228,2788,224,1280,228,1280,228,1148,228,2656,224,13776,220,896,224,2504,228,732,228,732,228,732,228,1020,224,740,224,736,224,80334,224,892,232,1692,228,732,228,2784,232,1276,228,1280,228,1148,228,2652,228,13772,224,896,228,1432,224,1828,224,736,224,740,224,1020,224,740,220,740,220};
unsigned int btn3[] = {220,900,224,1696,224,736,224,2792,224,1280,224,1284,224,1152,224,2660,220,13780,228,888,224,2372,228,732,228,736,224,736,224,1152,224,736,224,736,224,80338,228,888,224,1700,220,740,220,2792,224,1284,220,1284,224,1156,220,2660,232,13768,228,888,224,1284,224,1828,224,736,224,736,224,1156,220,740,220,740,220};
unsigned int btn4[] = {228,888,224,1700,220,740,224,2788,224,1284,224,1284,220,1156,220,2664,220,13780,224,892,220,2248,220,740,220,740,220,740,224,1284,220,740,220,740,220,80342,224,892,228,1696,228,732,228,2784,228,1280,228,1276,232,1144,228,2656,228,13772,224,892,228,1148,228,1824,228,736,228,732,228,1280,224,736,228,732,228};
unsigned int btn5[] = {228,888,224,1700,220,740,224,2788,224,1284,284,1220,224,1152,224,2660,224,13776,280,836,224,2116,220,740,220,740,220,740,224,1440,276,684,228,732,228,80334,228,888,224,1700,220,740,224,2788,224,1284,224,1280,224,1156,220,2660,224,13776,228,888,224,1024,220,1832,220,740,224,740,220,1440,228,732,228,736,224};
unsigned int btn6[] = {224,892,228,1696,224,736,228,2788,224,1280,228,1280,228,1148,224,2660,224,13776,220,896,224,1956,228,732,228,736,228,732,228,1564,224,736,224,736,288,80290,224,892,228,1692,232,732,276,2736,280,1228,216,1288,220,1156,228,2656,228,13772,224,892,220,896,224,1828,228,736,224,736,224,1568,224,736,224,736,224};
unsigned int btn7[] = {228,888,224,1696,224,736,224,2792,224,1280,224,1284,224,1152,224,2660,220,13780,228,888,224,1828,224,736,224,736,224,740,224,1696,224,740,220,740,220,80354,220,896,228,1692,228,732,228,2788,228,1276,228,1280,228,1148,228,2656,224,13776,224,892,228,732,228,1824,228,732,232,732,228,1692,228,732,228,736,224};
unsigned int btn8[] = {228,888,224,1700,220,740,220,2792,224,1284,224,1280,224,1156,220,2660,224,13776,228,888,224,1700,220,740,224,736,224,740,220,1832,220,740,220,740,220,80342,220,896,228,1692,228,736,224,2788,228,1276,228,1280,228,1148,228,2656,224,13776,220,896,228,2784,228,1824,228,736,228,732,228,1824,228,732,228,732,228};
unsigned int btn9[] = {228,892,220,1700,224,736,224,2792,220,1284,224,1284,224,1152,220,2664,220,13780,224,892,220,1572,228,732,228,732,232,732,228,1952,220,740,232,732,228,80346,224,892,232,1692,228,732,228,2784,232,1276,228,1280,228,1148,228,2652,228,13772,224,896,228,2652,228,1824,228,736,276,684,232,1948,232,728,232,732,228};
unsigned int btn0[] = {228,888,224,1700,284,676,224,2788,284,1224,224,1280,224,1156,220,2660,232,13768,276,844,220,2792,220,740,224,736,224,736,224,740,220,740,220,740,232,80342,228,888,224,1700,224,736,224,2788,224,1284,224,1280,228,1152,220,2660,224,13776,228,888,224,1700,224,1828,224,736,224,736,224,740,220,740,224,736,224};

Here is the last build i was testing with

#include

//Pin settings
int PUSHBUTTON1 = 8;
int ledPin = 13;

// Raw commands for xr2 comcast

unsigned int btn1[] = {220,896,228,1692,228,736,224,2788,228,1280,224,1280,228,1148,228,2656,224,13776,220,896,224,2660,224,736,224,736,224,740,220,896,228,732,228,732,228,80334,220,896,224,1700,224,736,224,2788,224,1284,224,1280,224,1152,224,2660,224,13776,228,888,224,1568,224,1828,224,740,220,740,220,896,228,732,228,736,224};
unsigned int btn2[] = {220,896,228,1692,228,732,228,2788,224,1280,228,1280,228,1148,228,2656,224,13776,220,896,224,2504,228,732,228,732,228,732,228,1020,224,740,224,736,224,80334,224,892,232,1692,228,732,228,2784,232,1276,228,1280,228,1148,228,2652,228,13772,224,896,228,1432,224,1828,224,736,224,740,224,1020,224,740,220,740,220};
unsigned int btn3[] = {220,900,224,1696,224,736,224,2792,224,1280,224,1284,224,1152,224,2660,220,13780,228,888,224,2372,228,732,228,736,224,736,224,1152,224,736,224,736,224,80338,228,888,224,1700,220,740,220,2792,224,1284,220,1284,224,1156,220,2660,232,13768,228,888,224,1284,224,1828,224,736,224,736,224,1156,220,740,220,740,220};
unsigned int btn4[] = {228,888,224,1700,220,740,224,2788,224,1284,224,1284,220,1156,220,2664,220,13780,224,892,220,2248,220,740,220,740,220,740,224,1284,220,740,220,740,220,80342,224,892,228,1696,228,732,228,2784,228,1280,228,1276,232,1144,228,2656,228,13772,224,892,228,1148,228,1824,228,736,228,732,228,1280,224,736,228,732,228};
unsigned int btn5[] = {228,888,224,1700,220,740,224,2788,224,1284,284,1220,224,1152,224,2660,224,13776,280,836,224,2116,220,740,220,740,220,740,224,1440,276,684,228,732,228,80334,228,888,224,1700,220,740,224,2788,224,1284,224,1280,224,1156,220,2660,224,13776,228,888,224,1024,220,1832,220,740,224,740,220,1440,228,732,228,736,224};
unsigned int btn6[] = {224,892,228,1696,224,736,228,2788,224,1280,228,1280,228,1148,224,2660,224,13776,220,896,224,1956,228,732,228,736,228,732,228,1564,224,736,224,736,288,80290,224,892,228,1692,232,732,276,2736,280,1228,216,1288,220,1156,228,2656,228,13772,224,892,220,896,224,1828,228,736,224,736,224,1568,224,736,224,736,224};
unsigned int btn7[] = {228,888,224,1696,224,736,224,2792,224,1280,224,1284,224,1152,224,2660,220,13780,228,888,224,1828,224,736,224,736,224,740,224,1696,224,740,220,740,220,80354,220,896,228,1692,228,732,228,2788,228,1276,228,1280,228,1148,228,2656,224,13776,224,892,228,732,228,1824,228,732,232,732,228,1692,228,732,228,736,224};
unsigned int btn8[] = {228,888,224,1700,220,740,220,2792,224,1284,224,1280,224,1156,220,2660,224,13776,228,888,224,1700,220,740,224,736,224,740,220,1832,220,740,220,740,220,80342,220,896,228,1692,228,736,224,2788,228,1276,228,1280,228,1148,228,2656,224,13776,220,896,228,2784,228,1824,228,736,228,732,228,1824,228,732,228,732,228};
unsigned int btn9[] = {228,892,220,1700,224,736,224,2792,220,1284,224,1284,224,1152,220,2664,220,13780,224,892,220,1572,228,732,228,732,232,732,228,1952,220,740,232,732,228,80346,224,892,232,1692,228,732,228,2784,232,1276,228,1280,228,1148,228,2652,228,13772,224,896,228,2652,228,1824,228,736,276,684,232,1948,232,728,232,732,228};
unsigned int btn0[] = {228,888,224,1700,284,676,224,2788,284,1224,224,1280,224,1156,220,2660,232,13768,276,844,220,2792,220,740,224,736,224,736,224,740,220,740,220,740,232,80342,228,888,224,1700,224,736,224,2788,224,1284,224,1280,228,1152,220,2660,224,13776,228,888,224,1700,224,1828,224,736,224,736,224,740,220,740,224,736,224};
unsigned int btnEnter[] = {}; // forgot to save


//channel selection setup
//savedChannels[x] needs to be count of added channels as well as channelCount
const int savedChannels[11] = {136, 255, 814, 823, 832, 839, 854, 855, 863, 866, 872};
int channelCount = 11;
int currentChannel = 0;
int khz = 38;

IRsend irsend;

void setup()
{
  pinMode(PUSHBUTTON1, INPUT_PULLUP);
  //Serial.begin(9600);
  pinMode(ledPin, OUTPUT);
}

void loop() {
  if (digitalRead(PUSHBUTTON1) == LOW) {
    ledBlink();
    sendCommands(); }
}


void sendCommands(){
int testInt = savedChannels[currentChannel];
int press[3] = {999,999,999};
//Serial.println(testInt);
press[0] = testInt / 100;
press[1] = (testInt - press[0] * 100) / 10;
press[2] =  (testInt - (press[0] * 100) - (press[1] * 10)) / 1;

  for(int i = 0; i < 3; i++)
  {


  if (press[i] == 1)
  {
    irsend.sendRaw(btn1, sizeof(btn1)/sizeof(int), khz);
}
else if (press[i] == 2)
{
  irsend.sendRaw(btn2, sizeof(btn1)/sizeof(int), khz);;
}
else if (press[i] == 3)
{
  irsend.sendRaw(btn3, sizeof(btn1)/sizeof(int), khz);
}
else if (press[i] == 4)
{
  irsend.sendRaw(btn4, sizeof(btn1)/sizeof(int), khz);
}
else if (press[i] == 5)
{
  irsend.sendRaw(btn5, sizeof(btn1)/sizeof(int), khz);
}
else if (press[i] == 6)
{
  irsend.sendRaw(btn6, sizeof(btn1)/sizeof(int), khz);
}
else if (press[i] == 7)
{
  irsend.sendRaw(btn7, sizeof(btn1)/sizeof(int), khz);
}
else if (press[i] == 8)
{
  irsend.sendRaw(btn8, sizeof(btn1)/sizeof(int), khz);
}
else if (press[i] == 9)
{
  irsend.sendRaw(btn9, sizeof(btn1)/sizeof(int), khz);
}
else if (press[i] == 0)
{
  irsend.sendRaw(btn0, sizeof(btn1)/sizeof(int), khz);
}
else
{
}
//Pause between button presses
delay(500);
    }


//sends enter
irsend.sendRaw(btnEnter,36,38);
currentChannel = currentChannel + 1;
  if (currentChannel == 11) {
    currentChannel = 0;
  }
}

void ledBlink()
{
  digitalWrite(ledPin, HIGH);   // sets the LED on
  delay(250);                  // waits for a second
  digitalWrite(ledPin, LOW);    // sets the LED off
  delay(250);                  // waits for a second
  digitalWrite(ledPin, HIGH);   // sets the LED on
  delay(250);                  // waits for a second
  digitalWrite(ledPin, LOW);    // sets the LED off
  delay(250);                  // waits for a second
}
Post 2 made on Monday December 19, 2016 at 09:06
buzz
Super Member
Joined:
Posts:
May 2003
4,376
I don't recall the exact model of the box, but I recently re-visited an installation with an X1 box that came supplied with an XR2 remote. This installation had been working fine for about two years. I use Global Caché for the IR emitter. Suddenly, about a month ago, virtually all of the codes stopped working or became intermittent. I had to drop the carrier frequency a bit to restore operation. I think that these boxes are extremely sensitive to the carrier frequency and that Comcast updated the firmware and tightened up the tolerance to carrier frequency. Currently I'm using a carrier frequency of 38,000. Note that there will be truncation and rounding errors along the way as various boxes and programs recalculate and pass the data between them. 38,000 works well in this installation, you may be better off with a slightly different carrier frequency.

I've been using delays of about 200ms between digits, knowing that this is a little tight. I try to walk along the line between sluggish and predictable response. Delays between other commands need to be a little longer.

Longer delays are not a bad idea. I'm quick with button pushing. When I'm using the native XR2 remote I habitually overrun these boxes, but I have noticed that later X1 firmware/boxes tolerate my lightning fingers a little better. The minimum delay is slightly variable because the later firmware versions execute a progressive alpha search as more digits are entered and one should wait until data reflecting the currently entered digits is posted to the screen before sending the next digit. Unfortunately, your program cannot know exactly when posting is complete and it is possible (I'm not sure about this) that data is being fetched from a remote server after each digit is entered (implying slightly variable timing). [Actually, the latest firmware seems to multi-task a little better and I can overlap sending the next digit and waiting for the response -- slightly -- you'll need to experiment to find out what works for you]

By the way, I queue the digits entered and execute the whole pack in a metered sequence. This results in the most reliable operation. I make sure that all of my channel commands are four digits or follow shorter selections with an "OK" command. This will start execution as early as possible. I'll follow up with "Exit" in an effort to suppress that pop-up. You'll need to tweak the delay between "OK" and "Exit".

FWIW: This is the wrong area for a post such as this. You may not get much of a response.
Post 3 made on Monday December 19, 2016 at 14:31
3FG
Select Member
Joined:
Posts:
August 2009
1,861
UEI is the developer of this XMP IR protocol and they send:
ON bursts are 208 microseconds  (8 complete modulations of 26.0us -- about 38.46KHz.  Probably the box is looking for 8 rising edges rather than a specific on time.)
OFF bursts are 758us * N * 138us  where N varies from 0 to 15.
In general, you're sending off periods that are slightly too short, about 30uS.  The tolerance here is pretty narrow--by spec each off burst must have the correct duration with +/-69us.
When you consider timing variations in the sending hardware, it't not too difficult to be right on the edge.  Try making the off durations closer to the theoretical.
OP | Post 4 made on Tuesday December 20, 2016 at 03:21
mrage87
Lurking Member
Joined:
Posts:
November 2016
3
Hi


I've gone back and rewritten the entire program today and manually changed all the values to be based on the formula above. I have yet to test it but tomorrow Ill give it a shot and see what the results are. Probably made a few errors here and there that I need to go over. Its nice that I can actually see a pattern the buttons use in my arrays as well.

Here is my terrible programming (with a lot of test code) if anyone is interested

#include AIRremote.h

// commands for xr2 comcast
unsigned int btn0[] = {1,7,0,15,4,4,3,14,1,15,0,0,0,0,0,0};
unsigned int btn1[] = {1,7,0,15,4,4,3,14,1,14,0,0,0,1,0,0};
unsigned int btn2[] = {1,7,0,15,4,4,3,14,1,13,0,0,0,2,0,0};
unsigned int btn3[] = {1,7,0,15,4,4,3,14,1,12,0,0,0,3,0,0};
unsigned int btn4[] = {1,7,0,15,4,4,3,14,1,11,0,0,0,4,0,0};
unsigned int btn5[] = {1,7,0,15,4,4,3,14,1,10,0,0,0,5,0,0};
unsigned int btn6[] = {1,7,0,15,4,4,3,14,1,9 ,0,0,0,6,0,0};
unsigned int btn7[] = {1,7,0,15,4,4,3,14,1,8 ,0,0,0,7,0,0};
unsigned int btn8[] = {1,7,0,15,4,4,3,14,1,7 ,0,0,0,8,0,0};
unsigned int btn9[] = {1,7,0,15,4,4,3,14,1,6 ,0,0,0,9,0,0};
unsigned int btnEnter[] = {1,7,0,15,4,4,3,14,1,8 ,0,0,2,5,0,0};
unsigned int currentRaw[] = {99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99};
unsigned int currentShort[] = {99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99};
//Channel List
const int savedChannels[] = {136, 255, 814, 823, 832, 839, 854, 855, 863, 866, 872};
unsigned int currentChannel = 0;
//Signal/Delay Tuning
unsigned int khz = 38; // Freq
unsigned int delayAfterButtonPress = 2000; // As stated
int burstScrew = 0; // Add or Subtract from all timing defaults in [us]
int burstOn = 208; // Burst timing while on
unsigned int halfFrame = 13800; // Half Frame Timing
unsigned long fullFrame = 80400; //End Frame Timing

// const
const int burstOnScrewed = burstScrew + burstOn;

//Hardware Config
int PUSHBUTTON1 = 8;
int ledPin = 13;

// IRemote Reqs
IRsend irsend;


void setup()
{
pinMode(PUSHBUTTON1, INPUT_PULLUP);
pinMode(ledPin, OUTPUT);
Serial.begin(9600);
buildRawInitial(); // Fills currentRaw array variables
}

void loop() {
if (digitalRead(PUSHBUTTON1) == LOW) {
sendCommands();
}
}

void buildRawInitial() {
// Fills in BurstOn + Screw
for(int i = 0; i < 36; i = i + 2) {
currentRaw[i] = burstOnScrewed;
}
//Fills in Half and FullFrane Timings
currentRaw[17] = halfFrame;
currentRaw[35] = fullFrame;
}


void buildShort(unsigned int selectedBTN) {
if (selectedBTN == 1)
{
memcpy( currentShort, btn1, 16*sizeof(int) );
}
else if (selectedBTN == 2)
{
memcpy( currentShort, btn2, 16*sizeof(int) );
}
else if (selectedBTN == 3)
{
memcpy( currentShort, btn3, 16*sizeof(int) );
}
else if (selectedBTN == 4)
{
memcpy(currentShort, btn4, 16*sizeof(int) );
}
else if (selectedBTN == 5)
{
memcpy(currentShort, btn5, 16*sizeof(int) );
}
else if (selectedBTN == 6)
{
memcpy( currentShort, btn6, 16*sizeof(int) );
}
else if (selectedBTN == 7)
{
memcpy( currentShort, btn7, 16*sizeof(int) );
}
else if (selectedBTN == 8)
{
memcpy(currentShort, btn8, 16*sizeof(int) );
}
else if (selectedBTN == 9)
{
memcpy(currentShort, btn9, 16*sizeof(int) );
}
else if (selectedBTN == 0)
{
memcpy(currentShort, btn0, 16*sizeof(int) );
}
else if (selectedBTN == 11)
{
memcpy(currentShort, btnEnter, 16*sizeof(int) );
}

// Build currentRaw
int ix = 0;
for(int i = 1; i < 36; i = i + 2) {
if (i != 17) {
currentRaw[i] = (currentShort[ix] * 138) + 758 + burstScrew;
ix = ix + 1;
}
}
}


void sendCommands(){
int testInt = savedChannels[currentChannel];
int press[3] = {999,999,999};
press[0] = testInt / 100;
press[1] = (testInt - press[0] * 100) / 10;
press[2] = (testInt - (press[0] * 100) - (press[1] * 10)) / 1;

//Send Val 1
buildShort(press[0]);
irsend.sendRaw(currentRaw,36, khz);
delay(delayAfterButtonPress);

//Send Val 2
buildShort(press[1]);
irsend.sendRaw(currentRaw,36, khz);
delay(delayAfterButtonPress);

//Send Val 3
buildShort(press[2]);
irsend.sendRaw(currentRaw,36, khz);
delay(delayAfterButtonPress);

//Send Enter
buildShort(11);
irsend.sendRaw(currentRaw,36, khz);
delay(delayAfterButtonPress);

// Go to next channel
currentChannel = currentChannel + 1;
if (currentChannel == sizeof(btn1)/sizeof(int)) {
currentChannel = 0;
}
}


Also sorry if this is in the wrong place. I've never posted here before and wasnt sure if it was a remote problem or something else when I initiallycreated the topic.
Post 5 made on Tuesday December 20, 2016 at 04:43
Barf
Long Time Member
Joined:
Posts:
August 2013
350
It is not clear to me exactly what signals that you try to send, for example, the exact name on irdb.tk.

I am not going to debug your code (hard with #include AIRremote.h...). But let me point you to that IrScrutinizer 1.3 that can generate Arduino code directly from (for example) irdb.tk. Just import the codes (as raw or parametrized), and export them as "Arduino Raw". This generates an .ino file that can either be used directly, or modified.
OP | Post 6 made on Tuesday December 20, 2016 at 09:48
mrage87
Lurking Member
Joined:
Posts:
November 2016
3
As far as I can tell the program works so far since I am able to check the output in AnalasysIR.

AIRemote.h is just the experimental branch of IRemote which I'm just using to test a few things with at the moment.

In the code above anything labeled btn in those arrays are based on the formula
X * 138 + 758

So the array btn 1 would translate to

896, 1724, 758, 2828, 1310, 1310, 1172, 2690, 896, 2690, 758, 758, 758, 896, 758, 758,

The code then populates an array with 208 on signals and the half (13800) and lead out (80400) timings. (I'd like to point out I didn't know anything about IR codes a week ago incase the lingo Im using is wrong)

208, 896, 208, 1724, 208, 758, 208, 2828, 208, 1310, 208, 1310, 208, 1172, 208, 2690, 208, 13800, 208, 896, 208, 2690, 208, 758, 208, 758, 208, 758, 208, 896, 208, 758, 208, 758, 208, 80400

Which is pretty close to the codes from irb.tk under comcast xmp-1 raw

210, 896, 210, 1712, 210, 760, 210, 2800, 210, 1304, 210, 1304, 210, 1168, 210, 2664, 210, 13800, 210, 896, 210, 2664, 210, 760, 210, 760, 210, 760, 210, 896 , 210, 760, 210, 760, 210, 80400

Or the codes I pulled (saved here) from AnalasysIR that I averaged out from 10 tries

224, 893, 224, 1698,  227, 738, 226, 2784, 226,  1280,  226, 1280, 226, 1151, 226,  2658, 225, 13779, 224, 892,  225,  2788, 225, 736, 225, 764, 225,  736, 224, 736,  226,  731 ,223, 735,  225, 80351

Basically I went this route to learn a little bit of programming even if it is a bit terrible and I'm aware there are probably 100 easier ways to go about it. Plus it seems to save memory and its very simple to tweak all the values with a few integer changes.

Only thing I'm really worried about is the codes I pulled myself seem to be off. I'm not sure if its the receiver/transmitter or both. I'm using two arduino unos at the moment. One to send with the code above and one to receive hooked up to analasysir. Also I used my own xr2 remote to generate the list of codes on the spreadsheets.

Last edited by mrage87 on December 20, 2016 10:06.


Jump to


Protected Feature Before you can reply to a message...
You must first register for a Remote Central user account - it's fast and free! Or, if you already have an account, please login now.

Please read the following: Unsolicited commercial advertisements are absolutely not permitted on this forum. Other private buy & sell messages should be posted to our Marketplace. For information on how to advertise your service or product click here. Remote Central reserves the right to remove or modify any post that is deemed inappropriate.

Hosting Services by ipHouse