This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Thingy:52 Mesh Network

Hello! I would like to implement a mesh network with some Thingy:52 boards. I have the following approach and I would need some general guidance for my next step, if it is possible. 

My idea: I want to implement a communication between my phone and a development kit through a mesh network, formed of Thingy:52 devices. 

My approach: For this, my idea would be the following: I started with a working example between my phone & the nRF 52840 board. I decided to go with the BLE Blinky Application, since it is quite straight-forward.

Question 1. Now, I am thinking how to integrate the Thingys:52 into my set-up, in order to build the mesh in-between. What kind of example should I start from? Do you have any suggestions?

Question 2. I read in some posts that the Thingys:52 should have this relay feature enabled by default, but I would like to know how is that made (i.e. in what function and/or what source code).

Thank you in advance and have a great week,

Marry

Parents Reply
  • Hello! I followed your advice & this link. Thank you!! But there are a lot of things which are not clear to me:

    1. First:

    Including nRF5 SDK in an nRF5 SDK for Mesh example

    Depending on your toolchain:

    • When using Segger Embedded Studio, add code files and include paths to the corresponding SES project file.

    - I do not understand specifically what I actually have to do.

    2. Second, 

    Including nRF5 SDK for Mesh functionality in an nRF5 SDK example

    1. Include the following source files from nRF5 SDK for Mesh in the nRF5 SDK example's project file:

    - where should these files be "included"? Should I just copy paste the folders from the Mesh Folder to the main folder of the DK application? 

    3. Same question for  step 2:

    2. Add the following folders to the project include path of the nRF5 SDK example

    - should I do some modifications in the code or just move some folders?

    Sorry if the question is basic, but I am trying my best to understand this Slight smile

    Have a great day!

