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.
Hi,
I have a ZED with the GenericApp program that is connected to a router. When I disconnect power from the router, the ZED sends a beacon request to the coordinator, but the coordinator also says LEAVE. Below is my log of this. How can I fix this?
Sorry for confusion, but I am trying to locate what causes my problem. I do believe you. I just can't find what I did wrong yet, and so I am asking for any suggestions as to where I might've messed up.
I found out that the cause of my problem has something to do with the below code. What might be the problem?
static void batteryUpdate( void ); ------------------------------------- static void batteryUpdate( void ){ vdd_reading = HalAdcGetVdd(); volt = (float)vdd_reading - (float)100; volt /= (float)37; volt += (float)0.7; // 2.7 - 2 percent = (float)volt / (float)1.0; // 3.0 - 2 if(percent > 1){ percent = 1; } percent *= (float)100; battPercent = (uint8) percent; if(battPercent < 30){ if(battLowVerified == true){ LED1 = 1; } else{ osal_start_timerEx( zclGenericApp_TaskID, BATT_LOW, BATT_LOW_SCAN ); } } zclReportCmd_t rptcmd; rptcmd.numAttr = 1; rptcmd.attrList[0].attrID = ATTRID_POWER_CFG_BATTERY_PERCENTAGE_REMAINING; rptcmd.attrList[0].dataType = ZCL_DATATYPE_UINT8; rptcmd.attrList[0].attrData = (uint8 *) &battPercent; // Set destination address to indirect zclGenericApp_DstAddr.addrMode = (afAddrMode_t)Addr16Bit; zclGenericApp_DstAddr.addr.shortAddr = 0; zclGenericApp_DstAddr.endPoint=1; zcl_SendReportCmd(GENERICAPP_ENDPOINT, &zclGenericApp_DstAddr, ZCL_CLUSTER_ID_GEN_POWER_CFG, &rptcmd, ZCL_FRAME_SERVER_CLIENT_DIR, false, 0 ); } ------------------------------------- batteryUpdate();
if( events & BATT_LOW ){ if(battLowCheck == 3){ battLowCheck = 0; battLowVerified = true; //batteryUpdate(); } else{ vdd_reading = HalAdcGetVdd(); if(vdd_reading > 100){ battLowCheck = 0; } else{ battLowCheck++; osal_start_timerEx( zclGenericApp_TaskID, BATT_LOW, BATT_LOW_SCAN ); } } return (events ^ BATT_LOW); }
BATT_LOW_SCAN is 10000
Never mind the timer. I notice this now:
1. When ZED has Coordinator as its direct parent, whenever ZED tries to connect to Coordinator, ZED connects.
2. When ZED has Router as its direct parent, whenever ZED tries to connect to Coordinator, ZED is told to LEAVE.
It seems that some kind of parent assignment is happening here, and only the Router or Coordinator allows the ZED to rejoin the network. If the ZED joined the network through a Router 1st, it must always join the network through any router - can never directly join to the Coordinator. But if the ZED joined the network through a Coordinator 1st, it can join the network through any router or directly to the Coordinator. What causes this, and how can I fix it
Tests:
1. If it is my code, what code would I remove/add to fix it?
2. Where is the code when ZED connects to Router?
Do you know if ZED may have told Coordinator (through Router) that it can only join network through direct parent?
I tried that, but it didn't fix the problem.
Here is a log from SmartThings ZED. Do you see any differences from mine?
I should also mention that the period of rejoin & leave requests only happens for about 5 seconds before the ZED gives up and just stops.
I've made a post on the SmartThings community at community.smartthings.com/.../11. tpmanley made a post (10th post) explaining why this problem might be occurring. Can you verify if this is true?
Does the Leave request look normal to you?
Also after the hub sends a Leave request, why does the ZED keep sending rejoin requests?