Other Parts Discussed in Thread: CC2530EM, Z-STACK
In the HA test Apps, i only found the sample light/switch. But i want to communicate with two zigbee's. Can i change the Generic App profile and cluster id to use for HA.
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
1. In sample light and switch, you can build them to coordinator, router or end devices. For example, you can put your sample light as coordinator and sample switch as end device. Then, they can talk to each other.
2. Of course you can revise Generic App to HA profile. However, it will need more efforts than use sample light/switch directly.
Yikai,
As per your suggestion i have compiled a sample light as coordinator and sample switch as end device. But how i need to test this.
Sample light App will blink the led 4 at regular interval. Sample switch is, if i press sw1, then led 4 will on/off. How these two app in coincide. I am confused, can u tell me , how can i use this.
Do you modify anything on the original sample light and switch? In my test, there is no blink on LED4 and it is LED1 will toggle on/off if you press SW1 on sample switch. By the way, I am using ZStack 2.5.1a for test. Which ZStack version do you use? My suggestion is to remove your current ZStack, install a clean one, and test again.
No i didn't do any modification on original sample light and switch. As per your suggestion i have uninstalled the zstack and re installed it. Again i compiled sample light as coordinator and sample switch as End device. When i powered up the two boards, coordinator is creating network ID and displaying in the LCD and End device is joining to that network and displaying Enddevice ID and parents: 0. If i press Switch 1 in end device led 4 is turning on till pressing sw1. How can i test this?
From your description, it is correct behavior of sample light and switch. When end device of sample switch joins sample light coordinator, they are bind each other. Then, if you press SW1 on sample switch, it will toggle LED on sample light. What do you mean how to test it?
I mean, How to the process. I have done the same thing, i have pressed SW1 in sample switch which is end device, led 4 is glowing(while pressing sw1) in the same device rather than led should toggle in sample light. led 1 in sample light is always in inactive.
And enddevice is sending data request continuously. The log file of packet sniffer is
I have seen this function, in which it is not indicating to LED 1. This statements is talking about LED 4. I am confused. Please help me.
static void zclSampleLight_OnOffCB( uint8 cmd )
{
// Turn on the light
if ( cmd == COMMAND_ON )
zclSampleLight_OnOff = LIGHT_ON;
// Turn off the light
else if ( cmd == COMMAND_OFF )
zclSampleLight_OnOff = LIGHT_OFF;
// Toggle the light
else
{
if ( zclSampleLight_OnOff == LIGHT_OFF )
zclSampleLight_OnOff = LIGHT_ON;
else
zclSampleLight_OnOff = LIGHT_OFF;
}
// In this sample app, we use LED4 to simulate the Light
if ( zclSampleLight_OnOff == LIGHT_ON )
HalLedSet( HAL_LED_4, HAL_LED_MODE_ON );
else
HalLedSet( HAL_LED_4, HAL_LED_MODE_OFF );
}
It is correct that end device will keep sending data request and it's period is defined by POLL_RATE.
If that is correct, Then, if i press sw1 in End device, the led1 of ZC should toggle right. That is not happening.
In hal_board_cfg.h, you can see the following defines:
#define HAL_TURN_OFF_LED4() HAL_TURN_OFF_LED1()
#define HAL_TURN_ON_LED4() HAL_TURN_ON_LED1()
#define HAL_STATE_LED4() HAL_STATE_LED1()
Which means that ZStack will map LED4 to LED1. So, you shouldn't see anything on LED4.
I have seen that, that is my question, why LED 1 is not toggling. if i press switch one. I didn't change any thing from original code. i have re installed Z-stack. Though it is working. LED 1 is always in inactive.