# nRFConnect to a Mesh light server with custom service-characteristics

Hi Nordic, I would like to be able to connect to a Mesh node server from Mesh SDK light control example, add a service with a characteristic and change the characteristic in nRF Connect App.

My goal is to update advertising data from a custom characteristic value on my light control server mesh node. I added advertisement and it works, I see my mesh light server node in nRFConnect.

Now I try to add a characteristic in a custom service, like in service beginner's tuto, but Mesh SDK doesnt use same libraries to init advertising, etc. Is there something I should check different than trying to add nRF BLE library in SES IDE in order to add service like in the service/characteristic tutorial. Am I on the right way trying to do this. Is there something I could miss in the way I try to add a service to the Mesh light server node.

Thanks a lot.

edit retag close delete

Hi,

I recommend moving the mesh stack repository into the Nordic nRF5 SDK examples folder and include the necessary source files in the Nordic nRF5 SDK project that you want to use.

( 2017-09-14 18:29:00 +0100 )editconvert to answer

Hi, thanks for your answer. That's because I would like to stay in SES at the moment and avoid Keil license to build/link the project, but I appreciate your recommendation I will try this as I have access to a full Keil on another computer. Thank you again.

( 2017-09-14 19:44:24 +0100 )editconvert to answer

Hi,

You can import the Keil project from the SDK into SES, and continue to use SES. See this blog post for a guide on how to do that. If there is any specific example in the SDK you want a SES project for, I can upload it here for you.

( 2017-09-14 19:56:03 +0100 )editconvert to answer

Hi, The app_template with the mesh integrated would be so mush appreciate, then I will have to merge with the main.c file of the server light control mesh SDK exemple to have the Mesh running. About that, I have a question, should I plan to change duty cycle receiving of the mesh core to let some place for the gatt/gap, because in the mesh with advertising it uses the mesh core to advertise (put in the queue), so I'm think it might have some issue around that. What do you thing? Is my question clear enough? Thank you.

( 2017-09-14 20:05:50 +0100 )editconvert to answer

Hi,

Regarding the "duty cycle", that seems like a good idea. From the link I first posted:

Concurrent SoftDevice and mesh activity

By design, the SoftDevice activity is prioritized over mesh activity. Therefore, you should keep the connection and advertisement intervals used by the SoftDevice as large as possible (i.e. infrequent) when using Bluetooth low energy connections. If scanning, keep the scan duty cycle as low as possible. You should also reduce mesh activity while the SoftDevice is doing fast advertising and continue normal activity after a connection is established.

I have created a SES project for ble_app_template for SDK 12.3. I used SES version 3.26a. You should only need to unzip, and place the files in the folder SDK_folder\examples\ble_peripheral\ble_app_template\pca10040\s132\arm5_no_packs for it work. It's unfortunately not integrated with mesh, but it should maybe give you a starting point so you ...(more)

( 2017-09-15 15:52:20 +0100 )editconvert to answer

Hi Sigurd, thank for your support. I'm having trouble integrating mesh into the exemple. First question I have for you. Is it suppose to work with SDK 12.3. On Mesh sdk documentation it is written SDK 12.1 for mesh compatibility? I got APP_ERROR:ERROR:Fatal and it seems to be in access_model_add when I put some debug trace... Thank you.

( 2017-09-24 03:21:26 +0100 )editconvert to answer

Hi,

that is correct.

Here is SES ble_app_template for SDK 12.1.

Regarding the "APP_ERROR:ERROR:Fatal ", that means that you are running to the error-handler. i.e. a APP_ERROR_CHECK() is triggered with an error. You should therfore debug to find the error.

Attachment:

SES_ble_app_template_pca10040_s132_SDK12_1.rar

( 2017-09-29 11:32:15 +0100 )editconvert to answer