Skip to content

sys/shell: add generic udp command#22049

Merged
mguetschow merged 5 commits intoRIOT-OS:masterfrom
mguetschow:shell-cmd-udp
Feb 20, 2026
Merged

sys/shell: add generic udp command#22049
mguetschow merged 5 commits intoRIOT-OS:masterfrom
mguetschow:shell-cmd-udp

Conversation

@mguetschow
Copy link
Contributor

Contribution description

I've noticed there are several shell command implementations for udp send and server functionality in RIOT. This PRs starts to unify those by replacing shell_cmd_gnrc_udp and the custom one in tests/pkg/lwip by a generic implementation based on sock_udp.

This command is added to the default shell commands if sock_udp is used.

Testing procedure

Tested successfully on native64 (Linux on the other side) with examples/networking/gnrc/networking and tests/pkg/lwip, both with IPv6 and IPv4 (on lwip).

Also just ran an interop test with having lwip on an adafruit-feather-nrf52840-sense and gnrc running on an nrf52840dk. I was able to send data from gnrc to lwip, but not the other way around for some reason. Needs further investigation.

Issues/PRs references

This is one step further to getting rid of the msg_queue requirement boilerplate in many example applications, as this implementation in contrast to the gnrc-specific one does not require a msg_queue (shell_cmd_gnrc_icmpv6_echo is the next and last one to tackle).

@github-actions github-actions bot added Area: tests Area: tests and testing framework Area: build system Area: Build system Area: sys Area: System Area: examples Area: Example Applications labels Feb 5, 2026
@mguetschow
Copy link
Contributor Author

Also just ran an interop test with having lwip on an adafruit-feather-nrf52840-sense and gnrc running on an nrf52840dk. I was able to send data from gnrc to lwip, but not the other way around for some reason. Needs further investigation.

Just tested, it also fails on current master.

@mguetschow mguetschow added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Feb 5, 2026
@riot-ci
Copy link

riot-ci commented Feb 5, 2026

Murdock results

✔️ PASSED

7393302 pkg/openwsn: fix some sock-async related issues

Success Failures Total Runtime
11005 0 11005 10m:18s

Artifacts

@mguetschow mguetschow added CI: no fast fail don't abort PR build after first error CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR and removed CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Feb 5, 2026
@github-actions github-actions bot added Area: network Area: Networking Area: doc Area: Documentation Area: pkg Area: External package ports labels Feb 6, 2026
@mguetschow
Copy link
Contributor Author

Also just ran an interop test with having lwip on an adafruit-feather-nrf52840-sense and gnrc running on an nrf52840dk. I was able to send data from gnrc to lwip, but not the other way around for some reason. Needs further investigation.

Just tested, it also fails on current master.

Obviously this is just another instance of #21843

Copy link
Member

@maribu maribu left a comment

Choose a reason for hiding this comment

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

Thx! looks good to me. some remarks inline.

Comment on lines +217 to +221
#if IS_USED(MODULE_ZTIMER_USEC)
ztimer_sleep(ZTIMER_USEC, delay);
#elif IS_USED(MODULE_ZTIMER_MSEC)
ztimer_sleep(ZTIMER_MSEC, (delay + US_PER_MS - 1) / US_PER_MS);
#endif
Copy link
Member

Choose a reason for hiding this comment

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

@benpicco How far are we with ripping out the xtimer code and using the xtimer-API as a thin layer on top of ztimer for when you want "whatever clock is available" to be used?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Uh, that'd be great: #21960

@mguetschow
Copy link
Contributor Author

Some memory stats:

# on master
   text    data     bss     dec     hex filename
  99616     228   20432  120276   1d5d4 /home/mikolai/TUD/Code/RIOT-build/examples/networking/gnrc/networking/bin/nrf52840dk/gnrc_networking.elf

   text    data     bss     dec     hex filename
 103744     200   19008  122952   1e048 /home/mikolai/TUD/Code/RIOT-build/tests/pkg/lwip/bin/nrf52840dk/tests_lwip.elf

# with this PR
   text    data     bss     dec     hex filename
  99720     220   19928  119868   1d43c /home/mikolai/TUD/Code/RIOT-build/examples/networking/gnrc/networking/bin/nrf52840dk/gnrc_networking.elf

   text    data     bss     dec     hex filename
 104148     208   18656  123012   1e084 /home/mikolai/TUD/Code/RIOT-build/tests/pkg/lwip/bin/nrf52840dk/tests_lwip.elf

@mguetschow
Copy link
Contributor Author

I think everything should be addressed by now. Friendly ping @maribu

@mguetschow mguetschow enabled auto-merge February 16, 2026 09:43
@mguetschow mguetschow added this pull request to the merge queue Feb 16, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 16, 2026
@mguetschow mguetschow added CI: full build disable CI build filter CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR and removed CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Feb 16, 2026
@mguetschow mguetschow removed the CI: full build disable CI build filter label Feb 20, 2026
@mguetschow mguetschow enabled auto-merge February 20, 2026 14:54
@mguetschow mguetschow added this pull request to the merge queue Feb 20, 2026
Merged via the queue into RIOT-OS:master with commit 5c9a7cb Feb 20, 2026
26 checks passed
@mguetschow
Copy link
Contributor Author

Thanks for the reviews! :)

@mguetschow mguetschow deleted the shell-cmd-udp branch February 24, 2026 09:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: build system Area: Build system Area: doc Area: Documentation Area: examples Area: Example Applications Area: network Area: Networking Area: pkg Area: External package ports Area: sys Area: System Area: tests Area: tests and testing framework CI: no fast fail don't abort PR build after first error CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants