Jeedella / Plantenna_2_Node

This repo contains smart sustainable sensor node
4 stars 2 forks source link

Merging: Fails to build develop branch. #6

Closed joepboumans closed 3 years ago

joepboumans commented 3 years ago

Not a single of the BLE, mesh_client or mesh_server builds Mesh library seems to no longer work. Multiple warnings and numerous errors.

sookah commented 3 years ago

Hi @joepboumans, can you also paste here the errors, you can make screenshots and paste here from clipboard or upload the files. Also what steps have you taken?

joepboumans commented 3 years ago

It gave the following errors. I did already change the CMake file and prj.conf to even get to building the project. I asked @Jeedella to grant me premissions to push, so these changes are not visible yet.

FAILED: CMakeFiles/app.dir/src/mesh/mesh_base_model.c.obj
C:\GNU\102021~1.07\bin\AR19DD~1.EXE -DBUILD_VERSION=v2.7.0-rc1-100-g50ff77fa910d -DKERNEL -DNRF52832_XXAA -D_FORTIFY_SOURCE=2 -D__LINUX_ERRNO_EXTENSIONS__ -D__PROGRAM_START -D__SPMS_BT=2 -D__ZEPHYR__=1 -IC:/Users/Joep/zephyrproject/zephyr/projects/Plantenna_2_Node/GLOB -IC:/Users/Joep/zephyrproject/zephyr/projects/Plantenna_2_Node/inc -IC:/Users/Joep/zephyrproject/zephyr/projects/Plantenna_2_Node/inc/ble -IC:/Users/Joep/zephyrproject/zephyr/projects/Plantenna_2_Node/inc/mesh -IC:/Users/Joep/zephyrproject/zephyr/include -IC:/Users/Joep/zephyrproject/zephyr/build/zephyr/include/generated -IC:/Users/Joep/zephyrproject/zephyr/soc/arm/nordic_nrf/nrf52 -IC:/Users/Joep/zephyrproject/zephyr/lib/libc/newlib/include -IC:/Users/Joep/zephyrproject/zephyr/subsys/bluetooth -IC:/Users/Joep/zephyrproject/zephyr/subsys/settings/include -IC:/Users/Joep/zephyrproject/modules/hal/cmsis/CMSIS/Core/Include -IC:/Users/Joep/zephyrproject/modules/hal/nordic/nrfx -IC:/Users/Joep/zephyrproject/modules/hal/nordic/nrfx/drivers/include -IC:/Users/Joep/zephyrproject/modules/hal/nordic/nrfx/mdk -IC:/Users/Joep/zephyrproject/zephyr/modules/hal_nordic/nrfx/. -IC:/Users/Joep/zephyrproject/modules/debug/segger/SEGGER -IC:/Users/Joep/zephyrproject/modules/debug/segger/Config -IC:/Users/Joep/zephyrproject/zephyr/modules/segger/. -IC:/Users/Joep/zephyrproject/modules/crypto/tinycrypt/lib/include -Os -imacros C:/Users/Joep/zephyrproject/zephyr/build/zephyr/include/generated/autoconf.h -ffreestanding -fno-common -g -gdwarf-4 -fdiagnostics-color=always -mcpu=cortex-m4 -mthumb -mabi=aapcs -mfp16-format=ieee -imacros C:/Users/Joep/zephyrproject/zephyr/include/toolchain/zephyr_stdint.h -Wall -Wformat -Wformat-security -Wno-format-zero-length -Wno-main -Wno-pointer-sign -Wpointer-arith -Wexpansion-to-defined -Wno-address-of-packed-member -Wno-unused-but-set-variable -Werror=implicit-int -fno-asynchronous-unwind-tables -fno-pie -fno-pic -fno-strict-overflow -fno-reorder-functions -fno-defer-pop -fmacro-prefix-map=C:/Users/Joep/zephyrproject/zephyr/projects/Plantenna_2_Node=CMAKE_SOURCE_DIR -fmacro-prefix-map=C:/Users/Joep/zephyrproject/zephyr=ZEPHYR_BASE -fmacro-prefix-map=C:/Users/Joep/zephyrproject=WEST_TOPDIR -ffunction-sections -fdata-sections -specs=nano.specs -std=c99 -MD -MT CMakeFiles/app.dir/src/mesh/mesh_base_model.c.obj -MF CMakeFiles\app.dir\src\mesh\mesh_base_model.c.obj.d -o CMakeFiles/app.dir/src/mesh/mesh_base_model.c.obj -c C:/Users/Joep/zephyrproject/zephyr/projects/Plantenna_2_Node/src/mesh/mesh_base_model.c
In file included from C:/Users/Joep/zephyrproject/zephyr/projects/Plantenna_2_Node/inc/mesh/mesh_base_model.h:21,
                 from C:/Users/Joep/zephyrproject/zephyr/projects/Plantenna_2_Node/src/mesh/mesh_base_model.c:25:
C:/Users/Joep/zephyrproject/zephyr/projects/Plantenna_2_Node/inc/mesh/mesh_sensor_client.h:90:52: warning: initialization of 'int (*)(struct bt_mesh_model *, struct bt_mesh_msg_ctx *, struct net_buf_simple *)' from incompatible pointer type 'void (*)(struct bt_mesh_model *, struct bt_mesh_msg_ctx *, struct net_buf_simple *)' [-Wincompatible-pointer-types]
   90 |     {BT_MESH_MODEL_OP_SENSOR_DESCRIPTOR_STATUS, 0, sensor_descriptor_status_rx},
      |                                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/Users/Joep/zephyrproject/zephyr/projects/Plantenna_2_Node/inc/mesh/mesh_sensor_client.h:90:52: note: (near initialization for 'sensor_cli_op[0].func')
