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

Can I disable OpenThread polling for nrf5 temperature every 30 seconds?

Hello,

I'm using the OpenThread from v4.0.0 of the Thread/Zigbee library and the TEMP driver to read nRF52840 temperature via a nrfx_temp_data_handler_t. I noticed the handler is being triggered every 30 seconds in addition to when I trigger a reading myself via nrfx_temp_measure() via a timer. I think I tracked this down to the OpenThread library doing a temperature reading every 30s.

Is there a way to disable OpenThread from triggering a read every 30s or should I just do some additional book keeping to read at the interval I desire?

Thanks,

Jeremy

  • Hello Jeremy,

    Do you mean that all the examples that use the openthread library use this temperature measurement? How do you determine that this is called in the examples in the SDK?

    If you want to change something in the openthread library, you can rebuild it using this guide. The tag that is used with the SDK is marked in SDK\external\openthread\project\readme.txt.

    Best regards,

    Edvin

  • I derived my code from the simple_coap_server OpenThread example. I registered a handler for temperature callbacks using nrfx_temp_init().

    Setting a breakpoint in the handler I see the call stack is:

    void my_handler()
    void TEMP_IRQHandler()
    void AlaramStartAt()
    void Remove()
    void ProcessTimers()
    void nrf5AlarmProcess()
    void thread_process()

    The thread_process() function is from the examples (./components/thread/utils/thread_utils.c) which is called from the main loop and invokes the OpenThread processing functions otTaskletsProcess() and otSysProcessDrivers(). It looks like like OpenThread library is triggering the temp readings.

  • I suspect that the reason the TEMP is checked is to calibrate the LFCLK (if you use an RC Oscillator, this will be necessary). Is it an issue for your application that this happens? Because I would have to check with our Thread team as of why this happens. Is it a problem due to current consumption? It doesn't sound like something that would draw a lot of power.

    BR,

    Edvin

  • It'd be great if you could reach out to the Thread team to understand the necessity of the temp readings on 30s intervals.

    The additional temp reading interrupts cause unexpected behavior in my application. I can work around this my tracking when my app triggers a reading and ignoring the other events as a workaround if necessary.

  • Your application should be able to handle unexpected interrupts. It would be as if you receive a packet over the thread network. It is not possible to foresee when these messages are coming. 

    And my guess is that it is required for some sort of calibration. Either timing or output power perhaps.

    I have forwarded this question to our Thread team. I will let you know when I hear something.

    BR,

    Edvin

Related