Children
  • Hi.

    Marry said:
    Include the following source files from nRF5 SDK for Mesh in the nRF5 SDK example's project file

     The source files can be added directly to your project in the project explorer.

    This video on youtube explains how this can be done in SES:
    https://www.youtube.com/watch?v=t-kh1EbesvI&list=PLx_tBuQ_KSqGHmzdEL2GWEOeix-S5rgTV&index=7&t=0s

     

    Marry said:
    Add the following folders to the project include path of the nRF5 SDK example

     You can add the needed folders in the User include directories;
    Select your project -> Go to project -> Options -> Select Preprocessor and add the folders to the User include directories.

    I suggest that you take a look at the tutorial series that I linked above. It contains a lot of useful information about how to use the nRF5 SDK with SES.

    Br,
    Joakim

  • Hello 

    tutorial series that I linked above

    Thank you very much - I watched all of them and they are indeed life savers. 

    I have the following question now: after proceeding with all steps, I get this error 

    Building ‘ble_app_blinky_pca10056_s140’ from solution ‘ble_app_blinky_pca10056_s140’ in configuration ‘Release’
      Compiling ‘nrf_sdh_ble.c’
      Compiling ‘nrf_sdh.c’
      Compiling ‘access.c’
        nrf_mesh_config_core.h
        nrf_mesh.h
        device_state_manager.h
        access.h
        access.c
        #error "This file should be copied, not included."
        device_state_manager.h
        access.h
        access.c
        #error "This file should be copied, not included."
        utils.h
        access_internal.h
        access.c
        'ACCESS_FLASH_PAGE_COUNT' undeclared here (not in a function); did you mean 'NET_FLASH_PAGE_COUNT'?
        in definition of macro '_SELECT_ASSERT_FUNC'
        in expansion of macro 'STATIC_ASSERT_SIMPLE'
        in expansion of macro 'STATIC_ASSERT'
        in expansion of macro 'NRF_MESH_STATIC_ASSERT'
        expression in static assertion is not an integer
        in definition of macro '_SELECT_ASSERT_FUNC'
        in expansion of macro 'STATIC_ASSERT_SIMPLE'
        in expansion of macro 'STATIC_ASSERT'
        in expansion of macro 'NRF_MESH_STATIC_ASSERT'
        in expansion of macro 'FLASH_MANAGER_PAGE_COUNT_MINIMUM'
      Compiling ‘nrf_sdh_soc.c’
      Compiling ‘access_publish_retransmission.c’
        nrf_mesh_config_core.h
        nrf_mesh.h
        device_state_manager.h
        access.h
        access_publish_retransmission.h
        access_publish_retransmission.c
        #error "This file should be copied, not included."
        device_state_manager.h
        access.h
        access_publish_retransmission.h
        access_publish_retransmission.c
        #error "This file should be copied, not included."
      Compiling ‘access_reliable.c’
        nrf_mesh_config_core.h
        nrf_mesh.h
        device_state_manager.h
        access.h
        access_reliable.h
        access_reliable.c
        #error "This file should be copied, not included."
        device_state_manager.h
        access.h
        access_reliable.h
        access_reliable.c
        #error "This file should be copied, not included."
        access_reliable.c
        #error "This file should be copied, not included."
      Compiling ‘access_publish.c’
        nrf_mesh_config_core.h
        nrf_mesh.h
        device_state_manager.h
        access.h
        access_publish.h
        access_publish.c
        #error "This file should be copied, not included."
        device_state_manager.h
        access.h
        access_publish.h
        access_publish.c
        #error "This file should be copied, not included."
      Compiling ‘ad_listener.c’
        nrf_mesh_config_core.h
        nrf_mesh.h
        nrf_mesh_assert.h
        list.h
        ad_listener.h
        ad_listener.c
        #error "This file should be copied, not included."
    Build failed
    Do you know what I should look into? I am clueless. 

  • This error comes from nrf_mesh_config_app.h, in the first lines of code:

    #ifndef _lint
    #error "This file should be copied, not included."
    #endif

    But I cannot find where _lint is defined or set. 

  • Hi.

    You can take a look at this ticket addressing a similar issue: https://devzone.nordicsemi.com/f/nordic-q-a/65033/combining-mesh-and-blinky-examples/
    And the answer from my colleague:

    "From the documentation Integrating Mesh into nRF5 SDK examples

    • If you are adding you own mesh functionality rather than working from an existing mesh example, you also need to add the file nrf_mesh_config_app.h. Copy it from the examples/templates folder in mesh stack repository into your project folder, and remove #error message at the top of the file. Make other appropriate changes to the file content, like adjusting ACCESS_ELEMENT_COUNT and ACCESS_MODEL_COUNT to the required number of elements and models.

    Can you try copy from the template instead and remove #error message at the top of the fil? Does it make any difference? Also, go through the "Optional changes" in the document.

    A comment on combining the two examples though. I think it might be easier doing it the other way around, use a mesh example(for example light switch) and then add the nRF5 functionality to it instead."

    BR,
    Joakim

  • Hello. 

    You can take a look at this ticket addressing a similar issue: https://devzone.nordicsemi.com/f/nordic-q-a/65033/combining-mesh-and-blinky-examples/

    - Thanks, I checked this, but it's not helping me at the moment. I'll keep an eye on it. 

    Can you try copy from the template instead and remove #error message at the top of the fil? Does it make any difference?

    - I tried this. And now there is a new error mesh_opt_gatt.h not found...I commented the line in which that .h file is included and now I get new errors, as you may see in line 109.


    Rebuilding ‘ble_app_blinky_pca10056_s140’ from solution ‘ble_app_blinky_pca10056_s140’ in configuration ‘Release’
      Assembling ‘thumb_crt0.s’
      Compiling ‘nrf_log_backend_rtt.c’
      Compiling ‘nrf_log_backend_serial.c’
      Compiling ‘nrf_log_backend_uart.c’
      Compiling ‘nrf_log_default_backends.c’
      Compiling ‘nrf_log_frontend.c’
      Compiling ‘nrf_log_str_formatter.c’
      Compiling ‘app_button.c’
      Compiling ‘app_error.c’
      Compiling ‘app_error_handler_gcc.c’
      Compiling ‘app_error_weak.c’
      Compiling ‘app_scheduler.c’
      Compiling ‘app_timer.c’
      Compiling ‘app_util_platform.c’
      Compiling ‘hardfault_implementation.c’
      Compiling ‘nrf_assert.c’
      Compiling ‘nrf_atfifo.c’
      Compiling ‘nrf_atflags.c’
      Compiling ‘nrf_atomic.c’
      Compiling ‘nrf_balloc.c’
      Compiling ‘nrf_fprintf.c’
      Compiling ‘nrf_fprintf_format.c’
      Compiling ‘nrf_memobj.c’
      Compiling ‘nrf_pwr_mgmt.c’
      Compiling ‘nrf_ringbuf.c’
      Compiling ‘nrf_section_iter.c’
      Compiling ‘nrf_strerror.c’
      Assembling ‘ses_startup_nrf52840.s’
      Assembling ‘ses_startup_nrf_common.s’
      Compiling ‘system_nrf52840.c’
      Compiling ‘boards.c’
      Compiling ‘nrf_drv_clock.c’
      Compiling ‘nrf_drv_uart.c’
      Compiling ‘nrfx_atomic.c’
      Compiling ‘nrfx_clock.c’
      Compiling ‘nrfx_gpiote.c’
      Compiling ‘nrfx_prs.c’
      Compiling ‘nrfx_uart.c’
      Compiling ‘nrfx_uarte.c’
      Compiling ‘nrf_drv_pwm.c’
      Compiling ‘main.c’
      Compiling ‘SEGGER_RTT.c’
      Compiling ‘SEGGER_RTT_Syscalls_SES.c’
      Compiling ‘SEGGER_RTT_printf.c’
      Compiling ‘ble_advdata.c’
      Compiling ‘ble_conn_params.c’
      Compiling ‘ble_conn_state.c’
      Compiling ‘ble_srv_common.c’
      Compiling ‘nrf_ble_gatt.c’
      Compiling ‘nrf_ble_qwr.c’
      Compiling ‘utf.c’
      Compiling ‘ble_lbs.c’
      Compiling ‘nrf_sdh.c’
      Compiling ‘nrf_sdh_ble.c’
      Compiling ‘nrf_sdh_soc.c’
      Compiling ‘access.c’
      Compiling ‘access_publish.c’
      Compiling ‘access_publish_retransmission.c’
      Compiling ‘access_reliable.c’
      Compiling ‘ad_listener.c’
      Compiling ‘ad_type_filter.c’
      Compiling ‘adv_ext_packet.c’
      Compiling ‘adv_ext_tx.c’
      Compiling ‘advertiser.c’
      Compiling ‘adv_packet_filter.c’
      Compiling ‘aes.c’
      Compiling ‘aes_cmac.c’
      Compiling ‘assertion_handler_weak.c’
      Compiling ‘beacon.c’
      Compiling ‘bearer_handler.c’
      Compiling ‘bearer_event.c’
      Compiling ‘broadcast.c’
      Compiling ‘ccm_soft.c’
      Compiling ‘cache.c’
      Compiling ‘composition_data.c’
        composition_data.c
        taking address of packed member of 'struct <anonymous>' may result in an unaligned pointer value [-Waddress-of-packed-member]
        in definition of macro 'NRF_MESH_ASSERT'
      Compiling ‘config_server.c’
      Compiling ‘core_tx.c’
      Compiling ‘core_tx_adv.c’
      Compiling ‘core_tx_instaburst.c’
      Compiling ‘core_tx_local.c’
      Compiling ‘core_tx_lpn.c’
      Compiling ‘device_state_manager.c’
      Compiling ‘enc.c’
      Compiling ‘event.c’
      Compiling ‘fifo.c’
      Compiling ‘filter_engine.c’
      Compiling ‘flash_manager.c’
      Compiling ‘flash_manager_defrag.c’
      Compiling ‘flash_manager_internal.c’
      Compiling ‘fsm.c’
      Compiling ‘gap_address_filter.c’
      Compiling ‘hal.c’
      Compiling ‘heartbeat.c’
      Compiling ‘instaburst.c’
      Compiling ‘instaburst_rx.c’
      Compiling ‘internal_event.c’
      Compiling ‘instaburst_tx.c’
      Compiling ‘list.c’
      Compiling ‘log.c’
      Compiling ‘lpn.c’
      Compiling ‘main.c’
      Compiling ‘mesh_config.c’
      Compiling ‘mesh_config_backend.c’
      Compiling ‘mesh_config_flashman_glue.c’
        'FLASH_TIME_TO_WRITE_ONE_WORD_US' undeclared (first use in this function); did you mean 'FLASH_TIME_PER_WORD_US'?
        in expansion of macro 'FLASH_TIME_PER_WORD_US'
        each undeclared identifier is reported only once for each function it appears in
        in expansion of macro 'FLASH_TIME_PER_WORD_US'
      Compiling ‘mesh_flash.c’
        nrf_mesh_assert.h
        nrf_mesh_dfu_types.h
        bl_if.h
        mesh_flash.h
        mesh_flash.c
        'FLASH_TIME_TO_ERASE_PAGE_US' undeclared here (not in a function)
        in definition of macro '_SELECT_ASSERT_FUNC'
        in expansion of macro 'STATIC_ASSERT_SIMPLE'
        in expansion of macro 'STATIC_ASSERT'
        in expansion of macro 'NRF_MESH_STATIC_ASSERT'
        expression in static assertion is not an integer
        in definition of macro '_SELECT_ASSERT_FUNC'
        in expansion of macro 'STATIC_ASSERT_SIMPLE'
        in expansion of macro 'STATIC_ASSERT'
        in expansion of macro 'NRF_MESH_STATIC_ASSERT'
        'FLASH_TIME_TO_WRITE_ONE_WORD_US' undeclared (first use in this function)
        each undeclared identifier is reported only once for each function it appears in
        'FLASH_TIME_TO_WRITE_ONE_WORD_US' undeclared (first use in this function)
        'FLASH_TIME_TO_WRITE_ONE_WORD_US' undeclared (first use in this function)
      Compiling ‘mesh_lpn_subman.c’
      Compiling ‘mesh_mem_mem_manager.c’
      Compiling ‘mesh_mem_packet_mgr.c’
    Build failed

    And regarding the optional changes 

    Also, go through the "Optional changes" in the document.

    - I just tried to follow the tutorial step-by-step, I didn't skip anything and that is why I have not reached that part yet. But now that you suggested, I went through it and to be honest, I have no idea which of those optional changes applies to me. I did this part, however, like you suggested me: 

    Copy it from the examples/templates folder in mesh stack repository into your project folder, and remove #error message at the top of the file

    But now there are new errors.

    If you have any new leads, I'd be grateful.

    Thanks! 

Related