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

Problems with coexisting examples for mesh (nRF52832, iOS, nRF mesh)

Hi DevZone,

I have problems with running the coexistence examples from the Mesh SDK. Specifically I’m most interested in the UART coexistence example (https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.meshsdk.v3.1.0/md_examples_sdk_coexist_ble_app_uart_coexist_README.html). I have been following the example from point to point.

The code has been successfully programmed to the development boards, nRF52832 DK, with SoftDevice S132. One Client and one Server.

I’m not able to provisionee the network. I’m using the nRF Mesh but the client does not appear in the application, the server is able to be provisioned.

I’m using iOS 11.4.1 on a Iphone 5S (A1457).

nRF Mesh app: 1.0.4, Build 12

nRF5 SDK. 15.2.0

Mesh SDK: 3.1.0

IDE: SEGGER 4.12

I’m clueless to why im not able to provision the network. I have seen a similar problem (https://devzone.nordicsemi.com/f/nordic-q-a/42452/coexist-s132-on-mesh-with-s140), but it does not seem resolved.

Thank you in advance.

Best regards,

Michael

  • UPDATE: https://devzone.nordicsemi.com/f/nordic-q-a/45881/ble_app_uart_coexist-example-and-mesh-mobile-app

    " No, you won't be able find the device in the nRF Mesh app because the example don't have GATT provisioning bearer (PB-GATT) and the Proxy feature enabled."

    Use the Static Provisioner (using PB-ADV) for the light example to be able to run the example code successfully.

  • I would like to be able to provision the mesh network with the Mesh app. Is that even possible?

    I have tried to enabled PB-GATT in nrf_mesh_config_core.h but i get nrf_error_no_mem error.  Im not sure if one is able to Multiple advertising sets ? 

  • Hi,

    As you have already mentioned, the device must support PB-GATT for getting provisioned from the smartphone app.

    Adding PB-GATT to the coexistence examples requires a bit of work, since then both the mesh stack and the BLE stack needs to set up GATT services. You may also get some conflicts with advertising, as both the mesh stack and the BLE application would want to advertise for incoming connections. Furthermore, the GATT service exposed by PB-GATT shall be removed from the GATT table when the device has been successfully provisioned, as mandated by Bluetooth mesh specification. That requires a reset of the device and re-initialization of the SoftDevice, as the SoftDevice does not allow for services to be removed. See the note under Detailed Description on Provisioning over GATT Bearer (PB-GATT).

    The above means in order to support PB-GATT, the most practical way to do so is to let the device enter one of two states, depending on whether it is provisioned into a network or not.

    On startup, if the device is not part of a mesh network, it should initialize provisioning over GATT Bearer, but not initialize the other (normal) BLE services. That way, the mesh stack can be used to provision the device. Once provisioned, the device should reset.

    On startup, if the device is part of a mesh network, it should not initialize provisioning over GATT Bearer, and instead initialize the other (normal) BLE services.

    An alternative to using the smartphone application (which requires PB-GATT), is to use the Interactive PyACI library, see interactive mesh provisioning and configuration. With that one you can still use PB-ADV (no need to change the coexistence example), but you will no longer have a GUI for doing the provisioning.

    In the end it is up to you to decide which way to go and what approach to use.

    Regards,
    Terje

  • Hi Terje,

    Thank you for your answer.

    I'm to initialize over the GATT Bearer and provision the node. However i'm not sure on how to reset the device the best way. Is it with SystemReset? And i'm unsure where the provisioning is checked - in the mesh initialization? If i should detect if the device have been provisioned when initailizing the device then i have to init the BLE service in order to run the mesh init (where i'm able to check the provision). After that i need to setup the normal BLE services. I'm unsure if im going down a wrong path here.

    Thanks,
    Michael

  • Hi,

    I think i have confused myself to a point where i might need some external explanation. I tried to do different things to just the get GATT bearer to work and provisioned the node successfully. I had excluded the functions adverterings_init() and advertising_start() and in the BLE stack initialization function ble_stack_init() disabled the SoC handler (NRF_SDH_BLE_OBSERVER(...))

    Im not sure how it is possible but i'm able to get provision part over gatt completed and are able to see the BLE NUS service in the nRF Connect App, meaning it acutally works. Sometimes i think i gets some advertising conflicts but if i reset the node, i'm able to connect through the nRF Connect and sent commands to the node succesfully.

    Should this even be possible when the BLE shouldnt be initialized and started?

    Output from RTT on device:

    <debug> nrf_sdh: State request: 0x00000000
    00> <debug> nrf_sdh: Notify observer 0x0005AE9C => ready
    00> <debug> nrf_sdh: State change: 0x00000000
    00> <debug> nrf_sdh: State change: 0x00000001
    00> <debug> nrf_sdh_ble: RAM starts at 0x200023F0
    00> <info> app: Initializing and adding models
    00> 
    00> <info> app: Debug logging for UART over RTT started.
    00> <info> app: Device UUID
    00>  45 0C F8 45 10 8B 6C 44|E..E..lD
    00>  80 C7 37 36 A1 CB C4 79|..76...y
    00> <debug> nrf_sdh_ble: BLE event: 0x10.
    00> <debug> nrf_ble_gatt: Requesting to update ATT MTU to 69 bytes on connection 0x0.
    00> <debug> nrf_ble_gatt: Updating data length to 251 on connection 0x0.
    00> <error> nrf_ble_gatt: sd_ble_gap_data_length_update() (request) on connection 0x0 returned NRF_ERROR_RESOURCES.
    00> <error> nrf_ble_gatt: The requested TX/RX packet length is too long by 178/178 octets.
    00> <debug> nrf_sdh_ble: BLE event: 0x3A.
    00> <debug> nrf_ble_gatt: ATT MTU updated to 69 bytes on connection 0x0 (response).
    00> <debug> app: ATT MTU exchange completed. central 0x45 peripheral 0x45
    00> <debug> nrf_sdh_ble: BLE event: 0x50.
    00> <debug> nrf_sdh_ble: BLE event: 0x50.
    00> <debug> nrf_sdh_ble: BLE event: 0x50.
    00> <debug> nrf_sdh_ble: BLE event: 0x57.
    00> <debug> nrf_sdh_ble: BLE event: 0x50.
    00> <debug> nrf_sdh_ble: BLE event: 0x50.
    00> <debug> nrf_sdh_ble: BLE event: 0x57.
    00> <debug> nrf_sdh_ble: BLE event: 0x57.
    00> <debug> nrf_sdh_ble: BLE event: 0x57.
    00> <debug> nrf_sdh_ble: BLE event: 0x57.
    00> <debug> nrf_sdh_ble: BLE event: 0x50.
    00> <debug> nrf_sdh_ble: BLE event: 0x57.
    00> <debug> nrf_sdh_ble: BLE event: 0x50.
    00> <debug> nrf_sdh_ble: BLE event: 0x57.
    00> <debug> nrf_sdh_ble: BLE event: 0x50.
    00> <debug> nrf_sdh_ble: BLE event: 0x57.
    00> <debug> nrf_sdh_ble: BLE event: 0x11.
    00> <debug> nrf_sdh: State request: 0x00000001
    00> <debug> nrf_sdh: Notify observer 0x0005AE9C => ready
    00> <debug> nrf_sdh: State change: 0x00000002
    00> <debug> nrf_sdh: State change: 0x00000003
    00> <debug> nrf_sdh: State request: 0x00000000
    00> <debug> nrf_sdh: Notify observer 0x0005AE9C => ready
    00> <debug> nrf_sdh: State change: 0x00000000
    00> <debug> nrf_sdh: State change: 0x00000001
    00> <debug> nrf_sdh_ble: RAM starts at 0x200023F0
    00> <info> app: Successfully provisioned
    00> 
    00> <info> app: Node Address: 0x0001 
    00> 
    00> <debug> nrf_sdh_ble: BLE event: 0x10.
    00> <debug> nrf_ble_gatt: Requesting to update ATT MTU to 69 bytes on connection 0x0.
    00> <debug> nrf_ble_gatt: Updating data length to 251 on connection 0x0.
    00> <error> nrf_ble_gatt: sd_ble_gap_data_length_update() (request) on connection 0x0 returned NRF_ERROR_RESOURCES.
    00> <error> nrf_ble_gatt: The requested TX/RX packet length is too long by 178/178 octets.
    00> <debug> nrf_sdh_ble: BLE event: 0x3A.
    00> <debug> nrf_ble_gatt: ATT MTU updated to 69 bytes on connection 0x0 (response).
    00> <debug> app: ATT MTU exchange completed. central 0x45 peripheral 0x45
    00> <debug> nrf_sdh_ble: BLE event: 0x50.
    00> <debug> nrf_sdh_ble: BLE event: 0x50.
    00> <debug> nrf_sdh_ble: BLE event: 0x57.
    00> <debug> nrf_sdh_ble: BLE event: 0x57.
    00> <debug> nrf_sdh_ble: BLE event: 0x50.
    00> <debug> app: Received data from BLE NUS. Writing data on UART.
    00> <debug> app:  00 53 6D A6 E7 64 FA 5C|.Sm..d.\
    00> <debug> app:  BC 0F D5 07 04 A9 F6 6C|.......l
    00> <debug> app:  9D 1D 59 42 16 5E      |..YB.^  
    00> <debug> nrf_sdh_ble: BLE event: 0x57.
    00> <debug> nrf_sdh_ble: BLE event: 0x57.
    00> <debug> nrf_sdh_ble: BLE event: 0x57.
    00> <debug> nrf_sdh_ble: BLE event: 0x57.
    00> <debug> nrf_sdh_ble: BLE event: 0x57.
    00> <debug> nrf_sdh_ble: BLE event: 0x57.
    00> <debug> nrf_sdh_ble: BLE event: 0x57.
    00> <debug> nrf_sdh_ble: BLE event: 0x57.
    00> <debug> nrf_sdh_ble: BLE event: 0x50.
    00> <debug> app: Received data from BLE NUS. Writing data on UART.
    00> <debug> app:  00 53 B5 CA BA 5E 36 AC|.S...^6.
    00> <debug> app:  99 8F 99 B2 32 E8 EF 8D|....2...
    00> <debug> app:  8A AB 4B 45 26 57 09 D4|..KE&W .
    00> <debug> app:  1E                     |.       
    00> <debug> nrf_sdh_ble: BLE event: 0x50.
    00> <debug> app: Received data from BLE NUS. Writing data on UART.
    00> <t:     802152>, config_server.c,  623, dsm_appkey_add(appkey_handle:0 appkey_index:0)
    00> <debug> app:  00 53 C4 7F C6 A0 FC 81|.S......
    00> <debug> app:  B1 9A FA 13 ED 93 8D 94|........
    00> <debug> app:  88 D0 A2 A9 CB 7D 18 8A|.....}..
    00> <debug> app:  2B 33 5C 90 5C BB      |+3\.\.  
    00> <debug> nrf_sdh_ble: BLE event: 0x50.
    00> <debug> app: Received data from BLE NUS. Writing data on UART.
    00> <debug> app:  00 53 A7 C8 4D 08 0E F5|.S..M...
    00> <debug> app:  AF 23 EB 08 D3 4F AF 71|.#...O.q
    00> <debug> nrf_sdh_ble: BLE event: 0x57.
    00> <debug> nrf_sdh_ble: BLE event: 0x57.
    00> <debug> nrf_sdh_ble: BLE event: 0x57.
    00> <debug> nrf_sdh_ble: BLE event: 0x57.
    00> <debug> nrf_sdh_ble: BLE event: 0x12.
    00> <t:    1098946>, config_server.c, 2415, Access  Info:
    00> element_index=1 model_id = 1001-FFFF model_handle=2
    00> <debug> nrf_sdh_ble: BLE event: 0x50.
    00> <debug> app: Received data from BLE NUS. Writing data on UART.
    00> <debug> app:  00 53 77 64 56 BC 6B 8F|.SwdV.k.
    00> <debug> app:  B8 71 D7 87 E7 12 26 C4|.q....&.
    00> <debug> app:  11 45 BD 99 53 74 1C AF|.E..St..
    00> <debug> app:  DE 38 7C               |.8|     
    00> <debug> nrf_sdh_ble: BLE event: 0x57.
    00> <debug> nrf_sdh_ble: BLE event: 0x57.
    00> <debug> nrf_sdh_ble: BLE event: 0x50.
    00> <debug> app: Received data from BLE NUS. Writing data on UART.
    00> <debug> app:  00 53 8B EA AD AD EA D7|.S......
    00> <debug> app:  4A 01 8E EF DE 8D FE 11|J.......
    00> <debug> app:  E1 04 1A A4 54 0E 7E 92|....T.~.
    00> <debug> app:  29 D6 DF 2F 0F A0      |)../..  
    00> <debug> nrf_sdh_ble: BLE event: 0x50.
    00> <debug> app: Received data from BLE NUS. Writing data on UART.
    00> <debug> app:  00 53 12 1A 95 78 D9 40|.S...x.@
    00> <debug> app:  44 DF 25 A0 D2 A3 2A B1|D.%...*.
    00> <debug> app:  9E 25 9D 82 3A 0E      |.%..:.  
    00> <debug> nrf_sdh_ble: BLE event: 0x57.
    00> <debug> nrf_sdh_ble: BLE event: 0x57.
    00> <debug> nrf_sdh_ble: BLE event: 0x57.
    00> <debug> nrf_sdh_ble: BLE event: 0x57.
    00> <debug> nrf_sdh_ble: BLE event: 0x57.
    00> <debug> nrf_sdh_ble: BLE event: 0x57.
    00> <debug> nrf_sdh_ble: BLE event: 0x50.
    00> <debug> app: Received data from BLE NUS. Writing data on UART.
    00> <debug> app:  00 53 A1 32 59 61 6F F2|.S.2Yao.
    00> <debug> app:  AF ED FC BB 41 08 E7 B6|....A...
    00> <debug> app:  5F 8D F9 A8 49 35 5E CA|_...I5^.
    00> <debug> app:  87                     |.       
    00> <debug> nrf_sdh_ble: BLE event: 0x57.
    00> <debug> nrf_sdh_ble: BLE event: 0x57.
    00> <debug> nrf_sdh_ble: BLE event: 0x50.
    00> <debug> app: Received data from BLE NUS. Writing data on UART.
    00> <debug> app:  00 53 E8 67 F8 C9 30 B8|.S.g..0.
    00> <debug> app:  77 3D 37 FA 35 D6 C6 B0|w=7.5...
    00> <debug> app:  8D AC DD 94 EF 4D 84 E6|.....M..
    00> <debug> app:  8A                     |.       
    00> <debug> nrf_sdh_ble: BLE event: 0x57.
    00> <debug> nrf_sdh_ble: BLE event: 0x57.
    00> <debug> nrf_sdh_ble: BLE event: 0x50.
    00> <debug> app: Received data from BLE NUS. Writing data on UART.
    00> <debug> app:  00 53 F8 98 9B A3 4C EF|.S....L.
    00> <debug> app:  06 2C 3D 09 1A 44 89 CF|.,= .D..
    00> <debug> app:  3A C6 FD 8B 06 18 0A 9B|:.......
    00> <debug> app:  B1                     |.       
    00> <debug> nrf_sdh_ble: BLE event: 0x11.
    00> <debug> nrf_sdh_ble: BLE event: 0x10.
    00> <debug> nrf_ble_gatt: Requesting to update ATT MTU to 69 bytes on connection 0x0.
    00> <debug> nrf_ble_gatt: Updating data length to 251 on connection 0x0.
    00> <error> nrf_ble_gatt: sd_ble_gap_data_length_update() (request) on connection 0x0 returned NRF_ERROR_RESOURCES.
    00> <error> nrf_ble_gatt: The requested TX/RX packet length is too long by 178/178 octets.
    00> <debug> nrf_sdh_ble: BLE event: 0x3A.
    00> <debug> nrf_ble_gatt: ATT MTU updated to 69 bytes on connection 0x0 (response).
    00> <debug> app: ATT MTU exchange completed. central 0x45 peripheral 0x45
    00> <debug> nrf_sdh_ble: BLE event: 0x50.
    00> <debug> nrf_sdh_ble: BLE event: 0x52.
    00> <debug> nrf_sdh_ble: BLE event: 0x12.
    00> <debug> nrf_sdh_ble: BLE event: 0x11.
    00> <debug> nrf_sdh: State request: 0x00000000
    00> <debug> nrf_sdh: Notify observer 0x0005AE9C => ready
    00> <debug> nrf_sdh: State change: 0x00000000
    00> <debug> nrf_sdh: State change: 0x00000001
    00> <debug> nrf_sdh_ble: RAM starts at 0x200023F0
    00> <info> app: Initializing and adding models
    00> 
    00> <info> app: Debug logging for UART over RTT started.
    00> <info> app: Device UUID
    00>  45 0C F8 45 10 8B 6C 44|E..E..lD
    00>  80 C7 37 36 A1 CB C4 79|..76...y
    00> <debug> nrf_sdh_ble: BLE event: 0x10.
    00> <debug> nrf_ble_gatt: Requesting to update ATT MTU to 69 bytes on connection 0x0.
    00> <debug> nrf_ble_gatt: Updating data length to 251 on connection 0x0.
    00> <error> nrf_ble_gatt: sd_ble_gap_data_length_update() (request) on connection 0x0 returned NRF_ERROR_RESOURCES.
    00> <error> nrf_ble_gatt: The requested TX/RX packet length is too long by 178/178 octets.
    00> <debug> nrf_sdh_ble: BLE event: 0x3A.
    00> <debug> nrf_ble_gatt: ATT MTU updated to 69 bytes on connection 0x0 (response).
    00> <debug> app: ATT MTU exchange completed. central 0x45 peripheral 0x45
    00> <debug> nrf_sdh_ble: BLE event: 0x50.
    00> <debug> nrf_sdh_ble: BLE event: 0x52.
    00> <debug> nrf_sdh_ble: BLE event: 0x12.
    00> <t:     596393>, mesh_main.c,  216, Sending msg: ONOFF SET 1
    00> <debug> nrf_sdh_ble: BLE event: 0x50.
    00> <debug> app: Received data from BLE NUS. Writing data on UART.
    00> <debug> app:  31                     |1       
    00> <info> app: Button 0 pressed
    00> 
    00> <t:     766688>, mesh_main.c,  216, Sending msg: ONOFF SET 1
    00> <debug> nrf_sdh_ble: BLE event: 0x50.
    00> <debug> app: Received data from BLE NUS. Writing data on UART.
    00> <debug> app:  32                     |2       
    00> <info> app: Button 1 pressed
    00> 
    00> <info> app: Publication not configured for client 1
    00> 

    I do not know where i can find the BLE event list?

    Best Regards,

    Michael

Related