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

Cannot find nRF5340DK in Wireshark (using Sniffer for 802.15.4)

Hello,

I am trying to measure the RSSI value of the Zigbee communikation on nRF5340DK.

Right now I have programmed light_buld into one of the DK and light_switch into the other and they are working fine. 

I have followed the instruction for downloading nRF Sniffer for 502.15.4(Wireshark and Python too) but I cannot find anything on Wireshark.

To be honest, I am not very sure how this works. Is it even possible to use the sniffer on a nRF5340DK to begin with?

I also need help with getting the RSSI value. Is there any other way to get RSSI value than just by using the sniffer? If there is, how can I do that??

Best Regards 

Michey

Parents Reply Children
  • Hi, thank you for the reply 

    I am not sure in what way I can get the RSSI value by using Zigbee endpoint logger. Could you explain more on how I get the RSSI value? 

    And regarding the endpoint logger, I have to write this in the code:

    ZB_AF_REGISTER_DEVICE_CTX(&your_device_ctx);
    ZB_AF_SET_ENDPOINT_HANDLER(your_ep_number, zigbee_logger_eprxzcl_ep_handler);

    Should I use "&dimmable_light_ctx" as my "&your_device_ctx"?

    However, I do not know what "your_ep_number" and "zigbee_logger_eprxzcl_ep_handler" should be.

    Is "your_ep_number"  the number of endpoints that i want to have? (in my case, its just 1 right?)

    and is "zigbee_logger_eprxzcl_ep_handler" just "zigbee_logger_eprxzcl_ep_handler"

    Best Regards,

    Michey

  • Hi,

    Sorry for the late reply. When the function zigbee_logger_eprxzcl_ep_handler() is called as a callback bound to endpoint via ZB_AF_SET_ENDPOINT_HANDLER() it should produce a log line that includes the RSSI reading.

    your_ep_number is the specific endpoint for which you want to register a cluster command handler. For example for the light bulb sample the device endpoint is defined as:

    /* Device endpoint, used to receive light controlling commands. */
    #define HA_DIMMABLE_LIGHT_ENDPOINT      10
    

    In the light bulb sample the device context is already registered in main():

    	/* Register dimmer switch device context (endpoints). */
    	ZB_AF_REGISTER_DEVICE_CTX(&dimmable_light_ctx);

    Do you still have problems implementing the zigbee_logger_eprxzcl_ep_handler() function?

    Best regards,

    Marjeris

  • Hello, thank you for the reply!

    The problem I have now is that zigbee_logger_eprxzcl_ep_handler() function should have an argument which is a reference to zigbee buffer holding received zcl command to be logged. But I do not know where to find this argument. 

    if i write like this:

    ZB_AF_SET_ENDPOINT_HANDLER(HA_DIMMABLE_LIGHT_ENDPOINT, zigbee_logger_eprxzcl_ep_handler());

    i get the error :
    too few arguments to function 'zigbee_logger_eprxzcl_ep_handler'

    and if i write like this (with no paratheses):

    ZB_AF_SET_ENDPOINT_HANDLER(HA_DIMMABLE_LIGHT_ENDPOINT, zigbee_logger_eprxzcl_ep_handler);

    I get the error:
    undefined reference to 'zigbee_logger_eprxzcl_ep_handler'

    I've also written:

            ZB_AF_SET_ENDPOINT_HANDLER(HA_DIMMABLE_LIGHT_ENDPOINT, zigbee_logger_eprxzcl_ep_handler(bufid));

    in zcl_device_cb function and zboss_signal_handler and got the error:
    undefined reference to 'zigbee_logger_eprxzcl_ep_handler'

    I have followed the instruction given here

    Another questions is, will the log line be printed out in the same ways as other logs? Will I be able to see them the normal way in Termite or PuTTY?

    Best regards

    Michey 

  • Hi,

    Have you followed the steps before calling ZB_AF_SET_ENDPOINT_HANDLER(HA_DIMMABLE_LIGHT_ENDPOINT, zigbee_logger_eprxzcl_ep_handler);?

    And are you calling ZB_AF_SET_ENDPOINT_HANDLER after registering your device context with ZB_AF_REGISTER_DEVICE_CTX but before starting the Zigbee stack?

    I may need some time to try to enable the endpoint handler myself to be able to help you better. I will try to come back to you tomorrow fter trying to configure this myself. Thanks for your patience.

    Best regards,

    Marjeris

  • Hello, 

    Have you followed the steps before calling ZB_AF_SET_ENDPOINT_HANDLER(HA_DIMMABLE_LIGHT_ENDPOINT, zigbee_logger_eprxzcl_ep_handler);?

    By this, do you mean these?

    1. Enable the library by setting the CONFIG_ZIGBEE_LOGGER_EP Kconfig option.

    2. Define the logging level for the library by setting the CONFIG_ZIGBEE_LOGGER_EP_LOG_LEVEL Kconfig option. See Zephyr’s logger options for more information.

    3. Include the required header file include/zigbee/zigbee_logger_eprxzcl.h into your project.

    1. and 2. I enable by writing

    #Configuring Zigbee endpoint logger
    CONFIG_ZIGBEE_LOGGER_EP=y
    CONFIG_ZIGBEE_LOGGER_EP_LOG_LEVEL=LOG_LEVEL_INF

    in the prj.conf file in light_bulb folder, it is the correct thing to do right?

    3. I included

    #include <zigbee/zigbee_logger_eprxzcl.h>

    in the main source code. 

    And are you calling ZB_AF_SET_ENDPOINT_HANDLER after registering your device context with ZB_AF_REGISTER_DEVICE_CTX but before starting the Zigbee stack?

    this is how the code look like if I write the handler in the main function:

    void main(void)
    {
    	int blink_status = 0;
    
    	LOG_INF("Starting ZBOSS Light Bulb example");
    
    
    	/* Initialize */
    	configure_gpio();
    
    	/* Register callback for handling ZCL commands. */
    	ZB_ZCL_REGISTER_DEVICE_CB(zcl_device_cb);
    
    	/* Register dimmer switch device context (endpoints). */
    	ZB_AF_REGISTER_DEVICE_CTX(&dimmable_light_ctx);
    	
    	//To be able to use endpoint
        ZB_AF_SET_ENDPOINT_HANDLER(HA_DIMMABLE_LIGHT_ENDPOINT, zigbee_logger_eprxzcl_ep_handler);
            
    
    	bulb_clusters_attr_init();
    	level_control_set_value(dev_ctx.level_control_attr.current_level);
    
    	/* Start Zigbee default thread */
    	zigbee_enable();
    
    	LOG_INF("ZBOSS Light Bulb example started");
    
    	while (1) {
    		dk_set_led(RUN_STATUS_LED, (++blink_status) % 2);
    		k_sleep(K_MSEC(RUN_LED_BLINK_INTERVAL));
    	}
    }
    
     

    and I get different errors depending on if I put parantheses efter zigbee_logger_eprxzcl_ep_handler or not (as I mentioned above). 

    This might not be the same topic but do you know how many bytes are being sent from light_switch to light_bulb when I press the button on the light_switch so that the led lights up on light_bulb?

    Thank you for helping me and I look forward to your answer tomorrow.

    Best Regards 

    Michey 

Related