Adding nRF7002DK to the Golioth

Hi,
would like to add nRF7002DK to the Golioth and observe the data from the device!
So far I have wind10 running VC with the ncs and west including python3 installed. I can build the zypher ncs examples and flash them to the device. I have enabled the zypher logging. Indeed went true your training. So far all works, however, not sure how to continue and connect the device to the net, eventually Golioth and read eg. the blinking LED.

Would you please give me a short example to follow?

Best!

Hi mu234, nice to hear from you!

When you mention you are building the “zypher ncs examples” can you tell me where those examples are located?

The best working example we have for the nrf7002dk is the 01_IOT example that use use in our free Zephyr training (the next training is in 2 weeks if you’re interested). Here is the code repository for that example:

Hi Mike

Thanks, I am following this example: zephyr-training/01_IOT at main · golioth/zephyr-training · GitHub

used my current account and added the required PSK information… as suggested.

However, when building the 01_IOT example via .env I got the KConfig errors, wondering what is going ?

(.venv) C:\ncs\v2.3.0\zephyr\zephyr-training-main>west build -b nrf7002dk_nrf5340_cpuapp 01_IOT
– west build: generating a build system
Loading Zephyr default modules (Zephyr base (cached)).
– Application: C:/ncs/v2.3.0/zephyr/zephyr-training-main/01_IOT
– Using NCS Toolchain 2.3.0 for building. (C:/ncs/toolchains/v2.3.0/cmake)
– Cache files will be written to: C:/ncs/v2.3.0/zephyr/.cache
– Zephyr version: 3.2.99 (C:/ncs/v2.3.0/zephyr)
– Found west (found suitable version “0.14.0”, minimum required is “0.7.1”)
– Board: nrf7002dk_nrf5340_cpuapp
– Found host-tools: zephyr 0.15.2 (C:/ncs/toolchains/v2.3.0/opt/zephyr-sdk)
– Found toolchain: zephyr 0.15.2 (C:/ncs/toolchains/v2.3.0/opt/zephyr-sdk)
– Found BOARD.dts: C:/ncs/v2.3.0/nrf/boards/arm/nrf7002dk_nrf5340/nrf7002dk_nrf5340_cpuapp.dts
– Generated zephyr.dts: C:/ncs/v2.3.0/zephyr/zephyr-training-main/build/zephyr/zephyr.dts
– Generated devicetree_generated.h: C:/ncs/v2.3.0/zephyr/zephyr-training-main/build/zephyr/include/generated/devicetree_generated.h
– Including generated dts.cmake file: C:/ncs/v2.3.0/zephyr/zephyr-training-main/build/zephyr/dts.cmake
Parsing C:/ncs/v2.3.0/zephyr/zephyr-training-main/01_IOT/Kconfig
Loaded configuration ‘C:/ncs/v2.3.0/nrf/boards/arm/nrf7002dk_nrf5340/nrf7002dk_nrf5340_cpuapp_defconfig’
Merged configuration ‘C:/ncs/v2.3.0/zephyr/zephyr-training-main/01_IOT/prj.conf’
Merged configuration ‘C:/ncs/v2.3.0/zephyr/zephyr-training-main/01_IOT/boards/nrf7002dk_nrf5340_cpuapp.conf’

warning: Experimental symbol NET_SOCKETPAIR is enabled.

C:/ncs/v2.3.0/zephyr/zephyr-training-main/01_IOT/prj.conf:7: warning: attempt to assign the value ‘y’ to the undefined symbol GOLIOTH_SAMPLES_COMMON

C:/ncs/v2.3.0/zephyr/zephyr-training-main/01_IOT/prj.conf:16: warning: attempt to assign the value ‘y’ to the undefined symbol GOLIOTH

C:/ncs/v2.3.0/zephyr/zephyr-training-main/01_IOT/prj.conf:17: warning: attempt to assign the value ‘y’ to the undefined symbol GOLIOTH_SYSTEM_CLIENT

C:/ncs/v2.3.0/zephyr/zephyr-training-main/01_IOT/prj.conf:18: warning: attempt to assign the value ‘4096’ to the undefined symbol GOLIOTH_SYSTEM_CLIENT_STACK_SIZE

