OPCODE response delayed without debug logs

Hi,

I am developing an application which has some tasks along with custom models.
Here I found a peculiar issue, wherein, if i run the application with debug logs enabled, my custom mesh models' response to OPCODES fired from nrf mesh app is immediate.
If I run the application with debug logs disabled, my custom mesh models' response to OPCODES fired from nrf mesh app is after 5 mins.

Please suggest where I can troubleshoot for this..?
And how do mesh models get scheduled..?

Thanks,

Parents
  • Hi,

    The normal flow is that when the Bluetooth mesh stack receives a message, it gets forwarded to the model through the registered callbacks. The handling should therefore be immediate. If you see a 5 minute delay, then there is definitely something wrong in the implementation of your model (something is wrong with the callback function that you registered for it), or something is preventing part of the stack or the callback itself from running.

    How do you enable/disable the debug logs, are you sure only logging is turned on/off and there are no other side effects from doing this? For instance any code that gets executed with one setting and not with the other setting.

    Is there something with the way you use logging from within the model callback, so that disabling logging means some code does not execute, some semaphore or mutex is handled incorrectly, some API call is not called, etc?

    Since the issue happens when logs are disabled, debugging through logging is not an option. You then need to run a good old debug session with breakpoints to see where code execution leads to and with reading/watching variables, looking at the call stack, etc., to get a clue about what is happening.

    Regards,
    Terje

Reply
  • Hi,

    The normal flow is that when the Bluetooth mesh stack receives a message, it gets forwarded to the model through the registered callbacks. The handling should therefore be immediate. If you see a 5 minute delay, then there is definitely something wrong in the implementation of your model (something is wrong with the callback function that you registered for it), or something is preventing part of the stack or the callback itself from running.

    How do you enable/disable the debug logs, are you sure only logging is turned on/off and there are no other side effects from doing this? For instance any code that gets executed with one setting and not with the other setting.

    Is there something with the way you use logging from within the model callback, so that disabling logging means some code does not execute, some semaphore or mutex is handled incorrectly, some API call is not called, etc?

    Since the issue happens when logs are disabled, debugging through logging is not an option. You then need to run a good old debug session with breakpoints to see where code execution leads to and with reading/watching variables, looking at the call stack, etc., to get a clue about what is happening.

    Regards,
    Terje

Children
No Data
Related