Correct way to integrate MQTT wifi sample into an existing project?

Hi,

SDK: nRF Connect v2.7.0.

Hardware: nrf5340 + nrf7002 module (WT02C40C) on a custom board.

IDE: Visual Studio Code 1.95.3 (obviously with the nRF Connect extension).

I have an existing project based on the ble peripheral_uart sample, which is roughly doing what it's supposed to.

I now want to add MQTT-over-wifi functionality to this project. I have previously built and run the MQTT sample on this custom board. But I'm not sure how to go about adding the MQTT configuration to the existing configuration.

My first attempt was to take the contents of the prj.conf from the MQTT sample and paste it into the prj.conf in my target project, and also to copy the nrf7002dk_nrf5340_cpuapp_ns.conf file to the boards directory of my target project and point the build configuration at that file (in addition to the prj.conf).

But it looks like many symbols beginning with CONFIG_MQTT_SAMPLE are either undefined or undeclared, and many build errors occur.

So the question is, what is a good way to merge (using the term loosely) the MQTT sample into my existing ble_peripheral_uart-based project? I know that's a bit of a vague question, but any help would be appreciated and I'm happy to provide more information.

Thanks,

Richard.

Parents
  • To narrow down the scope of the question slightly: I'm reasonably confident that I can bring in the source files from from the MQTT project and "merge" the CMakeLists.txt files. I've made my first attempt at that and I think I'm in the right ballpark. The part I'm stumped by is the configuration.

    For some background, I spent a good amount of time with nRF5 SDK, and in similar situations where I wanted the functionality of two or more samples I would manually edit the sdk_config.h file and/or the .emProject, and I could usually make sense of the build errors and figure out what I needed to add or change. But after months with the Connect SDK I'm still pretty mystified by the config system.

Reply
  • To narrow down the scope of the question slightly: I'm reasonably confident that I can bring in the source files from from the MQTT project and "merge" the CMakeLists.txt files. I've made my first attempt at that and I think I'm in the right ballpark. The part I'm stumped by is the configuration.

    For some background, I spent a good amount of time with nRF5 SDK, and in similar situations where I wanted the functionality of two or more samples I would manually edit the sdk_config.h file and/or the .emProject, and I could usually make sense of the build errors and figure out what I needed to add or change. But after months with the Connect SDK I'm still pretty mystified by the config system.

Children
No Data
Related