C:/ncs/v2.3.0/zephyr/zephyr-training-main/01_IOT/prj.conf:19: warning: attempt to assign the value ‘y’ to the undefined symbol LOG_BACKEND_GOLIOTH

C:/ncs/v2.3.0/zephyr/zephyr-training-main/01_IOT/prj.conf:21: warning: attempt to assign the value ‘y’ to the undefined symbol GOLIOTH_RPC

C:/ncs/v2.3.0/zephyr/zephyr-training-main/01_IOT/prj.conf:22: warning: attempt to assign the value ‘y’ to the undefined symbol GOLIOTH_SETTINGS

C:/ncs/v2.3.0/zephyr/zephyr-training-main/01_IOT/prj.conf:25: warning: attempt to assign the value ‘y’ to the undefined symbol GOLIOTH_SAMPLE_SETTINGS_AUTOLOAD

C:/ncs/v2.3.0/zephyr/zephyr-training-main/01_IOT/prj.conf:26: warning: attempt to assign the value ‘y’ to the undefined symbol GOLIOTH_SAMPLE_SETTINGS_SHELL

C:/ncs/v2.3.0/zephyr/zephyr-training-main/01_IOT/prj.conf:27: warning: attempt to assign the value ‘y’ to the undefined symbol GOLIOTH_SETTINGS

error: Aborting due to Kconfig warnings

CMake Error at C:/ncs/v2.3.0/zephyr/cmake/modules/kconfig.cmake:328 (message):
command failed with return code: 1
Call Stack (most recent call first):
C:/ncs/v2.3.0/nrf/cmake/modules/kconfig.cmake:29 (include)
C:/ncs/v2.3.0/zephyr/cmake/modules/zephyr_default.cmake:108 (include)
C:/ncs/v2.3.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:66 (include)
C:/ncs/v2.3.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:97 (include_boilerplate)
CMakeLists.txt:5 (find_package)

