Home AMX User Forum NetLinx Studio
Options

Odd RF control issue

I have a project that I've been working on here and there for about a year as time permits. The system is an 8-zone video system with 2 8400s and 2 R2s, 5 DTV boxes, BD, Cameras, RadioRa. I have everything working now except for one of the R2s, in an odd way: I don't have control of 1 satellite box as it pertains to an R2. The R2s each control their own bedrooms, that each have a local tv, access to their own satellite boxes, and a shared blu ray player. The blu ray controls (IR) and tv controls(IR) work fine from both remotes, but I don't have control of 1 of the 2 satellite boxes. Sat boxes are controlled from either an NXC-IS4 or an NXB-IRS4, depending on the box. This is because I needed to add extra hardware as the system continued to grow. I can control the offending satellite box from the "control a device" dialog, and can also control it if I add programming to one of the 8400s. I took fully functional RF code from the first part of my project, copied it, and also duplicated/renamed the global variable I was using, but for some reason it just doesn't want to work. I've included what I believe to be all of the code pertaining to the RF:
DEFINE DEVICE
//RF Control
RFGUEST433		= 128:1:0  //433 Gateway in Guest 1(For Guest Room #2)
RFPATIO		  	= 129:1:0  // Gateway in Patio 418, Power and Source Switching only
RFGUEST418  		= 130:1:0  //418 Gateway for Guest1