C:/Users/Joep/zephyrproject/zephyr/projects/Plantenna_2_Node/inc/mesh/mesh_sensor_client.h:91:52: warning: initialization of 'int (*)(struct bt_mesh_model *, struct bt_mesh_msg_ctx *, struct net_buf_simple *)' from incompatible pointer type 'void (*)(struct bt_mesh_model *, struct bt_mesh_msg_ctx *, struct net_buf_simple *)' [-Wincompatible-pointer-types]
   91 |     {BT_MESH_MODEL_OP_SENSOR_DATA_STATUS,       0, sensor_data_status_rx},
      |                                                    ^~~~~~~~~~~~~~~~~~~~~
C:/Users/Joep/zephyrproject/zephyr/projects/Plantenna_2_Node/inc/mesh/mesh_sensor_client.h:91:52: note: (near initialization for 'sensor_cli_op[1].func')
C:/Users/Joep/zephyrproject/zephyr/projects/Plantenna_2_Node/inc/mesh/mesh_sensor_client.h:92:52: warning: initialization of 'int (*)(struct bt_mesh_model *, struct bt_mesh_msg_ctx *, struct net_buf_simple *)' from incompatible pointer type 'void (*)(struct bt_mesh_model *, struct bt_mesh_msg_ctx *, struct net_buf_simple *)' [-Wincompatible-pointer-types]
   92 |     {BT_MESH_MODEL_OP_SENSOR_COLUMN_STATUS,     0, sensor_column_status_rx},
      |                                                    ^~~~~~~~~~~~~~~~~~~~~~~
C:/Users/Joep/zephyrproject/zephyr/projects/Plantenna_2_Node/inc/mesh/mesh_sensor_client.h:92:52: note: (near initialization for 'sensor_cli_op[2].func')
C:/Users/Joep/zephyrproject/zephyr/projects/Plantenna_2_Node/inc/mesh/mesh_sensor_client.h:93:52: warning: initialization of 'int (*)(struct bt_mesh_model *, struct bt_mesh_msg_ctx *, struct net_buf_simple *)' from incompatible pointer type 'void (*)(struct bt_mesh_model *, struct bt_mesh_msg_ctx *, struct net_buf_simple *)' [-Wincompatible-pointer-types]
   93 |     {BT_MESH_MODEL_OP_SENSOR_SERIES_STATUS,     0, sensor_series_status_rx},
      |                                                    ^~~~~~~~~~~~~~~~~~~~~~~
C:/Users/Joep/zephyrproject/zephyr/projects/Plantenna_2_Node/inc/mesh/mesh_sensor_client.h:93:52: note: (near initialization for 'sensor_cli_op[3].func')
C:/Users/Joep/zephyrproject/zephyr/projects/Plantenna_2_Node/inc/mesh/mesh_sensor_client.h:94:52: warning: initialization of 'int (*)(struct bt_mesh_model *, struct bt_mesh_msg_ctx *, struct net_buf_simple *)' from incompatible pointer type 'void (*)(struct bt_mesh_model *, struct bt_mesh_msg_ctx *, struct net_buf_simple *)' [-Wincompatible-pointer-types]
   94 |     {BT_MESH_MODEL_OP_SENSOR_CADENCE_STATUS,    0, sensor_cadence_status_rx},
      |                                                    ^~~~~~~~~~~~~~~~~~~~~~~~
C:/Users/Joep/zephyrproject/zephyr/projects/Plantenna_2_Node/inc/mesh/mesh_sensor_client.h:94:52: note: (near initialization for 'sensor_cli_op[4].func')
C:/Users/Joep/zephyrproject/zephyr/projects/Plantenna_2_Node/inc/mesh/mesh_sensor_client.h:95:52: warning: initialization of 'int (*)(struct bt_mesh_model *, struct bt_mesh_msg_ctx *, struct net_buf_simple *)' from incompatible pointer type 'void (*)(struct bt_mesh_model *, struct bt_mesh_msg_ctx *, struct net_buf_simple *)' [-Wincompatible-pointer-types]
   95 |     {BT_MESH_MODEL_OP_SENSOR_SETTINGS_STATUS,   0, sensor_settings_status_rx},
      |                                                    ^~~~~~~~~~~~~~~~~~~~~~~~~
C:/Users/Joep/zephyrproject/zephyr/projects/Plantenna_2_Node/inc/mesh/mesh_sensor_client.h:95:52: note: (near initialization for 'sensor_cli_op[5].func')
C:/Users/Joep/zephyrproject/zephyr/projects/Plantenna_2_Node/inc/mesh/mesh_sensor_client.h:96:52: warning: initialization of 'int (*)(struct bt_mesh_model *, struct bt_mesh_msg_ctx *, struct net_buf_simple *)' from incompatible pointer type 'void (*)(struct bt_mesh_model *, struct bt_mesh_msg_ctx *, struct net_buf_simple *)' [-Wincompatible-pointer-types]
   96 |     {BT_MESH_MODEL_OP_SENSOR_SETTING_STATUS,    0, sensor_setting_status_rx},
      |                                                    ^~~~~~~~~~~~~~~~~~~~~~~~