– Configuring incomplete, errors occurred!
←[91mFATAL ERROR: command exited with status 1: ‘C:\Program Files\CMake\bin\cmake.EXE’ ‘-DWEST_PYTHON=C:\Python311\python.exe’ ‘-BC:\ncs\v2.3.0\zephyr\zephyr-training-main\build’ -GNinja ‘-SC:\ncs\v2.3.0\zephyr\zephyr-training-main\01_IOT’
←[0m
(.venv) C:\ncs\v2.3.0\zephyr\zephyr-training-main>

Hey @mu234 ,

It looks like the build system isn’t seeing the Golioth module, and it’s unaware of the Golioth-specific Kconfig symbols used in the training applications.

Are you able to build Golioth samples, or are you experiencing the same Kconfig warnings?

Hey Marko!

I am trying to install the 01_IoT training example, which is the Golioth example, right?
While I can successfully build the e.g. 02_helloworld.

02_helloworld sample in the Zephyr training isn’t using any Golioth specific code, it’s the Hello World sample that has been copied directly from the Zephyr tree.

The Golioth samples I was referencing can be found in /modules/lib/golioth/samples.

01_IOT sample from the Zephyr training is using Golioth specific code. The most likely scenario for this kind of errors is that you didn’t add Golioth Zephyr SDK to the Zephyr based project as a west module correctly.

Start from successfully building the golioth samples from the SDK and work your way up to the Zephyr training applications.

OK, thanks, downloaded the Golith-zephyr-sdk-main and saved it to the root dir.
Doing the west update within the dir. , hope this is the right way…

Trying to build:

PS C:\golioth-zephyr-sdk-main\samples> west build -b nrf7002dk_nrf5340_cpuapp
ERROR: source directory "." does not contain a CMakeLists.txt; is this really what you want to build? (Use -s SOURCE_DIR to specify the application source directory)
FATAL ERROR: refusing to proceed without --force due to above error
PS C:\golioth-zephyr-sdk-main\samples>

Error, it looks, like the board driver is missing, how can I add the nrf7002dk board to the Golioth SDK folder?

OK, added the boards … tried to build, but still errors… wondering what does this mean?
Thank you in advance for any comments, help?

Best.


Loaded configuration ‘C:/golioth-zephyr-sdk-main/zephyr/boards/arm/nrf7002dk_nrf5340/nrf7002dk_nrf5340_cpuapp_defconfig’
Merged configuration ‘C:/golioth-zephyr-sdk-main/samples/hello/prj.conf’
Merged configuration ‘C:/golioth-zephyr-sdk-main/samples/hello/boards/nrf7002dk_nrf5340_cpuapp.conf’

C:/golioth-zephyr-sdk-main/samples/hello/boards/nrf7002dk_nrf5340_cpuapp.conf:15: warning: attempt to assign the value ‘y’ to the undefined symbol WPA_SUPP

C:/golioth-zephyr-sdk-main/samples/hello/boards/nrf7002dk_nrf5340_cpuapp.conf:19: warning: attempt to assign the value ‘y’ to the undefined symbol STA_KEY_MGMT_WPA2

C:/golioth-zephyr-sdk-main/samples/hello/boards/nrf7002dk_nrf5340_cpuapp.conf:20: warning: attempt to assign the value ‘n’ to the undefined symbol STA_KEY_MGMT_WPA2

C:/golioth-zephyr-sdk-main/samples/hello/boards/nrf7002dk_nrf5340_cpuapp.conf:21: warning: attempt to assign the value ‘n’ to the undefined symbol STA_KEY_MGMT_WPA2_256

C:/golioth-zephyr-sdk-main/samples/hello/boards/nrf7002dk_nrf5340_cpuapp.conf:22: warning: attempt to assign the value ‘n’ to the undefined symbol STA_KEY_MGMT_WPA3

error: Aborting due to Kconfig warnings

We just updated our training to use Codespaces as an online development environment. I would suggest following all the steps on this page to see if you can get the application to compile and run on your device: https://training.golioth.io/docs/zephyr-training/helloworld/compile-hello-world

As to the exact problem you are facing in this thread. I think we need to see the entire output of the build process to know more.

I have some concerns about what codebase is being build. Can you also run this command and paste the output?

west config manifest.file

¸Hello mike

thanks for the Codspaces … it works, I guess, if the IoT example is run I should connect to the Golitoh? Anyway, did try it out, should I follow the instructions?

root@codespaces-cd7fcd:/zephyr-training/app# west build -b nrf7002dk_nrf5340_cpuapp 01_IOT
ERROR: Build directory “/zephyr-training/app/build” is for application “/zephyr-training/app/02_helloworld”, but source directory “/zephyr-training/app/01_IOT” was specified; please clean it, use --pristine, or use --build-dir to set another build directory
FATAL ERROR: refusing to proceed without --force due to above error

Re virtual environemnt I am not really sure when I have to use the (.venv), and when I have to use the e.g. PowerShell instead of basic command prompt.
Yeah, I am not really a “administrator” :slight_smile: Had several issues with activating the venv…

Re west config manifest.file

Not sure where to “launch” it so went to the zephyr-training directory, anyway, nothing with regard to the output, hope this was expected ?

PS C:\Users\Administrator> cd .\zephyr-training
PS C:\Users\Administrator\zephyr-training> dir

Directory: C:\Users\Administrator\zephyr-training

Mode LastWriteTime Length Name


d----- 1/19/2024 11:23 AM .venv
d----- 1/19/2024 11:24 AM .west

PS C:\Users\Administrator\zephyr-training> west config manifest.file
PS C:\Users\Administrator\zephyr-training>

BTW I am not sure where to run with regard to the command line tool, etc.

Adding the whole output of the local build:

PS C:\ncs\v2.3.0\zephyr\zephyr-training-1.1.1\01_IOT> west build -b nrf7002dk_nrf5340_cpuapp
– west build: generating a build system
Loading Zephyr default modules (Zephyr base (cached)).
– Application: C:/ncs/v2.3.0/zephyr/zephyr-training-1.1.1/01_IOT
– Using NCS Toolchain 2.3.0 for building. (C:/ncs/toolchains/v2.3.0/cmake)
– Cache files will be written to: C:/ncs/v2.3.0/zephyr/.cache
– Zephyr version: 3.2.99 (C:/ncs/v2.3.0/zephyr)
– Found west (found suitable version “0.14.0”, minimum required is “0.7.1”)
– Board: nrf7002dk_nrf5340_cpuapp
– Found host-tools: zephyr 0.15.2 (C:/ncs/toolchains/v2.3.0/opt/zephyr-sdk)
– Found toolchain: zephyr 0.15.2 (C:/ncs/toolchains/v2.3.0/opt/zephyr-sdk)
– Found BOARD.dts: C:/ncs/v2.3.0/nrf/boards/arm/nrf7002dk_nrf5340/nrf7002dk_nrf5340_cpuapp.dts
– Generated zephyr.dts: C:/ncs/v2.3.0/zephyr/zephyr-training-1.1.1/01_IOT/build/zephyr/zephyr.dts
– Generated devicetree_generated.h: C:/ncs/v2.3.0/zephyr/zephyr-training-1.1.1/01_IOT/build/zephyr/include/generated/devicetree_generated.h
– Including generated dts.cmake file: C:/ncs/v2.3.0/zephyr/zephyr-training-1.1.1/01_IOT/build/zephyr/dts.cmake
Parsing C:/ncs/v2.3.0/zephyr/zephyr-training-1.1.1/01_IOT/Kconfig
Loaded configuration ‘C:/ncs/v2.3.0/nrf/boards/arm/nrf7002dk_nrf5340/nrf7002dk_nrf5340_cpuapp_defconfig’
Merged configuration ‘C:/ncs/v2.3.0/zephyr/zephyr-training-1.1.1/01_IOT/prj.conf’
Merged configuration ‘C:/ncs/v2.3.0/zephyr/zephyr-training-1.1.1/01_IOT/boards/nrf7002dk_nrf5340_cpuapp.conf’

warning: Experimental symbol NET_SOCKETPAIR is enabled.

C:/ncs/v2.3.0/zephyr/zephyr-training-1.1.1/01_IOT/prj.conf:7: warning: attempt to assign the value ‘y’ to the undefined symbol GOLIOTH_SAMPLES_COMMON

C:/ncs/v2.3.0/zephyr/zephyr-training-1.1.1/01_IOT/prj.conf:16: warning: attempt to assign the value ‘y’ to the undefined symbol GOLIOTH

C:/ncs/v2.3.0/zephyr/zephyr-training-1.1.1/01_IOT/prj.conf:17: warning: attempt to assign the value ‘y’ to the undefined symbol GOLIOTH_SYSTEM_CLIENT

C:/ncs/v2.3.0/zephyr/zephyr-training-1.1.1/01_IOT/prj.conf:18: warning: attempt to assign the value ‘4096’ to the undefined symbol GOLIOTH_SYSTEM_CLIENT_STACK_SIZE

C:/ncs/v2.3.0/zephyr/zephyr-training-1.1.1/01_IOT/prj.conf:19: warning: attempt to assign the value ‘y’ to the undefined symbol LOG_BACKEND_GOLIOTH

C:/ncs/v2.3.0/zephyr/zephyr-training-1.1.1/01_IOT/prj.conf:21: warning: attempt to assign the value ‘y’ to the undefined symbol GOLIOTH_RPC

C:/ncs/v2.3.0/zephyr/zephyr-training-1.1.1/01_IOT/prj.conf:22: warning: attempt to assign the value ‘y’ to the undefined symbol GOLIOTH_SETTINGS

C:/ncs/v2.3.0/zephyr/zephyr-training-1.1.1/01_IOT/prj.conf:25: warning: attempt to assign the value ‘y’ to the undefined symbol GOLIOTH_SAMPLE_SETTINGS_AUTOLOAD

C:/ncs/v2.3.0/zephyr/zephyr-training-1.1.1/01_IOT/prj.conf:26: warning: attempt to assign the value ‘y’ to the undefined symbol GOLIOTH_SAMPLE_SETTINGS_SHELL

C:/ncs/v2.3.0/zephyr/zephyr-training-1.1.1/01_IOT/prj.conf:27: warning: attempt to assign the value ‘y’ to the undefined symbol GOLIOTH_SETTINGS

error: Aborting due to Kconfig warnings

CMake Error at C:/ncs/v2.3.0/zephyr/cmake/modules/kconfig.cmake:328 (message):
command failed with return code: 1
Call Stack (most recent call first):
C:/ncs/v2.3.0/nrf/cmake/modules/kconfig.cmake:29 (include)
C:/ncs/v2.3.0/zephyr/cmake/modules/zephyr_default.cmake:108 (include)
C:/ncs/v2.3.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:66 (include)
C:/ncs/v2.3.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:97 (include_boilerplate)
CMakeLists.txt:5 (find_package)

– Configuring incomplete, errors occurred!
←[91mFATAL ERROR: command exited with status 1: ‘C:\Program Files\CMake\bin\cmake.EXE’ ‘-DWEST_PYTHON=C:\Python311\python.exe’ ‘-BC:\ncs\v2.3.0\zephyr\zephyr-training-1.1.1\01_IOT\build’ -GNinja ‘-SC:\ncs\v2.3.0\zephyr\zephyr-training-1.1.1\01_IOT’
←[0m
PS C:\ncs\v2.3.0\zephyr\zephyr-training-1.1.1\01_IOT>

Best.

Hello marko,
I would like to explore the Golioth´´’s samples, but I cannot find the /modules/lib/golioth/samples.
For example, could you be more specific, where exactly is this location ?

In general, I went back and tried to reinstall the Golioth training examples… however, check the readme in the root dir. and got stuck here:

Local set up


Do not clone this repo using git. Zephyr’s west meta tool should be used to
set up your local workspace.

Install the Python virtual environment (recommended)

… code-block:: console

cd ~
mkdir zephyr-training
python -m venv zephyr-training/.venv
source zephyr-training/.venv/bin/activate
pip install wheel west

For example, what is meant by source zephyr-training/.venv/bin/activate ?
Anyway, the if the pip install wheel west is used it returns that it is already installed …
However, according to the instructions given in the Readme, namely the Do not clone this repo using git. Zephyr's ``west`` meta tool should be used to set up your local workspace.

I have a feeling I have to reinstall the repo?

Best.

The instructions on the zephyr-trainiing repository are what you would use for a Linux computer. The steps for Windows will be very similar but the command syntax is a bit different. For instance, setting up a python virtual environment will be something like this:

# Install a python virtual environment
python -m venv zephyr-training\.venv

# Activate the virtual environment
:: cmd.exe
zephyr-training\.venv\Scripts\activate.bat

:: PowerShell
zephyr-training\.venv\Scripts\Activate.ps1

From there, follow the instructions on the zephyr-training repo README. When directories are references you’ll need to change the forward slashes (used in Linux) to backslashes (used by Windows).

Regarding the Golioth SDK samples: The zephyr-traininig repository is meant to be a standalone folder and will includes a deps folder that has both Zephyr and the Golioth Zephyr SDK in it. You should be able to find it in the zephyr-training\modules\lib\golioth folder. Just understand that those samples don’t have configuration and overlay files for the nRF7002. You’ll need to craft those and handle the WiFi connectivity yourself.

Thanks mike, these looks very useful, indeed, it works now,
the major problem was the fact that, I did not know that the training etc. is Linux syntax, my fault …

With regard to the "deps folder" I do not see it. For example. I have downloaded the zephyr-training-main which apparently does not have the mentioned folders? I have as well downloaded the golioth-zephyr-sdk-main and there is no folder named modules there as well.

With regard to the nRF7002dk Wi-Fi connectivity I guess the 01_IoT example could be used and connect to the Golioth, etc. ? I am intending to use the nRF7002DK for the PoC anyway …

Before I delve into the crafting, would you please comment:

  1. do we always build/flash the “project” via .venv?
  2. do we coding inside the e.g. VSCode IDE ?

Best.