MQTT sample for nRF9161_ns compilation error

Hello, I.m using SDK 2.6.1 with VSCode.

I created a new application based on the sample /nrf/samples/net/mqtt configured for nRF9161_ns which is listed as a compatible board.

When I build the application I get 2 compilation errors:

C:/ncs/MyApp/mqtt_clean/src/modules/network/network.c:16:30: error: 'CONFIG_MQTT_SAMPLE_NETWORK_LOG_LEVEL' undeclared here (not in a function); did you mean 'CONFIG_MQTT_SAMPLE_ERROR_LOG_LEVEL'?

C:/ncs/MyApp/mqtt_clean/src/modules/network/network.c:110:17: error: 'CONFIG_MQTT_SAMPLE_NETWORK_THREAD_STACK_SIZE' undeclared here (not in a function); did you mean 'CONFIG_MQTT_SAMPLE_SAMPLER_THREAD_STACK_SIZE'?

Substituting,  as the compiler is suggesting, CONFIG_MQTT_SAMPLE_NETWORK_LOG_LEVEL with CONFIG_MQTT_SAMPLE_ERROR_LOG_LEVEL and CONFIG_MQTT_SAMPLE_NETWORK_THREAD_STACK_SIZE with CONFIG_MQTT_SAMPLE_SAMPLER_THREAD_STACK_SIZE fixes the compilation errors.

Not sure the above correction is correct, since when I start the application I do not see any meaningful trace on the serial port with exception of  "*** Booting nRF Connect SDK v3.5.99-ncs1-1 ***" which isn't the output one would expect considering what reported in https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/samples/net/mqtt/README.html.

Im running the MQTT sample on a nRF9161_DK board with a properly working ONOMONDO  LTE CatM SIM.

Could you confirm that SDK 2.6.1 nrf MQTT sample is generating the above listed error ?

Is the fix succested by the compiler correct (CONFIG_MQTT_SAMPLE_NETWORK_LOG_LEVEL ->CONFIG_MQTT_SAMPLE_ERROR_LOG_LEVEL and CONFIG_MQTT_SAMPLE_NETWORK_THREAD_STACK_SIZE->CONFIG_MQTT_SAMPLE_SAMPLER_THREAD_STACK_SIZE )?

regards, Joel

Parents
  • Hello Joel,

    Are you sure that you are using the MQTT sample from 2.6.1 with the NCS 2.6.1?

    I can build it without any issues for nrf9161dk_9161_ns board.

    Best regards,

    Michal

  • Hello Michal .... yes 100% sure

    nrf/samples/net/mqtt


    -- west build: generating a build system
    Loading Zephyr default modules (Zephyr base).
    -- Application: C:/ncs/MyApp/mqtt
    -- CMake version: 3.21.0
    -- Found Python3: C:/ncs/toolchains/cf2149caf2/opt/bin/python.exe (found suitable version "3.9.13", minimum required is "3.8") found components: Interpreter
    -- Cache files will be written to: C:/ncs/v2.6.1/zephyr/.cache
    -- Zephyr version: 3.5.99 (C:/ncs/v2.6.1/zephyr)
    -- Found west (found suitable version "1.2.0", minimum required is "0.14.0")
    -- Board: nrf9161dk_nrf9161_ns, Revision: 0.9.0
    -- Found host-tools: zephyr 0.16.5 (C:/ncs/toolchains/cf2149caf2/opt/zephyr-sdk)
    -- Found toolchain: zephyr 0.16.5 (C:/ncs/toolchains/cf2149caf2/opt/zephyr-sdk)
    -- Found Dtc: C:/ncs/toolchains/cf2149caf2/opt/bin/dtc.exe (found suitable version "1.4.7", minimum required is "1.4.6")
    -- Found BOARD.dts: C:/ncs/v2.6.1/zephyr/boards/arm/nrf9161dk_nrf9161/nrf9161dk_nrf9161_ns.dts
    -- Found devicetree overlay: C:/ncs/MyApp/mqtt/boards/nrf9161dk_nrf9161_ns.overlay
    -- Generated zephyr.dts: C:/ncs/MyApp/mqtt/build/zephyr/zephyr.dts
    -- Generated devicetree_generated.h: C:/ncs/MyApp/mqtt/build/zephyr/include/generated/devicetree_generated.h
    -- Including generated dts.cmake file: C:/ncs/MyApp/mqtt/build/zephyr/dts.cmake

    warning: Experimental symbol NET_CONNECTION_MANAGER is enabled.

    Regards Joel

  • Hello, to make a double check, yesterday at home I installed "from scratch" Nordic SDK and toolchain 2.6.1 on my Win11 laptop. As before, I generated a new application starting from nrf MQTT sample and i configured the build for nRF9161 NS... the result was exactly the same ... same errors... unless this is an error affecting only Switzerland, there is definitively an issue in the source code... 

    Regards, Joel

Reply
  • Hello, to make a double check, yesterday at home I installed "from scratch" Nordic SDK and toolchain 2.6.1 on my Win11 laptop. As before, I generated a new application starting from nrf MQTT sample and i configured the build for nRF9161 NS... the result was exactly the same ... same errors... unless this is an error affecting only Switzerland, there is definitively an issue in the source code... 

    Regards, Joel

Children
No Data
Related