Search code examples
iotcontikizephyr-rtosnrf52nrf52840

How to run Zephyr Echo Client-Server sample using nrf52840dk & nrf52840dongle?


I'm trying to run the Echo Client and Echo Server example of Zephyr. I want to use nrf5284dk as server and nrf5284dongle as client (or vice versa). I should also mention that my OS is Windows 11.

First I build and flashed the server to the dk.

west build -p -b nrf52840dk_nrf52840 -d build_dk_echo_server \zephyr\samples\net\sockets\echo_server\ -- -DCONF_FILE="prj.conf"
west flash -d .\build_dk_echo_server\

Then I tried to build and flash the client to the dongle.

west build -p -b nrf52840dongle_nrf52840 .\zephyr\samples\net\sockets\echo_client -- -DCONF_FILE="prj.conf" 
nrfutil pkg generate --hw-version 52 --sd-req=0x00 --application build/zephyr/zephyr.hex --application-version 1 echo_client_dongle.zip
nrfutil dfu usb-serial -pkg echo_client_dongle.zip -p COM11

But i get the error:

[00:00:00.321,746] <err> net_if: There is no network interface to work with!
*** Booting Zephyr OS build zephyr-v3.5.0-4086-g0a8d03b95f84 ***
[00:00:00.322,113] <wrn> net_config: No auto-started network interface - network-bound app initialization skipped.
[00:00:00.322,113] <inf> net_echo_client_sample: Run echo client
[00:00:00.322,174] <inf> net_echo_client_sample: Network disconnected

I am quite new at this (I don't have any previous experience with programming IoT devices). I do not even know if trying to run these samples in these devices is valid. Do I need to enable anything? What steps should I follow? Any information/guidance could help.

Thank you


Solution

  • To add an interface, you need to specify an overlay file. Overlay files are files used in addition to the configuration of your prj.conf. From echo client docs:

    west build -b nrf52840dk/nrf52840 samples/net/sockets/echo_client -- -DCONF_FILE="prj.conf overlay-ot.conf"
    

    And similarly for other protocols than OpenThread.

    See devicetree overlay docs to learn more about overlays.