This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

The NRF52840 seems to not receive response from Green Power endpoints.

Hi,

I am currently using a NRF52840 dongle with the python wrapper for the zigbee library.

When I send a Discover Attribute to a Green Power cluster in a Green Power Endpoint, it seems that the dongle does not receive any response from the device. I know the device send a response because I can see the frame with WireShark but the Wrapper seems to ignore it and sens a Request Timeout.

The command I use is the following : 

zcl cmd -w -d {ieee_addr} 242 21 -p A1E0 C -l 0000ff

Thanks for your help.

Parents
  • Hi,

    Do you have a sniffer trace you can share? Does the command packet you are sending look correct in the sniffer trace?

  • Hi,

    The thing is that I can intercept any kind of data frame just fine but I can't intercept anything when I send any command with the Green Power Profile.

  • /**@brief The Handler to 'intercept' every frame coming to the endpoint
     *
     * @param bufid    Reference to a ZBOSS buffer
     */
    static zb_uint8_t cli_agent_ep_handler_generic_cmd(zb_bufid_t bufid)
    {
        zb_zcl_parsed_hdr_t * p_cmd_info = ZB_BUF_GET_PARAM(bufid, zb_zcl_parsed_hdr_t);
        zb_int8_t             row;
        zb_ret_t              zb_err_code;
    
        /* Get the row in the requests table according by the sequence number */
        row = get_cmd_table_row_by_sn(p_cmd_info->seq_number);
        if (row == -1)
        {
            return ZB_FALSE;
        }
    
        cmd_query_t * p_row = &(m_cmd_data[row]);
        if (!is_response(p_cmd_info, p_row))
        {
            return ZB_FALSE;
        }
        if (p_cmd_info->cmd_id == ZB_ZCL_CMD_DEFAULT_RESP)
        {
            zb_zcl_default_resp_payload_t * p_def_resp;
            p_def_resp = ZB_ZCL_READ_DEFAULT_RESP(bufid);
    
            /* Print info received from default response */
            nrf_cli_fprintf(p_row->p_cli,
                           (p_def_resp->status == ZB_ZCL_STATUS_SUCCESS) ? NRF_CLI_INFO : NRF_CLI_ERROR,
                           "\r\nDefault Response received: ");
            nrf_cli_fprintf(p_row->p_cli,
                           (p_def_resp->status == ZB_ZCL_STATUS_SUCCESS) ? NRF_CLI_INFO : NRF_CLI_ERROR,
                           "Command: %d, Status: %d",
                            p_def_resp->command_id, p_def_resp->status);
            nrf_cli_fprintf(p_row->p_cli,
                           (p_def_resp->status == ZB_ZCL_STATUS_SUCCESS) ? NRF_CLI_INFO : NRF_CLI_ERROR,
                           "\r\n");
    
            if (p_def_resp->status != ZB_ZCL_STATUS_SUCCESS)
            {
                print_error(p_row->p_cli, "Command not successful", ZB_TRUE);
            }
            else
            {
                print_done(p_row->p_cli, ZB_FALSE);
            }
        }
        else if (p_cmd_info->cmd_id == ZB_ZCL_CMD_DISC_ATTRIB_RESP)
        {
            zb_zcl_disc_attr_info_t * p_attr_resp = NULL;
            zb_uint8_t complete = 0;
            nrf_cli_fprintf(p_row->p_cli,
                           NRF_CLI_INFO,
                           "\r\nList Attribute Response received: \r\n");
            ZB_ZCL_GENERAL_GET_COMPLETE_DISC_RES(bufid,complete);
            nrf_cli_fprintf(p_row->p_cli,
                            NRF_CLI_INFO,
                            "complete:%d\r\n",
                            complete);
            
            ZB_ZCL_GENERAL_GET_NEXT_DISC_ATTR_RES(bufid,p_attr_resp);
            nrf_cli_fprintf(p_row->p_cli,
                           NRF_CLI_INFO,
                           "list attr,type: \r\n[");
            while (p_attr_resp)
            {
                nrf_cli_fprintf(p_row->p_cli,
                            NRF_CLI_INFO,
                           "(%d,%d),",
                            p_attr_resp->attr_id, p_attr_resp->data_type);
              
                ZB_ZCL_GENERAL_GET_NEXT_DISC_ATTR_RES(bufid,p_attr_resp);
            }       
            nrf_cli_fprintf(p_row->p_cli,
                           NRF_CLI_INFO,
                           "]\r\n");
            print_done(p_row->p_cli, ZB_FALSE);
        }
        else if (p_cmd_info->cmd_id == (ZB_ZCL_CMD_DISCOVER_COMMANDS_RECEIVED_RES) || 
            (p_cmd_info->cmd_id ==ZB_ZCL_CMD_DISCOVER_COMMANDS_GENERATED_RES))
        {
            zb_zcl_disc_cmd_info_t * p_cmd_resp = NULL;
            zb_uint8_t complete = 0;
            zb_zcl_parse_status_t status;
    
            nrf_cli_fprintf(p_row->p_cli,
                           NRF_CLI_INFO,
                           "\r\nList Command Response received: \r\n");
            ZB_ZCL_GENERAL_GET_DISC_COMMAND_RESP(bufid,complete);
            nrf_cli_fprintf(p_row->p_cli,
                            NRF_CLI_INFO,
                            "complete:%d\r\n",
                            complete);
            
            ZB_ZCL_GENERAL_GET_NEXT_CMD_ID_DISC_COMMAND_RESP(bufid,p_cmd_resp);
            nrf_cli_fprintf(p_row->p_cli,
                           NRF_CLI_INFO,
                           "list cmd: \r\n[");
            while (p_cmd_resp)
            {
                nrf_cli_fprintf(p_row->p_cli,
                            NRF_CLI_INFO,
                           "%d,",
                            p_cmd_resp->cmd_id);
              
                ZB_ZCL_GENERAL_GET_NEXT_CMD_ID_DISC_COMMAND_RESP(bufid,p_cmd_resp);
            }       
            nrf_cli_fprintf(p_row->p_cli,
                           NRF_CLI_INFO,
                           "]\r\n");
            print_done(p_row->p_cli, ZB_FALSE);
        }
        else /* In case of unknown response */
        {
            print_error(p_row->p_cli, "Unknown response", ZB_TRUE);
        }
        /* Cancel the ongoing alarm which was to erase the row... */
        if (m_cmd_data[row].def_resp == ZB_ZCL_ENABLE_DEFAULT_RESPONSE)
        {
            zb_err_code = (ZB_SCHEDULE_APP_ALARM_CANCEL(invalidate_row_cb, row));
            ZB_ERROR_CHECK(zb_err_code);
        }
        /* ...and erase it manually */
        invalidate_row(row);
    
        zb_buf_free(bufid);
        return ZB_TRUE;
    }
    
    
    /**@brief Endpoint handlers
     */
     NRF_ZIGBEE_EP_HANDLER_REGISTER(generic_cmd, cli_agent_ep_handler_generic_cmd);
    /** @} */
    Every function works with profile Home Automation, but it doesn't when I try to work with endpoint 242 and Green Power Profile
  • Hi again,

    I am so sorry for the late reply, I see I never managed to answer this. Are you still struggling with this issue?

    Are you running an application based on the CLI example on your dongle? I see that the handler function is very similar to the one on the CLI example. How does the output log you are getting look like?

    Do you know if you are getting inside the 'else if' statement for ZB_ZCL_CMD_DISC_ATTRIB_RESP? Perhaps you can start with printing something out if the function get's inside the statement to debug further.

    You can also try to make your 'else if' statement more specific for example:

     else if ((cmd_info->cmd_direction == ZB_ZCL_FRAME_DIRECTION_TO_CLI) && \
            (cmd_info->cmd_id == ZB_ZCL_CMD_DISC_ATTRIB_RESP) && \
            (cmd_info->cluster_id == ZB_ZCL_CLUSTER_ID_GREEN_POWER))

    Try to print something here with NRF_LOG to see if you are intercepting the frame.

    Then the incoming frame must be parse as zb_zcl_disc_attr_res_t not zb_zcl_disc_attr_info_t. 

    I hope you have managed to move forward and I am very sorry this question got a bit lost in my queue.

    Best regards,

    Marjeris

  • Hi,

    Thank you for your response. 

    Yes, I run an application based on the CLI exemple and the output log looks like this :

    TX : zcl cmd -w -d 0004740000A22CDE 242 21 -p A1E0 C -l 0000ff
    RX : Error: Request timed out

    (I use the python wrapper)

    The application never run into the else if condition and I don't find any part of the application that allows me to see the response frame. Making the else if statement did not solve any issues.

    When not using the Green Power profile, the parsing is fine. I don't see what would change if this bit of the code is modified.

    Thank you,

    Charles

  • Hi, 

    I recently came back to this subject. I tried to mess with the ZGP API from ZBOSS. It is unwieldy compared to the standard ZBOSS API, to say the least, and I found this part : 

    #ifdef ZB_ENABLE_ZGP_DIRECT
    /**
       Set ZBOSS to skip all incloming GPDF.
    
       To be used for testing only.
       Use that function with ZB_TRUE parameter to prevent Combo device from
       receiving GPDFS thus always working thru Proxy device.
    
       @param skip if ZB_TRUE, skip incoming GP frames
    
       @snippet doxygen_snippets.dox set_skip_gpdf_snippet_zc_combo_c
      */
    void zb_zgp_set_skip_gpfd(zb_bool_t skip);
    
    #endif  /* ZB_ENABLE_ZGP_DIRECT */

    I did not fully understand all the implication of ZIGBEE Direct, can you enlighten me on the subject ?

    Charles Tessier-Piart

  • Hi Charles,

    Zigbee Direct is not supported in NCS right now. This is a new feature, which is still under development. The define is not enabled and cannot be enabled by the application code. We will try to ask ZBOSS to remove this piece to avoid further confusion.

    Best regards,

    Marjeris

Reply Children
No Data
Related