This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Node configuration from my own mobile application

Hi!

I want to be able to configure my nodes (assign AppKeys) from my own mobile application. I would like to know if it was posible to provision the nodes from the nordic app (as I always do) and then configure the nodes adding, deleting or changing the AppKeys from my own mobile application. You may wonder why self configure, when there is nrf mesh provisioning mobile app, but it is necessary in order to make an interface for the customers. I have represented a "graphic" example with light/switch from nordic sdk what I want to do.

For example, the app I would like to developed should be able to change Mesh Light Switch 6 controlling Mesh Light 1 to control Mesh Light 2

My questions are:

- Can I do the provisioning process with the nordic app and the appkey configuration with my app?

- If I change an AppKey configuration with my app ¿does the nordic app update itself because of that change in the mesh?

My idea was that the application connect with a proxy node via conventional bluetooth and send the neccesary packages to change the appkey configurations.

- Do you know of any good source of information that talk about how to send these packages?

- If this is not the correct way, how should I implemented?

I'm sorry if I haven't expressed myself well. Thanks for your time.

  • Hi,

    - Can I do the provisioning process with the nordic app and the appkey configuration with my app?

    It is not quite clear if you are talking about a mobile app or an nRF side app, for what you refer to as "my app". In order to configure a node, including assigning app keys, you do need the device key for that node. You mustalso be part of the network.

    There is a json format for transferring the configuration database from one device to another, which is implemented for the nRF Mesh app. There you can import and export the configuration database (CDB), so that you can e.g. provision devices with one phone, export the CDB, copy it over to the second phone, and import it to the nRF Mesh app on that phone. We do not have an implementation of this json format for the nRF side application, so if you need to transfer network details (including network keys and device keys) to and from an nRF device, then it does require a custom implementation from your side.

    - If I change an AppKey configuration with my app ¿does the nordic app update itself because of that change in the mesh?

    It depends on the type of application key change. If you add new application keys to the network, then that change must be propagated for instance through use of a CDB sharing mechanism. If you merely change which application key known to a node is used for a particular model on that node, then that's stored in the node's configuration, and any provisioner (or other device with that node's device key) would be able to read that information through that node's configuration server model.

    - Do you know of any good source of information that talk about how to send these packages?

    What SDK are you using? nRF connect SDK?

    - If this is not the correct way, how should I implemented?

    I have one comment regarding your figure. A mesh model, such as the server model in "Mesh Light 1", is assigned to one application key, not multiple. Typically, with the set of nodes that you have there, you would set one application key for use with "Mesh Light 1", and use that application key for all switches controlling that light. For addressing, the light would typically subscribe to a group address, and the switches controlling that light publish to that same group address.

    Further, unless there are any security reasons for using different application keys for the two lights, all of the lighting would use the same application key. The application key is intended for one "application", where "lighting system" can be one such application, "door lock" another, and so on. The purpose of the application keys is to divide the systems into different security domains, so that physical tampering with one device from one system doesn't grant access to the functionality of other systems running over the same mesh network. There are scenarios where one might consider using different application keys for different lights, for instance for a hotel where for instance each room can get its own application key to prevent the guest in one room from tampering with the nodes of other rooms.

    Regards,
    Terje

  • Hi Terje,

    First, thanks for the previous message. 

    "It is not quite clear if you are talking about a mobile app or an nRF side app, for what you refer to as "my app”"

    Answer:

    - I am talking about creating my own mobile application to control de AppKey configuration.

    "There is a json format for transferring the configuration database from one device to another, which is implemented for the nRF Mesh app. There you can import and export the configuration database (CDB), so that you can e.g. provision devices with one phone, export the CDB, copy it over to the second phone, and import it to the nRF Mesh app on that phone."

    Doubts:

    - It is possible create a mobile app where I just assign AppKeys with my own interface and then export that configuration database(CDB) to the nRF Mesh App by creating my own json? (nRF Mesh App and my custom mobile app in the same phone)

    "We do not have an implementation of this json format for the nRF side application, so if you need to transfer network details (including network keys and device keys) to and from an nRF device, then it does require a custom implementation from your side."

    Doubts:

    - I have exported the json file from the mesh I have been working for. I was thinking about create an application that import that json file from the nRF Mesh App, modify the groups with my custom interface and exported to the nRF Mesh app again. Do you think that this would be the best way to implement it?

    "I have one comment regarding your figure. A mesh model, such as the server model in "Mesh Light 1", is assigned to one application key, not multiple. Typically, with the set of nodes that you have there, you would set one application key for use with "Mesh Light 1", and use that application key for all switches controlling that light. For addressing, the light would typically subscribe to a group address, and the switches controlling that light publish to that same group address."

    Answer:

    It is true. I have corrected that representation

    Basically I want the client to decide, through my custom mobile application, what switches to use for light 1 and which for light 2, and they can change this configuration whenever they want.

    "Further, unless there are any security reasons for using different application keys for the two lights, all of the lighting would use the same application key."

    Answer:

    I have given the example with lights and switches but I am implementing the OnOff model to an application in which I need to know which client has set the status "On" to the server. That is the reason I am using different Appkeys, because although switch 1 and 3 control the same light, they dont have the same effect on it. An example with lights: switch 1 causes light one to turn on with a certain intensity and switch 3 causes it to turn on with a different intensity.

    Doubt:

    - How would you approach this problem?

    - Is there any model or example in the SDK to solve my problem?

    Again, thanks a lot for your time.

  • Hi,

    To your first two questions: You can use the CDB for transferring info from one app to another app on the same phone, yes. The format of the json file is specified by Bluetooth SIG, see https://www.bluetooth.com/specifications/specs/mesh-configuration-database-profile-1-0/

    Please note that the nRF Mesh app is not intended for end customers, but rather is a development tool for use when creating and testing Bluetooth mesh devices. Instead of relying on import and export between the nRF Mesh app and a custom app, it would be better to build everything into your custom app. All of the needed mesh functionality should be present in our iOS and Android mesh libraries.

    Regarding the use of app keys for controlling the lights, this is using app keys for a purpose that is drastically different from what it was intended for. In order to set different dimming levels from different switches, I would use e.g. generic level models instead of generic on/off, and let each switch send a different level.

    In nRF Connect SDK, you can have a look at the Bluetooth: Mesh light fixture example, which supports dimmable lights.

    Regards,
    Terje

Related