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

NRF Logs in Zigbee2MQTT

I am using the light bulb example and connecting to the Zigbee2MQTT. The Z2M is running on a docker with logs level set to debug. 

So from the light bulb example, how can I publish the debug logs to Z2M?  I have tried

    NRF_LOG_WARNING("Text1");
    NRF_LOG_INTERNAL_DEBUG("Text2");
    NRF_LOG_DEBUG("Text3");

What logs should I add in the light bulb which will send out the logs details to Z2M?

  • I don't thing you will be able to do that.

    What you write inside NRF_LOG_WARNING/DEBUG/INTERNAL_DEBUG/INFO() is printed in the log from the nRF, not the other devices in the network. The light bulb example only has the light bulb's on off cluster, and the bightness, so no way to communicate these logs to the Z2M device.

    Have you tried monitoring the UART log from the nRF device? UART is the default log backend on the light_bulb example. It uses the baudrate NRF_LOG_BACKEND_UART_BAUDRATE set in sdk_config.h in the light bulb example (1000000 by default, I believe).

    BR,

    Edvin

  • Thanks about the info on the NRF_LOG_WARNING...  Is there a way the log info can be encapsulated in any cluster so that it could be displayed in Z2M logs?  basically Z2M (actually zigbee-herdsmen) will provide the details of any broadcast from zigbee devices.

    On the UART, the moment I load the .hex file in the dongle, the dongle disconnects from the COM port. Or is there a way to still keep the UART connection after the .hex is loaded? 

  • Manju_rn said:
    Is there a way the log info can be encapsulated in any cluster so that it could be displayed in Z2M logs? 

     That is not trivial. In that case you would have to create a cluster that does this. It sounds like a lot of work. I suggest you debug locally. 

    If you are using a Dongle, the UART is not routed through the USB port as it is on a DK, because the Dongle doesn't have a debugger. If you intend to develop something, I suggest that you get hold of a DK, which includes a debugger. The alternative is to use some external UART -> USB device, and use the pinout on the dongle to solder on some wires to the UART->USB device.

    The dongle is really not great for application development. You will save yourself a lot of trouble using a DK. The alternative is that you write a USB backend for the dongle, but this is easier said than done, and it would also probably be easier to do on a DK. This is probably not the answer you are looking for, and I am sorry for that.

    Best regards,

    Edvin

  • Thanks so much for the help - let me work on the UART connections.  Parallely let me see what ZCL can I use to bundle the log info

Related