zephyr: LwM2M: UDP local port setting not obeyed, random port doesn't work
I’m running into a number of fancy issues with LwM2M on a Nucleo-F429ZI board connected via Ethernet.
If the app is actually capable of sending out packets over the network I’m getting the following output:
[lib/lwm2m_rd_client] [INF] sm_do_init: RD Client started with endpoint 'nucleo_f429zi' and client lifetime 30
[lib/lwm2m_rd_client] [DBG] sm_send_registration: registration sent [212.18.24.70]
[lib/lwm2m_engine] [DBG] retransmit_request: Resending message: 0x20004024
[lib/lwm2m_engine] [DBG] retransmit_request: Resending message: 0x20004024
[lib/lwm2m_engine] [DBG] retransmit_request: Resending message: 0x20004024
[lib/lwm2m_engine] [DBG] retransmit_request: Resending message: 0x20004024
[lib/lwm2m_rd_client] [WRN] do_registration_timeout_cb: Registration Timeout
Further investigation with a mirrored port and wireshark shows that the packet is actually sent out, and ACKed by the server but the source IP chosen by zephyr is actually random instead of the configured port via CONFIG_LWM2M_LOCAL_PORT=5683 and for some reason Zephyr doesn’t route the reply sent to the chosen source port back to the receive function to the app but generates a ICMP message “Destination unreachable”.
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 32 (32 by maintainers)
I have a rather large LwM2M related patch queue, but over the next 30 patches DNS support is being added to the example.