////////////***********IR Devices*************/////////////
TV_FAM_TOP		= 196:1:0  //On NXB-IRS4
TV_FAM_LOW		= 5003:1:0  //NXC-IRS
TV_PATIO		= 5001:10:0
TV_GAME			= 5001:11:0
BLURAY  		= 5001:12:0
TV_GUEST2		= 5001:13:0
TV_MBED			= 5001:14:0
TV_GUEST1 		= 5001:15:0
MBMOUNT			= 5001:16:0
SAT_DVR			= 5001:9:0  
SAT_3			= 5003:3:0  //On NXC-IRS Used for Game and Patio TVs on touchpanel
SAT_5			= 5003:2:0  //On NXC-IRS Used for Guest Bedroom 1
PROJECTOR		= 5003:4:0  //NXC-IRS
SAT_4			= 199:1:0   //NXB-IRS4  Used for Guest Bedroom 2
SAT_2			= 198:1:0   //NXB-IRS4 Used in Master Bedroom as secondary Sat Box
YamahaIR		= 197:1:0  //NXB-IRS4 Port 2
The RF devices noted above are placed as such: Guest1 has both a 418 and a 433 installed behind the TV. The existing wiring required this, which is fine, as Guest1 and Guest2 are next to each other. A 2nd 418 is installed behind a Patio TV, about 40 feet away. This is so another remote is usable on the patio.
non_volatile integer nGuestSrcs [] = 
{
    241, 242, 243, 244, 245, 246
}
non_volatile integer nGuest2Srcs [] = 
{
    241, 242, 243, 244, 245, 246
}
These above are declared for my functions, which I will not list in the following code, since they work fine( and I don't want to create a HUGE post. )
volatile integer nSatGuest [] = 
{
10,  //0
11,
12,
13,
14,
15,
16,
17,
18,
19,
21,  //enter
22,  //ch up
23,  //ch dn
24,  //vol up
25,  //vol dn
26,  //mute
31,  //menu  needs to be the # from the MIO R2.
32,  //up
33,  //down
34,  //left
35,  //right
36,  //select
37,  //exit
38,  //guide
39,   //info
40    //prev channel

}
volatile integer nSatGuest2 [] = 
{
10,  //0
11,
12,
13,
14,
15,
16,
17,
18,
19,
21,  //enter
22,  //ch up
23,  //ch dn
24,  //vol up
25,  //vol dn
26,  //mute
31,  //menu
32,  //up
33,  //down
34,  //left
35,  //right
36,  //select
37,  //exit
38,  //guide
39,   //info
40    //prev channel

}
non_volatile integer nBtnArray[] = {
1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,
21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,
39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,
57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,
75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,
93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,
108,109,110,111,112,113,114,115,116,117,118,119,120,
121,122,123,124,125,126,127,128,129,130
}
Above are the 2 global variables, one for each room. Initially, I was using a single variable, but that didn't work either. I created the nBtnArray variable as an alternative, used further below.
BUTTON_EVENT[RFGUEST418,nSatGuest]  //Using Sat 5, the H24.

{
    PUSH:
    {
	local_var integer nBtnSat
	nBtnSat = GET_LAST(nSatGuest)
	SWITCH(nBtnSat)
	{
	    
	    CASE 1:
	    {
		PULSE[SAT_5,10]
	    }
	    CASE 2:
	    {
		PULSE[SAT_5,11]
	    }
	    CASE 3:
	    {
		PULSE[SAT_5,12]
	    }
	    CASE 4:
	    {
		PULSE[SAT_5,13]
	    }
	    CASE 5:
	    {
		PULSE[SAT_5,14]
	    }
	    CASE 6:
	    {
		PULSE[SAT_5,15]
	    }
	    CASE 7:
	    {
		PULSE[SAT_5,16]
	    }
	    CASE 8:
	    {
		PULSE[SAT_5,17]
	    }
	    CASE 9:
	    {
		PULSE[SAT_5,18]
	    }
	    CASE 10:
	    {
		PULSE[SAT_5,19]
	    }
	    CASE 11:
	    {
		PULSE[SAT_5,21]
	    }
	    CASE 12:
	    {
		PULSE[SAT_5,22]  //channel up
	    }
	    CASE 13:
	    {
		PULSE[SAT_5,23]  //channel down
	    }
	    CASE 14:
	    {
		TO[TV_GUEST1,24]  //TV Vol Up
	    }
	    CASE 15:
	    {
		TO[TV_GUEST1,25]  //TV Vol Down
	    }
	    CASE 16:
	    {
		TO[TV_GUEST1,26]  //TV Mute
	    }
	    CASE 17:  //Menu
	    {
		PULSE[SAT_5,44]
	    }
	    CASE 18:  //Up  maybe change the pulse time CTON CTOFF to .1?
	    {
		TO[SAT_5,45]
	    }
	    CASE 19:  //Down
	    {
		TO[SAT_5,46]
	    }
	    CASE 20:  //Left
	    {
		TO[SAT_5,47]
	    }
	    CASE 21:  //Right
	    {
		TO[SAT_5,48]
	    }
	    CASE 22:  //Select
	    {
		PULSE[SAT_5,49]
	    }
	    CASE 23:  //Exit
	    {
		PULSE[SAT_5,50]
	    }
	    CASE 24:  //Guide
	    {
		PULSE[SAT_5,56]
	    }
	    CASE 25:  //Info
	    {
		PULSE[SAT_5,65]
	    }
	}
    
    }
}
The above is my button event for the operational guest bedroom. I did it this way since it seemed to be the quickest way to incorporate the button presses for both the TV and Satellite functions. Originally I simply copied the above code, and using the 2nd variable above, tried controlling the 2nd guest room, but I only had control of the TV at that point, no IR for the satellite box.
BUTTON_EVENT[RFGUEST433,nBtnArray]  //Using Sat 4, the H21.
{
    PUSH:
    {
	
	
	local_var integer nBtnSat4
	nBtnSat4 = GET_LAST(nBtnArray)
	send_command SAT_4,"'SP',nBtnSat4"
	
	
    
    }
}
I tried the above code next, but this also didn't help.
BUTTON_EVENT[RFGUEST433,nDVDBtns]  //Guest 2 DVD buttons
{
    PUSH:
    {
	local_var integer nDVD
	nDVD = GET_LAST(nDVDBtns)
	SWITCH(nDVD)
	{
	    CASE 1:
	    {
		TO[BLURAY,1]  //Play
	    }
	    CASE 2:
	    {
		TO[BLURAY,2]  //Stop
	    }
	    CASE 3:
	    {
		TO[BLURAY,3]  //Pause
	    }
	    CASE 4:
	    {
		TO[BLURAY,6]  //Rev
	    }
	    CASE 5:
	    {
		TO[BLURAY,7]  //FFwd
	    }
	    CASE 6:
	    {
		TO[BLURAY,4]  //Prev
	    }
	    CASE 7:
	    {
		TO[BLURAY,5]  //Next
	    }
	    CASE 8:
	    {
		//No Record on Blu Ray
	    }
	    CASE 9:
	    {
		TO[BLURAY,44]  //111, Menu or Home
	    }
	    CASE 10:
	    {
		TO[BLURAY,45]  //112 Up
	    }
	    CASE 11:
	    {
		TO[BLURAY,46]  //113 Down
	    }
	    CASE 12:
	    {
		TO[BLURAY,47]  //114 Left
	    }
	    CASE 13:
	    {
		TO[BLURAY,48]  //115 Right
	    }
	    CASE 14:
	    {
		TO[BLURAY,49]  //116 Select
	    }
	    CASE 15:
	    {
		TO[BLURAY,54]  //117 Exit
	    }
	    CASE 16:
	    {
		TO[TV_GUEST2,24]  //104 TV Vol Up
	    }
	    CASE 17:
	    {
		TO[TV_GUEST2,25]  //105 TV Vol Dn
	    }
	    CASE 18:
	    {
		TO[TV_GUEST2,26]  //106 TV Mute
	    }
	}
    }
}
The above is the code for the blu ray functions in that room, which also work fine. I have another grouping of code identical to this for the 1st guest room, also functional.
What I do know is that the other 3 devices on the IRS4 work fine with other code, and that the sat box is controllable from the touchpanel, so I'm sure that my code is out of whack somewhere. Can someone give me a few pointers? I feel like I'm chasing my tail right now.

Comments

  • Options
    BigsquatchBigsquatch Posts: 216
    I didn't spot any obvious issues in the code, although I didn't study it in detail.

    Have you done all of your "idiot" checks? You know, watch the IRS4 for tx lights while someone uses the R2 to try to control it. Could be triggering the wrong port.

    You could put a

    send_string 0, "'Guest 2 Sat Event, channel = ',ITOA(nBtnSat4)"

    in

    BUTTON_EVENT[RFGUEST433,nBtnArray]

    to confirm that the event is actually firing to rule out the possibility of a duplicate event or an include file that didn't get included or a problem with your buttons array.
  • Options
    vegastechvegastech Posts: 369
    I watched the rf box to verify it was swing the button presses, and also the 3100 to verify the same. The irs4 does not flash or control the dtv box when using the r2, but it does when using an 8400. It's gotta be somewhere in the device declarations or similar...
  • Options
    vegastechvegastech Posts: 369
    Back onsite...

    So I'm back onsite, and I thought I would try again. Based on my above code, I simply took two commands from the fully functional R2 (DTV cursors left and right), and replaced them with the DTV box's declaration:
    	    CASE 19:  //Down
    	    {
    		TO[SAT_5,46]
    	    }
    	    CASE 20:  //Left
    	    {
    		TO[SAT_4,47]
    	    }
    	    CASE 21:  //Right
    	    {
    		TO[SAT_4,48]
    	    }
    	    CASE 22:  //Select
    	    {
    		PULSE[SAT_5,49]
    
    After uploading, I tried pressing the buttons, but the IRS4 didn't respond to left or right commands. I can still go to the 'control a device' dialog and control that SAME port on the IRS4, and watch the DTV box respond. That leads me to believe that the IR port is functional on the IRS4, and that the correct IR file was uploaded. Both boxes use the same DTV ir file. What else can I do at this point? I'm going to try the wildcard button press next, as suggested above.
  • Options
    BigsquatchBigsquatch Posts: 216
    This isn't making any sense. It would seem that maybe you made an incorrect assumption in your debugging process somewhere?
    vegastech wrote: »
    ... What else can I do at this point? I'm going to try the wildcard button press next, as suggested above.

    Other things that come to mind:

    Open debug, drag SAT_4 to the list to verify it shows the correct device number.
    Check the online tree for the correct device number.
    Get rid of any possible complications. Comment out ALL of your events and add the following button events and then test by using virtual button presses in "emulate a device."
    BUTTON_EVENT[RFGUEST433,1]
    {
        PUSH:
       {
            SEND_STRING 0, "'IR test button event 1'"
            PULSE[SAT_4,*] // Change the * to an actual IR channel in the file, maybe channel up or something
        }
    }
    
    BUTTON_EVENT[RFGUEST433,2]
    {
        PUSH:
       {
            SEND_STRING 0, "'IR test button event 2'"
            PULSE[SAT_4,*] // Change the * to an actual IR channel in the file, maybe channel down or something
        }
    }
    

    After you do this reality check, if it works then uncomment just the guest room 2 sat box code and see if it works. If it does then keep uncommenting events until it stops working again.

    If the sat box code didn't work when it was the only event in the project then you know where the problem is.
Sign In or Register to comment.