Skip to content

Conversation

Copy link

Copilot AI commented Feb 10, 2026

radio_conf.rx_when_idle is initialized to false and never updated. The ESP radio hardware is never told to keep its receiver on during idle, causing missed 802.15.4 fragments and reassembly-timeout errors.

Two issues compound here:

  1. otPlatRadioSetRxOnWhenIdle was not implemented
  2. The precompiled MTD libraries don't even call otPlatRadioSetRxOnWhenIdle (symbol is unreferenced in all shipped .a files), so implementing it alone is insufficient

Changes

  • platform.rs: Add otPlatRadioSetRxOnWhenIdle extern callback — covers from-source builds where OT calls this
  • lib.rs: Query otThreadGetLinkMode().mRxOnWhenIdle() in plat_changed and sync to radio_conf — covers precompiled MTD libraries that fire state change callbacks but never call otPlatRadioSetRxOnWhenIdle
  • Extract shared update_rx_when_idle helper to deduplicate the two update paths

Flow after fix

OpenThread state change → plat_changed()
  → otThreadGetLinkMode() → mRxOnWhenIdle()
  → radio_conf.rx_when_idle = true
  → next RadioCommand::Rx carries updated Config
  → ESP radio configured with rx_when_idle: true

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits February 10, 2026 08:04
- Add otPlatRadioSetRxOnWhenIdle callback in platform.rs for OpenThread
  C library builds that call it (e.g. when OT_RADIO_CAPS_RX_ON_WHEN_IDLE
  is supported)
- Query link mode in plat_changed callback and sync rx_when_idle to
  radio_conf, ensuring the radio hardware is told to stay in receive mode
  when the Thread link mode requires it
- Add plat_radio_set_rx_on_when_idle method in OtContext

Previously, radio_conf.rx_when_idle was initialized to false and never
updated, causing the ESP radio hardware to not stay in receive mode
during idle periods. This led to missed 802.15.4 fragments and
reassembly-timeout errors.

Co-authored-by: ivmarkov <2607589+ivmarkov@users.noreply.github.com>
Co-authored-by: ivmarkov <2607589+ivmarkov@users.noreply.github.com>
Copilot AI changed the title [WIP] Investigate rx_when_idle configuration in openthread Fix rx_when_idle never being propagated to radio config Feb 10, 2026
Copilot AI requested a review from ivmarkov February 10, 2026 08:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants