Skip to content

pkg/opendsme: fix beacon loss on nrf after association - #23035

Open
Stopkaa wants to merge 3 commits into
RIOT-OS:masterfrom
Stopkaa:opendsme-upgrade
Open

Stopkaa wants to merge 3 commits into
RIOT-OS:masterfrom
Stopkaa:opendsme-upgrade

Conversation

@Stopkaa

@Stopkaa Stopkaa commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Contribution description

This PR aims to fix #21922. First of all I don't know how openDSME has worked at all as I tried the example with 2023.07 (#18156) with no success. The issue was that radio_off on the nrf also turns off the clock source the slot timer needs to be accurate so the node wakes up too late for the beacon and loses sync right after association. As we don't want to keep that clock running for every application the simplest solution was to request it in the auto_init of the nrf radio since it's only needed for opendsme.
This enables receiving beacons again but only one frame could be sent all following frames are ignored by gnrc_netif since it waits for a confirm_send() that opendsme never calls cause of lack a netdev see the ugly hack in DSMEPlatform::initialize

    /* TODO: UGLY HACK! To be removed when gnrc_netif<->netdev dependency is
     * not granted */
    this->radio = (ieee802154_dev_t *)this->netif->dev;

Testing procedure

On master you will have the issue described in #21922
With this PR the device will stay associated and is able to transmit multiple frames

Issues/PRs references

Fixes #21922

Declaration of AI-Tools / LLMs usage:

AI-Tools / LLMs that were used are:

  • Claude Opus 5.5 for helping debugging, explaining some internal workings of grnc and pruposing suggestion

@github-actions github-actions Bot added Area: network Area: Networking Area: pkg Area: External package ports Area: sys Area: System labels Oct 29, 2026
@Stopkaa Stopkaa changed the title pkg/opendsme: fix pkg/opendsme: fix beacon loss on nrf after association Oct 29, 2026
@Stopkaa Stopkaa added Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors) CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR AI: Co-Authored PR/Issue relies on AI. Documentation / Code was partly generated by AI. labels Oct 29, 2026
@Stopkaa
Stopkaa requested a review from benpicco October 29, 2026 16:01
@riot-ci

riot-ci commented Oct 29, 2026 •

Copy link
Copy Markdown

Murdock results

✔️ PASSED

8fd597d Update pkg/opendsme/contrib/gnrc_netif_opendsme.cpp

Success Failures Total Runtime
14012 0 14013 10m:38s

Artifacts

Co-authored-by: crasbe <crasbe@gmail.com>
gnrc_netif_hdr_t *hdr = (gnrc_netif_hdr_t *)pkt->data;

if (hdr->flags &= GNRC_NETIF_HDR_FLAGS_MULTICAST) {
if (hdr->flags & GNRC_NETIF_HDR_FLAGS_MULTICAST) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude suggested checking for ..._BROADCAST as well. I'll have to check if both have to be set (..._BROADCAST | ..._MULTICAST) or either one has to be set.

Will check again, but the session is on my office workstation which I won't see until next week or the week after.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BROADCAST and MULTICAST are the same in IEEE 802.15.4, but not in gnrc_netif (which also serves other link layers which make a difference there; e.g., Ethernet). So it does sound sensible to check both for a 802.15.4-based MAC.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI: Co-Authored PR/Issue relies on AI. Documentation / Code was partly generated by AI. Area: network Area: Networking Area: pkg Area: External package ports Area: sys Area: System CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

openDSME example application does not work reliable out of the box with nRF52840 MDK Dongles

4 participants