Skip to content

Conversation

krzysztof-cabaj
Copy link
Contributor

Contribution description

This PR enables LWIP IPv4 in nanocoap_server, as we have IPv4 enable in tests/nanocoap_cli (see PR #21314).

Testing procedure

Enable LWIP IPv4 in Makefile by setting LWIP_IPV4 ?= 1, compile and execute example:

make all
./bin/native/nanocoap_server.elf tap0
RIOT native interrupts/signals initialized.
RIOT native board initialized.
RIOT native hardware initialization complete.

main(): This is RIOT! (Version: 2024.04-devel-2305-g5f08f5-examples-nanocoap-lwip)
RIOT nanocoap example application
Waiting for address autoconfiguration...
{"IPv4 addresses": ["192.168.100.150"]}

Test if example responds to coap messages, for example:

$ coap-client-notls -m GET coap://192.168.100.150/riot/board
native
$ coap-client-notls -m GET coap://192.168.100.150/riot/ver
This is RIOT (Version: 2024.04-devel-2305-g5f08f5-examples-nanocoap-lwip) running on a native board with a native MCU.

Issues/PRs references

PR #21314

@github-actions github-actions bot added Area: doc Area: Documentation Area: examples Area: Example Applications labels Mar 28, 2025
@benpicco benpicco added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Mar 28, 2025
@riot-ci
Copy link

riot-ci commented Mar 28, 2025

Murdock results

✔️ PASSED

5e2bfeb examples/nanocoap_server: enable DHCP and example doc update

Success Failures Total Runtime
18 0 19 01m:38s

Artifacts

@krzysztof-cabaj
Copy link
Contributor Author

I enable DHCP.

Using default configuration nanocoap_server gets IPv4 address via DHCP. If DHCP module is disabled (disable lwip_dhcp_auto module) example sets static IPv4 address - 192.168.100.150.

I hope this solution could work on any environment setups.

@krzysztof-cabaj
Copy link
Contributor Author

Hmmmm ... after Murdock error I compile code in my environment for qn9080dk board - and everythink works.

Is this Murdock error? Any ideas?

@krzysztof-cabaj krzysztof-cabaj force-pushed the examples-nanocoap-lwip branch from d8e687e to ff054fb Compare March 28, 2025 22:28
@krzysztof-cabaj
Copy link
Contributor Author

Similar compilation error is described for esp in PR #21316 When I try to use similar solution - enabling lwip_netif, this same compilation error starts appearing for hifive1b board. So probably there is bigger issue with LWIP for IPv4.

@krzysztof-cabaj krzysztof-cabaj force-pushed the examples-nanocoap-lwip branch 3 times, most recently from 93fb2bd to 1d8eaaf Compare March 28, 2025 23:28
@github-actions github-actions bot added Platform: ARM Platform: This PR/issue effects ARM-based platforms Area: cpu Area: CPU/MCU ports labels Mar 28, 2025
@krzysztof-cabaj krzysztof-cabaj force-pushed the examples-nanocoap-lwip branch from 62fec91 to f3987e0 Compare March 29, 2025 00:01
@krzysztof-cabaj
Copy link
Contributor Author

So probably I have a solution: enabling lwip_ethernet and netdev_legacy_api fix issue ... at least for some cpu, for example, qn908x, samd5x, etc.

@benpicco should I add fix for other remaining cpu in this PR? or open dedicated one?

@benpicco
Copy link
Contributor

No please don't add random dependencies to CPUs.
If lwIP integration can't build without a network device selected, that's an unrelated problem - nothing to solve in this PR.

No need to enable lwIP by default in this example too.

@krzysztof-cabaj krzysztof-cabaj force-pushed the examples-nanocoap-lwip branch from f3987e0 to 5e2bfeb Compare March 31, 2025 06:46
@github-actions github-actions bot removed Platform: ARM Platform: This PR/issue effects ARM-based platforms Area: cpu Area: CPU/MCU ports labels Mar 31, 2025
@krzysztof-cabaj
Copy link
Contributor Author

I removed unnecessary commits unrelated to this PR.

When this PR will be merged, I open new WIP Issue concerning dependency issue with LWIP IPv4.

@krzysztof-cabaj
Copy link
Contributor Author

@benpicco thanks for all remarks and servicing this PR.

Could you be so kind and add this PR to merge queue? ;)

@mguetschow mguetschow added this pull request to the merge queue Apr 1, 2025
Merged via the queue into RIOT-OS:master with commit d6a0260 Apr 1, 2025
26 checks passed
@mguetschow mguetschow added this to the Release 2025.04 milestone Apr 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: doc Area: Documentation Area: examples Area: Example Applications 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