Matter: way to add callback during cyclic wakeup of SED?

I am currently looking for a way to add a user-callback in the wakeup-period of the SED communication. This is done to prevent two wakeup cycles (communication + sensor readout) in order to figure out if this would decrease the power consumption.

Is there an easy way to do this? I looked into the usual matter event-queue handlers and some OpenThread related stuff, but didn't find anything which suits my needs.

Parents
  • Hi,

    Could you provide links to the Matter event queue handles and OpenThread stuff you investigated so I don't come with suggestions that you've already looked in to?

    Otherwise we have some suggestions that might be of help. If you're using the same RTC compare event for each wakeup cycle, you could use SWI to trigger an interrupt during the same event as well.

    Kind regards,
    Andreas

  • Oh, I was just looking if I can get wakeup-events from PlatformMgr().AddEventHandler callback (since this striked me the easiest one to access from my business logic), but found no matching notification there. SWI triggered interrupt sounds intriguing, though. I just suspect that I don't use the same RTC compare event (pretty high-level Zephyr stuff), so I've got no idea here.

    Best regards,
    Robert

  • Hi,

    Apologies for the long response time. I've asked the Matter team and they came back with the following:

    Unfortunately it isn't possible to do it in an easy way. There is no easy way to add a callback in the PlatformMgr that can cooperate with SED intervals. In addition, when asking the Matter team for input, they also said that using RTC to do it can be dangerous because the device wakes up and goes to sleep several times during a single transmission (on preparing data, on sending a frame to the radio driver, on sending a frame by the radio driver etc.).
    They say that they think it is possible in a Bare Metal implementation, where is a specific thread for the user. In a Matter sample it isn't so simple.
    I have asked our OpenThread team if they know about any other solutions, but I can't guarantee that they know of any easy solutions for your inquiry either. Nonetheless, I will update you when/if I hear anything from them.
    Kind regard,
    Andreas
  • Dear Andreas, thanks for the reply.
    I am looking forward for more information, but heed your time.

    Best regards,
    Robert

Reply Children
  • Hi,

    The reply from the OpenThread team offers two answers for two different scenarios. The first one being:

    • send datapoll
    • receive data from router
    • react on request if any by reading the data from sensor
    • go to sleep

    and the second:

    • read data from sensor
    • send them to router,
    • (at some point) send datapoll,
    • react on incoming data if any

    The first one gives should give you what you need, but it requires some pro-activeness from the router. In other words, its not a simple solution. As for second alternative, there currently is no available call back in OpenThread API to do it. Also take in mind that sending data poll is not only triggered by timer.

    Let me know if this answers your question

    Kind regards
    Andreas

Related