Skip to content

Using openthread based lwm2m_client cannot ping the external network address unless reset once #30688

@taoyinzhou

Description

@taoyinzhou

Describe the bug
I want to implement the thread terminal to automatically connect to the OTBR by commissioning after it starts, and then connect to the external network.
OTBR runs openwrt Integrated with otbr-posix.
The nrf52840 runs .hex file which is one compiled from samples/net/lwm2m_client .
overlay-ot.conf modified:

CONFIG_OPENTHREAD_JOINER=y
CONFIG_OPENTHREAD_JOINER_AUTOSTART=y
CONFIG_OPENTHREAD_JOINER_PSKD="H00R11"
CONFIG_OPENTHREAD_SLAAC=y
CONFIG_NET_IF_UNICAST_IPV6_ADDR_COUNT=6

Before the terminal starts, OTBR will create Thread network with dataset first.

ot-ctl dataset init new
ot-ctl dataset commit active
ot-ctl prefix add fd11:22::/64 pasor
ot-ctl ifconfig up
ot-ctl thread start
ot-ctl netdata register
ot-ctl commissioner start
ot-ctl commissioner joiner add f4ce36dbda49db09 H00R11

Then the terminal start up, i can see the print: net_l2_openthread: Join success.
The role becomes to router.Then ping 64:ff9b::8.8.8.8.

uart:~$ ot ipaddr
fd11:22:0:0:9f08:e2a4:55fb:1ed2
fd29:ceec:9986:f495:0:ff:fe00:3405
fd29:ceec:9986:f495:4c17:fed1:1e5a:e436
fe80:0:0:0:d465:305:ab6b:802
fdde:ad00:beef:0:0:0:0:1
Done
uart:~$ net ping 64:ff9b::8.8.8.8
PING 64:ff9b::8.8.8.8
Ping timeout

Then re-plug the power or ot reset. The terminal will be able to ping the external network

uart:~$ ot state
router
Done
uart:~$ net ping 64:ff9b::8.8.8.8
PING 64:ff9b::8.8.8.8
8 bytes from 64:ff9b::808:808 to fd11:22::e656:880f:ea71:9128: icmp_seq=1 ttl=112 rssi=0 time=43 ms
8 bytes from 64:ff9b::808:808 to fd11:22::e656:880f:ea71:9128: icmp_seq=2 ttl=112 rssi=0 time=45 ms

This problem is like #29567, but he is directly set panid and channel to connect, I have tried this way is normal, but using commissioning there will have problem.

To Reproduce
Steps to reproduce the behavior:
west build -s samples/net/lwm2m_client -b nrf52840dk_nrf52840 -- -DCONF_FILE="prj.conf overlay-ot.conf"

Expected behavior
OTBR start commissioning. Then theThread device power on, it can connect to the Thread Network and connect to the internet.

Impact
After the Thread device connects to the network, it must be restarted once, otherwise it cannot connect to the external network

Logs and console output
If applicable, add console logs or other types of debug information
e.g Wireshark capture or Logic analyzer capture (upload in zip archive).
copy-and-paste text and put a code fence (```) before and after, to help
explain the issue. (if unable to obtain text log, add a screenshot)

Environment (please complete the following information):

  • OS: (e.g. Linux, MacOS, Windows)
  • Toolchain (e.g Zephyr SDK, ...)
  • Commit SHA or Version used

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

Labels

area: OpenThreadbugThe issue is a bug, or the PR is fixing a bugpriority: mediumMedium impact/importance bug

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions