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

nRF Mesh Client and Server combined

Development Software:

nRF5 SDK for Mesh v3.1.0

SEGGER Embedded Studio for ARM v3.50

SoftDevice S140 v6.1.0

Computer Platform:

Windows 10 Professional

Hardware: 

Two nRF52840 DK's

What I'm trying to do: 

I'm trying to have a node act as both a client and a server. I've merged the Generic OnOff client and server examples, keeping the models separate, but merging the server main.c file and the client main.c file, similar to this example: https://github.com/NordicPlayground/nrf52-mesh-light-switch-client-server-proxy.

I have modified both the client and server models to send and receive red, green, blue and brightness values, all stored as uint8_t. I've also modified the button_event_handler in main.c to send:

R: 255, G: 0, B: 0, Br: 100 when button 1 is pressed

R: 0, G: 255, B: 0, Br: 100 when button 2 is pressed

Status Message, containing the state of RGB, Br in Server model, to verify the packets being sent are actually being saved to the server, when button 3 is pressed

Node Reset when button 4 is pressed

The program compiles, and flashes to the board, and I receive the following in my debug log:

<t: 0>, main.c, 421, ----- BLE Mesh Light Switch Server Demo -----
<t: 15128>, main.c, 399, Initializing and adding models
<t: 15131>, generic_rgb_server.c, 277, Status: 0<t: 15133>, generic_rgb_server.c, 283, Status: 0<t: 15136>, generic_rgb_server.c, 286, Status: 0<t: 15138>, app_rgb.c, 284, Status: 0<t: 15140>, app_rgb.c, 291, Status: 0<t: 15142>, app_rgb.c, 294, Status: 0<t: 15144>, main.c, 217, App RGB Model Handle: 2
<t: 15147>, generic_rgb_client.c, 215, Status Code: 0<t: 20017>, mesh_app_utils.c, 65, Device UUID (raw): 991945FCE7B5AA46935F152CCFD48D12
<t: 20020>, mesh_app_utils.c, 70, Device UUID : FC451999-B5E7-46AA-935F-152CCFD48D12

The program seems to run and initialize just fine. If I load the program onto two different DK's, I get the log above, and they are discoverable when scanning from the nRF Mesh app for iOS.

The problem is that when provisioning one DK from nRF Mesh, the provisioning process is stopped by a disconnect. The nRF Mesh app then tries to re connect and finish the provisioning process, which sometimes works, but sometimes doesn't. When it does work, the moment I try to provision the other board to create a 3 node network, the first one disconnects from the network, or vice versa. Can someone help me figure out why this is happening, and point out any flaws in my code, attached below:

reng_device.zip

If you have an existing nRF5 SDK for Mesh v3.1.0, extract the above directory and place it where the green reng_device text is below in your file hierarchy:

nRF5 SDK for Mesh Root/examples/reng_device

The example I'm referring to is under ../reng_device/server/light_switch_server_nrf52840_xxAA_s140_6_1_0

I simply added client model code to the server and havent renamed anything.

Parents
  • Hi,

    There may be some clues in the logs from the devices, or in the logs from the Mesh app, so please consider attaching them.

    When in the provisioning process do you get the disconnect?

    In the cases when provisioning succeeds, are you able to configure the devices? (What is the configuration?)

    When you write that "the moment [you] try to provision the other board to create a 3 node network, the first one disconnects from the network, or vice versa", what do you mean by that? Can you elaborate? Can you attach logs? As long as the devices are within range they should be able to communicate over the ADV bearer, regardless of whether they are connected to the phone or not.

    Regards,
    Terje

  • Hello, any update? Would anyone at Nordic be able to explain possible causes of the inconsistent results I'm getting?

Reply Children
No Data
Related