Remote provisioning server integration problem

Hello friends,

i'm trying to add the pb_remote server functionality to a project without success, i kindly ask for some advices.

Development tools:

SDKs:

nRF5 SDK 17.0.2

nrf5 SDK for Mesh v5.0.0

The application integrates the the two DSKs, the application implements a proprietary mesh model to manage some custom devices

The application implements advertising and communication with mobile devices using NUS service. The device provisioning is managed by a custom mobile application.

Nowday we need to add the pb_remote_server model to every mesh node with the purpose of performing the provisioning of the mesh network devices from a single centralized point.

We added the remote server provisioning functionality starting from the mesh sdk example. The application builds and run correctly but no Unprovisioned device beacon packets are visible on the BLE sniffer. This kind of packets are visible with the pb_remote_server application instead.

We have made some unsuccessfully tests disabling the BLE advertising for mobile devices communication and disabling the initialization of our custom mesh models leaving only the remote_server one.

Following the code with breakpoints, we have seen that the function
void advertiser_packet_send(advertiser_t * p_adv, adv_packet_t * p_packet)
in the module nrf5_SDK_for_Mesh_v5.0.0\mesh\bearer\src\advertiser.c

is correctly called but the callback function in the same module:

static void tx_complete_event_callback(void * p_context)

is never called (in the pb_remote_server example it is called after the packet's send).

This is the call stack:

and this is part of the advertiser_t data structure passed to the function advertiser_packet_send

We will continue with testing, any help will be very appreciated.

Best regards,

Gianluca.

  • Hi,

    From what we can see in our tests we only call APP_SCHED_INIT() once after all other initialization that you mention (i.e after app_timer_init(), the initialization of the stack and the BLE and mesh functionalities), so I think that your fix of calling the macro twice covers over something else that might be the issue.

    From what we see in components/libraries/scheduler/app_scheduler.c of nRF5 SDK, the app_sched_event_put() function doesn't check if user passed NULL as the callback pointer and then app_sched_execute() just dereferences whatever it has in the queue. We would like to know what happens there in your application, so if you're able to, could you check what function calls app_sched_event_put() with NULL as a handler or to check what event is pulled out of the queue in app_sched_execute() with NULL pointer as handler? GDB should work here.

    Kind regards,
    Andreas

  • Hi Andreas,

    thank you, after some days of attempt, i finally succeeded!

    The double call to the macro APP_SCHED_INIT was due to the need of configure the FDS system (Flash Data Storage) to read the device configuration as soon as possible after the boot.
    I set up a state machine on the main function to correctly manage the configuration steps founding the correct sequence to enable BLE adv, mesh and remote provisioning advertisings. Now on the snivver, i see the unprovisioned device beacon packets and using the remote provisioning client example, the provisioning works. Now i have to add the configuration client/server functionality to complete the provisioning phase. Can you suggest me some examples where this funcionality is implemented?

    Have a nice day,

    Gianluca.

  • Hi,

    Gianluca said:
    thank you, after some days of attempt, i finally succeeded!

    Glad to hear it!

    Gianluca said:
    Now i have to add the configuration client/server functionality to complete the provisioning phase. Can you suggest me some examples where this funcionality is implemented?

    As far as I know every sample should have the configuration client/server implemented, so I would recommend to pick either the light switch/bulb or sensor server/client samples from the sample list and to follow the documentation from : infocenter.nordicsemi.com/.../md_examples_README.html

    Let me know if this is enough to answer your latest question!

    Kind regards,
    Andreas

Related