C:/Users/Joep/zephyrproject/zephyr/projects/Plantenna_2_Node/inc/mesh/mesh_sensor_client.h:96:52: note: (near initialization for 'sensor_cli_op[6].func')
C:/Users/Joep/zephyrproject/zephyr/projects/Plantenna_2_Node/src/mesh/mesh_base_model.c:94:15: error: variable 'cfg_srv' has initializer but incomplete type
   94 | static struct bt_mesh_cfg_srv cfg_srv = {
      |               ^~~~~~~~~~~~~~~
C:/Users/Joep/zephyrproject/zephyr/projects/Plantenna_2_Node/src/mesh/mesh_base_model.c:95:6: error: 'struct bt_mesh_cfg_srv' has no member named 'relay'
   95 |     .relay = BT_MESH_RELAY_DISABLED,
      |      ^~~~~
In file included from C:/Users/Joep/zephyrproject/zephyr/include/bluetooth/mesh.h:20,
                 from C:/Users/Joep/zephyrproject/zephyr/projects/Plantenna_2_Node/inc/mesh/mesh_sensor_client.h:20,
                 from C:/Users/Joep/zephyrproject/zephyr/projects/Plantenna_2_Node/inc/mesh/mesh_base_model.h:21,
                 from C:/Users/Joep/zephyrproject/zephyr/projects/Plantenna_2_Node/src/mesh/mesh_base_model.c:25:
C:/Users/Joep/zephyrproject/zephyr/include/bluetooth/mesh/cfg.h:45:45: warning: excess elements in struct initializer
   45 | #define BT_MESH_RELAY_DISABLED              BT_MESH_FEATURE_DISABLED
      |                                             ^~~~~~~~~~~~~~~~~~~~~~~~
C:/Users/Joep/zephyrproject/zephyr/projects/Plantenna_2_Node/src/mesh/mesh_base_model.c:95:14: note: in expansion of macro 'BT_MESH_RELAY_DISABLED'
   95 |     .relay = BT_MESH_RELAY_DISABLED,
      |              ^~~~~~~~~~~~~~~~~~~~~~
C:/Users/Joep/zephyrproject/zephyr/include/bluetooth/mesh/cfg.h:45:45: note: (near initialization for 'cfg_srv')
   45 | #define BT_MESH_RELAY_DISABLED              BT_MESH_FEATURE_DISABLED
      |                                             ^~~~~~~~~~~~~~~~~~~~~~~~
C:/Users/Joep/zephyrproject/zephyr/projects/Plantenna_2_Node/src/mesh/mesh_base_model.c:95:14: note: in expansion of macro 'BT_MESH_RELAY_DISABLED'
   95 |     .relay = BT_MESH_RELAY_DISABLED,
      |              ^~~~~~~~~~~~~~~~~~~~~~
C:/Users/Joep/zephyrproject/zephyr/projects/Plantenna_2_Node/src/mesh/mesh_base_model.c:96:6: error: 'struct bt_mesh_cfg_srv' has no member named 'beacon'
   96 |     .beacon = BT_MESH_BEACON_DISABLED,
      |      ^~~~~~
In file included from C:/Users/Joep/zephyrproject/zephyr/include/bluetooth/mesh.h:20,
                 from C:/Users/Joep/zephyrproject/zephyr/projects/Plantenna_2_Node/inc/mesh/mesh_sensor_client.h:20,
                 from C:/Users/Joep/zephyrproject/zephyr/projects/Plantenna_2_Node/inc/mesh/mesh_base_model.h:21,
                 from C:/Users/Joep/zephyrproject/zephyr/projects/Plantenna_2_Node/src/mesh/mesh_base_model.c:25:
C:/Users/Joep/zephyrproject/zephyr/include/bluetooth/mesh/cfg.h:49:45: warning: excess elements in struct initializer
   49 | #define BT_MESH_BEACON_DISABLED             BT_MESH_FEATURE_DISABLED
      |                                             ^~~~~~~~~~~~~~~~~~~~~~~~
C:/Users/Joep/zephyrproject/zephyr/projects/Plantenna_2_Node/src/mesh/mesh_base_model.c:96:15: note: in expansion of macro 'BT_MESH_BEACON_DISABLED'
   96 |     .beacon = BT_MESH_BEACON_DISABLED,
      |               ^~~~~~~~~~~~~~~~~~~~~~~
C:/Users/Joep/zephyrproject/zephyr/include/bluetooth/mesh/cfg.h:49:45: note: (near initialization for 'cfg_srv')
   49 | #define BT_MESH_BEACON_DISABLED             BT_MESH_FEATURE_DISABLED
      |                                             ^~~~~~~~~~~~~~~~~~~~~~~~
C:/Users/Joep/zephyrproject/zephyr/projects/Plantenna_2_Node/src/mesh/mesh_base_model.c:96:15: note: in expansion of macro 'BT_MESH_BEACON_DISABLED'
   96 |     .beacon = BT_MESH_BEACON_DISABLED,
      |               ^~~~~~~~~~~~~~~~~~~~~~~
C:/Users/Joep/zephyrproject/zephyr/projects/Plantenna_2_Node/src/mesh/mesh_base_model.c:97:6: error: 'struct bt_mesh_cfg_srv' has no member named 'frnd'
   97 |     .frnd = BT_MESH_FRIEND_NOT_SUPPORTED,
      |      ^~~~
In file included from C:/Users/Joep/zephyrproject/zephyr/include/bluetooth/mesh.h:20,
                 from C:/Users/Joep/zephyrproject/zephyr/projects/Plantenna_2_Node/inc/mesh/mesh_sensor_client.h:20,
                 from C:/Users/Joep/zephyrproject/zephyr/projects/Plantenna_2_Node/inc/mesh/mesh_base_model.h:21,
                 from C:/Users/Joep/zephyrproject/zephyr/projects/Plantenna_2_Node/src/mesh/mesh_base_model.c:25:
C:/Users/Joep/zephyrproject/zephyr/include/bluetooth/mesh/cfg.h:58:45: warning: excess elements in struct initializer
   58 | #define BT_MESH_FRIEND_NOT_SUPPORTED        BT_MESH_FEATURE_NOT_SUPPORTED
      |                                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/Users/Joep/zephyrproject/zephyr/projects/Plantenna_2_Node/src/mesh/mesh_base_model.c:97:13: note: in expansion of macro 'BT_MESH_FRIEND_NOT_SUPPORTED'
   97 |     .frnd = BT_MESH_FRIEND_NOT_SUPPORTED,
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/Users/Joep/zephyrproject/zephyr/include/bluetooth/mesh/cfg.h:58:45: note: (near initialization for 'cfg_srv')
   58 | #define BT_MESH_FRIEND_NOT_SUPPORTED        BT_MESH_FEATURE_NOT_SUPPORTED
      |                                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/Users/Joep/zephyrproject/zephyr/projects/Plantenna_2_Node/src/mesh/mesh_base_model.c:97:13: note: in expansion of macro 'BT_MESH_FRIEND_NOT_SUPPORTED'
   97 |     .frnd = BT_MESH_FRIEND_NOT_SUPPORTED,
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/Users/Joep/zephyrproject/zephyr/projects/Plantenna_2_Node/src/mesh/mesh_base_model.c:98:6: error: 'struct bt_mesh_cfg_srv' has no member named 'gatt_proxy'
   98 |     .gatt_proxy = BT_MESH_GATT_PROXY_ENABLED,
      |      ^~~~~~~~~~
In file included from C:/Users/Joep/zephyrproject/zephyr/include/bluetooth/mesh.h:20,
                 from C:/Users/Joep/zephyrproject/zephyr/projects/Plantenna_2_Node/inc/mesh/mesh_sensor_client.h:20,
                 from C:/Users/Joep/zephyrproject/zephyr/projects/Plantenna_2_Node/inc/mesh/mesh_base_model.h:21,
                 from C:/Users/Joep/zephyrproject/zephyr/projects/Plantenna_2_Node/src/mesh/mesh_base_model.c:25:
C:/Users/Joep/zephyrproject/zephyr/include/bluetooth/mesh/cfg.h:53:45: warning: excess elements in struct initializer
   53 | #define BT_MESH_GATT_PROXY_ENABLED          BT_MESH_FEATURE_ENABLED
      |                                             ^~~~~~~~~~~~~~~~~~~~~~~
C:/Users/Joep/zephyrproject/zephyr/projects/Plantenna_2_Node/src/mesh/mesh_base_model.c:98:19: note: in expansion of macro 'BT_MESH_GATT_PROXY_ENABLED'
   98 |     .gatt_proxy = BT_MESH_GATT_PROXY_ENABLED,
      |                   ^~~~~~~~~~~~~~~~~~~~~~~~~~
C:/Users/Joep/zephyrproject/zephyr/include/bluetooth/mesh/cfg.h:53:45: note: (near initialization for 'cfg_srv')
   53 | #define BT_MESH_GATT_PROXY_ENABLED          BT_MESH_FEATURE_ENABLED
      |                                             ^~~~~~~~~~~~~~~~~~~~~~~
C:/Users/Joep/zephyrproject/zephyr/projects/Plantenna_2_Node/src/mesh/mesh_base_model.c:98:19: note: in expansion of macro 'BT_MESH_GATT_PROXY_ENABLED'
   98 |     .gatt_proxy = BT_MESH_GATT_PROXY_ENABLED,
      |                   ^~~~~~~~~~~~~~~~~~~~~~~~~~
C:/Users/Joep/zephyrproject/zephyr/projects/Plantenna_2_Node/src/mesh/mesh_base_model.c:99:6: error: 'struct bt_mesh_cfg_srv' has no member named 'default_ttl'
   99 |     .default_ttl = 7,
      |      ^~~~~~~~~~~
C:/Users/Joep/zephyrproject/zephyr/projects/Plantenna_2_Node/src/mesh/mesh_base_model.c:99:20: warning: excess elements in struct initializer
   99 |     .default_ttl = 7,
      |                    ^
C:/Users/Joep/zephyrproject/zephyr/projects/Plantenna_2_Node/src/mesh/mesh_base_model.c:99:20: note: (near initialization for 'cfg_srv')
C:/Users/Joep/zephyrproject/zephyr/projects/Plantenna_2_Node/src/mesh/mesh_base_model.c:101:6: error: 'struct bt_mesh_cfg_srv' has no member named 'net_transmit'
  101 |     .net_transmit = BT_MESH_TRANSMIT(2, 20),
      |      ^~~~~~~~~~~~
In file included from C:/Users/Joep/zephyrproject/zephyr/include/bluetooth/mesh.h:18,
                 from C:/Users/Joep/zephyrproject/zephyr/projects/Plantenna_2_Node/inc/mesh/mesh_sensor_client.h:20,
                 from C:/Users/Joep/zephyrproject/zephyr/projects/Plantenna_2_Node/inc/mesh/mesh_base_model.h:21,
                 from C:/Users/Joep/zephyrproject/zephyr/projects/Plantenna_2_Node/src/mesh/mesh_base_model.c:25:
C:/Users/Joep/zephyrproject/zephyr/include/bluetooth/mesh/access.h:290:41: warning: excess elements in struct initializer
  290 | #define BT_MESH_TRANSMIT(count, int_ms) ((count) | (((int_ms / 10) - 1) << 3))
      |                                         ^
C:/Users/Joep/zephyrproject/zephyr/projects/Plantenna_2_Node/src/mesh/mesh_base_model.c:101:21: note: in expansion of macro 'BT_MESH_TRANSMIT'
  101 |     .net_transmit = BT_MESH_TRANSMIT(2, 20),
      |                     ^~~~~~~~~~~~~~~~
C:/Users/Joep/zephyrproject/zephyr/include/bluetooth/mesh/access.h:290:41: note: (near initialization for 'cfg_srv')
  290 | #define BT_MESH_TRANSMIT(count, int_ms) ((count) | (((int_ms / 10) - 1) << 3))
      |                                         ^
C:/Users/Joep/zephyrproject/zephyr/projects/Plantenna_2_Node/src/mesh/mesh_base_model.c:101:21: note: in expansion of macro 'BT_MESH_TRANSMIT'
  101 |     .net_transmit = BT_MESH_TRANSMIT(2, 20),
      |                     ^~~~~~~~~~~~~~~~
C:/Users/Joep/zephyrproject/zephyr/projects/Plantenna_2_Node/src/mesh/mesh_base_model.c:117:26: error: expected '}' before '(' token
  117 |     BT_MESH_MODEL_CFG_SRV(&cfg_srv),
      |                          ^
C:/Users/Joep/zephyrproject/zephyr/projects/Plantenna_2_Node/src/mesh/mesh_base_model.c:116:37: note: to match this '{'
  116 | struct bt_mesh_model sig_models[] = {
      |                                     ^
C:/Users/Joep/zephyrproject/zephyr/projects/Plantenna_2_Node/src/mesh/mesh_base_model.c:94:31: error: storage size of 'cfg_srv' isn't known
   94 | static struct bt_mesh_cfg_srv cfg_srv = {
      |                               ^~~~~~~
C:/Users/Joep/zephyrproject/zephyr/projects/Plantenna_2_Node/src/mesh/mesh_base_model.c:108:34: warning: 'health_srv' defined but not used [-Wunused-variable]
  108 | static struct bt_mesh_health_srv health_srv = {
      |                                  ^~~~~~~~~~
In file included from C:/Users/Joep/zephyrproject/zephyr/include/bluetooth/mesh.h:18,
                 from C:/Users/Joep/zephyrproject/zephyr/projects/Plantenna_2_Node/inc/mesh/mesh_sensor_client.h:20,
                 from C:/Users/Joep/zephyrproject/zephyr/projects/Plantenna_2_Node/inc/mesh/mesh_base_model.h:21,
                 from C:/Users/Joep/zephyrproject/zephyr/projects/Plantenna_2_Node/src/mesh/mesh_base_model.c:25:
C:/Users/Joep/zephyrproject/zephyr/projects/Plantenna_2_Node/src/mesh/mesh_base_model.c:107:27: warning: 'health_pub' defined but not used [-Wunused-variable]
  107 | BT_MESH_HEALTH_PUB_DEFINE(health_pub, 0);
      |                           ^~~~~~~~~~
C:/Users/Joep/zephyrproject/zephyr/include/bluetooth/mesh/access.h:409:34: note: in definition of macro 'BT_MESH_MODEL_PUB_DEFINE'
  409 |  static struct bt_mesh_model_pub _name = { \
      |                                  ^~~~~
C:/Users/Joep/zephyrproject/zephyr/projects/Plantenna_2_Node/src/mesh/mesh_base_model.c:107:1: note: in expansion of macro 'BT_MESH_HEALTH_PUB_DEFINE'
  107 | BT_MESH_HEALTH_PUB_DEFINE(health_pub, 0);
      | ^~~~~~~~~~~~~~~~~~~~~~~~~
C:/Users/Joep/zephyrproject/zephyr/projects/Plantenna_2_Node/src/mesh/mesh_base_model.c:94:31: warning: 'cfg_srv' defined but not used [-Wunused-variable]
   94 | static struct bt_mesh_cfg_srv cfg_srv = {
      |                               ^~~~~~~
In file included from C:/Users/Joep/zephyrproject/zephyr/include/bluetooth/mesh.h:18,
                 from C:/Users/Joep/zephyrproject/zephyr/projects/Plantenna_2_Node/inc/mesh/mesh_sensor_client.h:20,
                 from C:/Users/Joep/zephyrproject/zephyr/projects/Plantenna_2_Node/inc/mesh/mesh_base_model.h:21,
                 from C:/Users/Joep/zephyrproject/zephyr/projects/Plantenna_2_Node/src/mesh/mesh_base_model.c:25:
C:/Users/Joep/zephyrproject/zephyr/projects/Plantenna_2_Node/inc/mesh/mesh_sensor_client.h:101:26: warning: 'sensor_cli' defined but not used [-Wunused-variable]
  101 | BT_MESH_MODEL_PUB_DEFINE(sensor_cli, NULL, sensor_model_pub_msg_length);
      |                          ^~~~~~~~~~
C:/Users/Joep/zephyrproject/zephyr/include/bluetooth/mesh/access.h:409:34: note: in definition of macro 'BT_MESH_MODEL_PUB_DEFINE'
  409 |  static struct bt_mesh_model_pub _name = { \
      |                                  ^~~~~
[49/229] Building C object CMakeFiles/app.dir/src/main.c.obj
In file included from C:/Users/Joep/zephyrproject/zephyr/projects/Plantenna_2_Node/inc/mesh/mesh_base_model.h:21,
                 from C:/Users/Joep/zephyrproject/zephyr/projects/Plantenna_2_Node/src/main.c:19:
C:/Users/Joep/zephyrproject/zephyr/projects/Plantenna_2_Node/inc/mesh/mesh_sensor_client.h:90:52: warning: initialization of 'int (*)(struct bt_mesh_model *, struct bt_mesh_msg_ctx *, struct net_buf_simple *)' from incompatible pointer type 'void (*)(struct bt_mesh_model *, struct bt_mesh_msg_ctx *, struct net_buf_simple *)' [-Wincompatible-pointer-types]
   90 |     {BT_MESH_MODEL_OP_SENSOR_DESCRIPTOR_STATUS, 0, sensor_descriptor_status_rx},
      |                                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/Users/Joep/zephyrproject/zephyr/projects/Plantenna_2_Node/inc/mesh/mesh_sensor_client.h:90:52: note: (near initialization for 'sensor_cli_op[0].func')
C:/Users/Joep/zephyrproject/zephyr/projects/Plantenna_2_Node/inc/mesh/mesh_sensor_client.h:91:52: warning: initialization of 'int (*)(struct bt_mesh_model *, struct bt_mesh_msg_ctx *, struct net_buf_simple *)' from incompatible pointer type 'void (*)(struct bt_mesh_model *, struct bt_mesh_msg_ctx *, struct net_buf_simple *)' [-Wincompatible-pointer-types]
   91 |     {BT_MESH_MODEL_OP_SENSOR_DATA_STATUS,       0, sensor_data_status_rx},
      |                                                    ^~~~~~~~~~~~~~~~~~~~~
C:/Users/Joep/zephyrproject/zephyr/projects/Plantenna_2_Node/inc/mesh/mesh_sensor_client.h:91:52: note: (near initialization for 'sensor_cli_op[1].func')
C:/Users/Joep/zephyrproject/zephyr/projects/Plantenna_2_Node/inc/mesh/mesh_sensor_client.h:92:52: warning: initialization of 'int (*)(struct bt_mesh_model *, struct bt_mesh_msg_ctx *, struct net_buf_simple *)' from incompatible pointer type 'void (*)(struct bt_mesh_model *, struct bt_mesh_msg_ctx *, struct net_buf_simple *)' [-Wincompatible-pointer-types]
   92 |     {BT_MESH_MODEL_OP_SENSOR_COLUMN_STATUS,     0, sensor_column_status_rx},
      |                                                    ^~~~~~~~~~~~~~~~~~~~~~~
C:/Users/Joep/zephyrproject/zephyr/projects/Plantenna_2_Node/inc/mesh/mesh_sensor_client.h:92:52: note: (near initialization for 'sensor_cli_op[2].func')
C:/Users/Joep/zephyrproject/zephyr/projects/Plantenna_2_Node/inc/mesh/mesh_sensor_client.h:93:52: warning: initialization of 'int (*)(struct bt_mesh_model *, struct bt_mesh_msg_ctx *, struct net_buf_simple *)' from incompatible pointer type 'void (*)(struct bt_mesh_model *, struct bt_mesh_msg_ctx *, struct net_buf_simple *)' [-Wincompatible-pointer-types]
   93 |     {BT_MESH_MODEL_OP_SENSOR_SERIES_STATUS,     0, sensor_series_status_rx},
      |                                                    ^~~~~~~~~~~~~~~~~~~~~~~
C:/Users/Joep/zephyrproject/zephyr/projects/Plantenna_2_Node/inc/mesh/mesh_sensor_client.h:93:52: note: (near initialization for 'sensor_cli_op[3].func')
C:/Users/Joep/zephyrproject/zephyr/projects/Plantenna_2_Node/inc/mesh/mesh_sensor_client.h:94:52: warning: initialization of 'int (*)(struct bt_mesh_model *, struct bt_mesh_msg_ctx *, struct net_buf_simple *)' from incompatible pointer type 'void (*)(struct bt_mesh_model *, struct bt_mesh_msg_ctx *, struct net_buf_simple *)' [-Wincompatible-pointer-types]
   94 |     {BT_MESH_MODEL_OP_SENSOR_CADENCE_STATUS,    0, sensor_cadence_status_rx},
      |                                                    ^~~~~~~~~~~~~~~~~~~~~~~~
C:/Users/Joep/zephyrproject/zephyr/projects/Plantenna_2_Node/inc/mesh/mesh_sensor_client.h:94:52: note: (near initialization for 'sensor_cli_op[4].func')
C:/Users/Joep/zephyrproject/zephyr/projects/Plantenna_2_Node/inc/mesh/mesh_sensor_client.h:95:52: warning: initialization of 'int (*)(struct bt_mesh_model *, struct bt_mesh_msg_ctx *, struct net_buf_simple *)' from incompatible pointer type 'void (*)(struct bt_mesh_model *, struct bt_mesh_msg_ctx *, struct net_buf_simple *)' [-Wincompatible-pointer-types]
   95 |     {BT_MESH_MODEL_OP_SENSOR_SETTINGS_STATUS,   0, sensor_settings_status_rx},
      |                                                    ^~~~~~~~~~~~~~~~~~~~~~~~~
C:/Users/Joep/zephyrproject/zephyr/projects/Plantenna_2_Node/inc/mesh/mesh_sensor_client.h:95:52: note: (near initialization for 'sensor_cli_op[5].func')
C:/Users/Joep/zephyrproject/zephyr/projects/Plantenna_2_Node/inc/mesh/mesh_sensor_client.h:96:52: warning: initialization of 'int (*)(struct bt_mesh_model *, struct bt_mesh_msg_ctx *, struct net_buf_simple *)' from incompatible pointer type 'void (*)(struct bt_mesh_model *, struct bt_mesh_msg_ctx *, struct net_buf_simple *)' [-Wincompatible-pointer-types]
   96 |     {BT_MESH_MODEL_OP_SENSOR_SETTING_STATUS,    0, sensor_setting_status_rx},
      |                                                    ^~~~~~~~~~~~~~~~~~~~~~~~
C:/Users/Joep/zephyrproject/zephyr/projects/Plantenna_2_Node/inc/mesh/mesh_sensor_client.h:96:52: note: (near initialization for 'sensor_cli_op[6].func')
In file included from C:/Users/Joep/zephyrproject/zephyr/include/bluetooth/mesh.h:18,
                 from C:/Users/Joep/zephyrproject/zephyr/projects/Plantenna_2_Node/inc/mesh/mesh_sensor_client.h:20,
                 from C:/Users/Joep/zephyrproject/zephyr/projects/Plantenna_2_Node/inc/mesh/mesh_base_model.h:21,
                 from C:/Users/Joep/zephyrproject/zephyr/projects/Plantenna_2_Node/src/main.c:19:
C:/Users/Joep/zephyrproject/zephyr/projects/Plantenna_2_Node/inc/mesh/mesh_sensor_client.h:101:26: warning: 'sensor_cli' defined but not used [-Wunused-variable]
  101 | BT_MESH_MODEL_PUB_DEFINE(sensor_cli, NULL, sensor_model_pub_msg_length);
      |                          ^~~~~~~~~~
C:/Users/Joep/zephyrproject/zephyr/include/bluetooth/mesh/access.h:409:34: note: in definition of macro 'BT_MESH_MODEL_PUB_DEFINE'
  409 |  static struct bt_mesh_model_pub _name = { \
      |                                  ^~~~~
[50/229] Building C object CMakeFiles/app.dir/src/mesh/mesh_sensor_client.c.obj
In file included from C:/Users/Joep/zephyrproject/zephyr/projects/Plantenna_2_Node/inc/mesh/mesh_base_model.h:21,
                 from C:/Users/Joep/zephyrproject/zephyr/projects/Plantenna_2_Node/src/mesh/mesh_sensor_client.c:24:
C:/Users/Joep/zephyrproject/zephyr/projects/Plantenna_2_Node/inc/mesh/mesh_sensor_client.h:90:52: warning: initialization of 'int (*)(struct bt_mesh_model *, struct bt_mesh_msg_ctx *, struct net_buf_simple *)' from incompatible pointer type 'void (*)(struct bt_mesh_model *, struct bt_mesh_msg_ctx *, struct net_buf_simple *)' [-Wincompatible-pointer-types]
   90 |     {BT_MESH_MODEL_OP_SENSOR_DESCRIPTOR_STATUS, 0, sensor_descriptor_status_rx},
      |                                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/Users/Joep/zephyrproject/zephyr/projects/Plantenna_2_Node/inc/mesh/mesh_sensor_client.h:90:52: note: (near initialization for 'sensor_cli_op[0].func')
C:/Users/Joep/zephyrproject/zephyr/projects/Plantenna_2_Node/inc/mesh/mesh_sensor_client.h:91:52: warning: initialization of 'int (*)(struct bt_mesh_model *, struct bt_mesh_msg_ctx *, struct net_buf_simple *)' from incompatible pointer type 'void (*)(struct bt_mesh_model *, struct bt_mesh_msg_ctx *, struct net_buf_simple *)' [-Wincompatible-pointer-types]
   91 |     {BT_MESH_MODEL_OP_SENSOR_DATA_STATUS,       0, sensor_data_status_rx},
      |                                                    ^~~~~~~~~~~~~~~~~~~~~
C:/Users/Joep/zephyrproject/zephyr/projects/Plantenna_2_Node/inc/mesh/mesh_sensor_client.h:91:52: note: (near initialization for 'sensor_cli_op[1].func')
C:/Users/Joep/zephyrproject/zephyr/projects/Plantenna_2_Node/inc/mesh/mesh_sensor_client.h:92:52: warning: initialization of 'int (*)(struct bt_mesh_model *, struct bt_mesh_msg_ctx *, struct net_buf_simple *)' from incompatible pointer type 'void (*)(struct bt_mesh_model *, struct bt_mesh_msg_ctx *, struct net_buf_simple *)' [-Wincompatible-pointer-types]
   92 |     {BT_MESH_MODEL_OP_SENSOR_COLUMN_STATUS,     0, sensor_column_status_rx},
      |                                                    ^~~~~~~~~~~~~~~~~~~~~~~
C:/Users/Joep/zephyrproject/zephyr/projects/Plantenna_2_Node/inc/mesh/mesh_sensor_client.h:92:52: note: (near initialization for 'sensor_cli_op[2].func')
C:/Users/Joep/zephyrproject/zephyr/projects/Plantenna_2_Node/inc/mesh/mesh_sensor_client.h:93:52: warning: initialization of 'int (*)(struct bt_mesh_model *, struct bt_mesh_msg_ctx *, struct net_buf_simple *)' from incompatible pointer type 'void (*)(struct bt_mesh_model *, struct bt_mesh_msg_ctx *, struct net_buf_simple *)' [-Wincompatible-pointer-types]
   93 |     {BT_MESH_MODEL_OP_SENSOR_SERIES_STATUS,     0, sensor_series_status_rx},
      |                                                    ^~~~~~~~~~~~~~~~~~~~~~~
C:/Users/Joep/zephyrproject/zephyr/projects/Plantenna_2_Node/inc/mesh/mesh_sensor_client.h:93:52: note: (near initialization for 'sensor_cli_op[3].func')
C:/Users/Joep/zephyrproject/zephyr/projects/Plantenna_2_Node/inc/mesh/mesh_sensor_client.h:94:52: warning: initialization of 'int (*)(struct bt_mesh_model *, struct bt_mesh_msg_ctx *, struct net_buf_simple *)' from incompatible pointer type 'void (*)(struct bt_mesh_model *, struct bt_mesh_msg_ctx *, struct net_buf_simple *)' [-Wincompatible-pointer-types]
   94 |     {BT_MESH_MODEL_OP_SENSOR_CADENCE_STATUS,    0, sensor_cadence_status_rx},
      |                                                    ^~~~~~~~~~~~~~~~~~~~~~~~
C:/Users/Joep/zephyrproject/zephyr/projects/Plantenna_2_Node/inc/mesh/mesh_sensor_client.h:94:52: note: (near initialization for 'sensor_cli_op[4].func')
C:/Users/Joep/zephyrproject/zephyr/projects/Plantenna_2_Node/inc/mesh/mesh_sensor_client.h:95:52: warning: initialization of 'int (*)(struct bt_mesh_model *, struct bt_mesh_msg_ctx *, struct net_buf_simple *)' from incompatible pointer type 'void (*)(struct bt_mesh_model *, struct bt_mesh_msg_ctx *, struct net_buf_simple *)' [-Wincompatible-pointer-types]
   95 |     {BT_MESH_MODEL_OP_SENSOR_SETTINGS_STATUS,   0, sensor_settings_status_rx},
      |                                                    ^~~~~~~~~~~~~~~~~~~~~~~~~
C:/Users/Joep/zephyrproject/zephyr/projects/Plantenna_2_Node/inc/mesh/mesh_sensor_client.h:95:52: note: (near initialization for 'sensor_cli_op[5].func')
C:/Users/Joep/zephyrproject/zephyr/projects/Plantenna_2_Node/inc/mesh/mesh_sensor_client.h:96:52: warning: initialization of 'int (*)(struct bt_mesh_model *, struct bt_mesh_msg_ctx *, struct net_buf_simple *)' from incompatible pointer type 'void (*)(struct bt_mesh_model *, struct bt_mesh_msg_ctx *, struct net_buf_simple *)' [-Wincompatible-pointer-types]
   96 |     {BT_MESH_MODEL_OP_SENSOR_SETTING_STATUS,    0, sensor_setting_status_rx},
      |                                                    ^~~~~~~~~~~~~~~~~~~~~~~~
C:/Users/Joep/zephyrproject/zephyr/projects/Plantenna_2_Node/inc/mesh/mesh_sensor_client.h:96:52: note: (near initialization for 'sensor_cli_op[6].func')
C:/Users/Joep/zephyrproject/zephyr/projects/Plantenna_2_Node/src/mesh/mesh_sensor_client.c: In function 'sensor_descriptor_status_rx':
C:/Users/Joep/zephyrproject/zephyr/projects/Plantenna_2_Node/src/mesh/mesh_sensor_client.c:136:25: warning: initialization of 'char *' from incompatible pointer type 'uint16_t *' {aka 'short unsigned int *'} [-Wincompatible-pointer-types]
  136 |             char* nxt = &payload[(i << 4) + 3];
      |                         ^
In file included from C:/Users/Joep/zephyrproject/zephyr/include/bluetooth/mesh.h:18,
                 from C:/Users/Joep/zephyrproject/zephyr/projects/Plantenna_2_Node/src/mesh/mesh_sensor_client.c:18:
At top level:
C:/Users/Joep/zephyrproject/zephyr/projects/Plantenna_2_Node/inc/mesh/mesh_sensor_client.h:101:26: warning: 'sensor_cli' defined but not used [-Wunused-variable]
  101 | BT_MESH_MODEL_PUB_DEFINE(sensor_cli, NULL, sensor_model_pub_msg_length);
      |                          ^~~~~~~~~~
C:/Users/Joep/zephyrproject/zephyr/include/bluetooth/mesh/access.h:409:34: note: in definition of macro 'BT_MESH_MODEL_PUB_DEFINE'
  409 |  static struct bt_mesh_model_pub _name = { \
      |                                  ^~~~~
[51/229] Building C object CMakeFiles/app.dir/src/spms_sensor.c.obj
C:/Users/Joep/zephyrproject/zephyr/projects/Plantenna_2_Node/src/spms_sensor.c: In function 'sensor_read':
C:/Users/Joep/zephyrproject/zephyr/projects/Plantenna_2_Node/src/spms_sensor.c:135:5: warning: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
  135 |     printf("[Sensor] Vout %lf\n", Vout);
      |     ^~~~~~
C:/Users/Joep/zephyrproject/zephyr/projects/Plantenna_2_Node/src/spms_sensor.c:4:1: note: 'printf' is defined in header '<stdio.h>'; did you forget to '#include <stdio.h>'?
    3 | #include "spms_sensor.h"
  +++ |+#include <stdio.h>
    4 |
C:/Users/Joep/zephyrproject/zephyr/projects/Plantenna_2_Node/src/spms_sensor.c:138:24: warning: implicit declaration of function 'pow' [-Wimplicit-function-declaration]
  138 |     airflowMem->airf = pow((((Vout - 1.30)/(3.038517*pow(25,0.115157)))/0.087288),3.009364)*0.44704;
      |                        ^~~
[53/229] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/fdtable.c.obj
ninja: build stopped: subcommand failed.
FATAL ERROR: command exited with status 1: 'C:\Program Files\CMake\bin\cmake.EXE' --build 'C:\Users\Joep\zephyrproject\zephyr\build'
Tijntj3 commented 3 years ago

My guess is that it has something to do with the standard C libraries used. For acquiring sensor data (using spms_sensor.h & spms_sensor.h) functions from the C standard & math library were required. IIR (I have not written this code, just merged it for someone else) for printing floating points and for pow (as seen in the error). Zephyr did/does not by default include a one to one replacement for these libraries. Because of that the sensor data acquiring is not really implemented in the best of ways.

For demo-ing mesh functionality spms_sensor is not really needed. The working proof of concept was made using pseudo random numbers. I recommend trying to build it without the sensor functionality.

The warnings around the mesh models appear normal. There were a lot of warnings too here for the last builds.

joepboumans commented 3 years ago

It seems to be a problem with the setup of the bt_mesh_cfg. I think the new zephyr functions don't use this setup for setting the config. After I removed the cfg_svr and adapted the BT_MESH_MODEL_CFG_SRV(&cfg_srv) to the default BT_MESH_MODEL_CFG_SRV and then it did build, but the UUID is not properly assigned:

Message: 0x550
Publishing descriptor get message...
bt_mesh_model_publish err -125
Get msg sending done
[00:00:00.523,193] <err> i2c_nrfx_twi: Error 0x0BAE0001 occurred for message 0
[00:00:00.560,760] <wrn> bt_hci_core: Failed to set device name (-12)
[00:00:00.561,950] <inf> bt_hci_core: HW Platform: Nordic Semiconductor (0x0002)
[00:00:00.561,950] <inf> bt_hci_core: HW Variant: nRF52x (0x0002)
[00:00:00.561,950] <inf> bt_hci_core: Firmware: Standard Bluetooth controller (0x00) Version 2.7 Build 0
[00:00:00.562,622] <inf> bt_hci_core: Identity: D4:1B:4F:79:E4:36 (random)
[00:00:00.562,652] <inf> bt_hci_core: HCI: version 5.2 (0x0b) revision 0x0000, manufacturer 0x05f1
[00:00:00.562,652] <inf> bt_hci_core: LMP: version 5.2 (0x0b) subver 0xffff
[00:00:00.572,204] <inf> bt_mesh_prov_device: Device UUID: <log_strdup alloc failed>
[00:00:00.612,915] <dbg> bt_mesh_access.bt_mesh_model_publish:
Tijntj3 commented 3 years ago

Nice find! I did not see the errors around BT_MESH_MODEL_CFG_SRV, since you only mentioned warnings in person. I am not familiar with newer versions of Zephyr (2.4.0 was used as seen in the README) unfortunately. Since mesh support is/was still in its infancy, I can imagine a whole lot changed in its implementation.

A part of my point still stands though, the data acquisition is not that great. PS. (probably unrelated), provisioning was done through the NRF mobile app in case that was still unknown.

joepboumans commented 3 years ago

I can now connect to and setup the mesh, but the get message from the client won't work. It gives the following error: bt_mesh_model_publish err -125 I couldn't find any documentation of what this error code means. The setup for the UUID also does not work and it always generates a new UUID. I'm not sure if this was intended @Tijntj3 since there is some definition of an UUID in the mesh_base_model.

joepboumans commented 3 years ago

I fixed the issue. I had not setup the mesh network correctly and did not specify a publish address. Once this was set and the sensor_data_get_tx(0); was enabled, data was able to be transported between two nodes.