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

Mesh v2.0.1 and the light switch proxy server app and provisioning using iOS app - gatt table change issue

Hi

Using the iOS 'nrf Mesh' application I can provision a PCA10056 succesfully.

I have written fimware image that sniffs for mesh related becaons, and when I power up the light switch proxy server app I can see it send PB_ADV beacons and also the PB_GATT beacons.

Great.

Then I provision and I see that at some point the softdevice is reset so that Mesh Proxy beacons are sent which the phone uses to establish the connection and then proceeds to complete the provisioning of the foundation model.

Great.

This means that from beginning to end, the gatt table started with 'mesh provisioning service' and then ended with 'mesh proxy service'. I saw it advertise the appropriate beacons to invite connections from the phone.

The Mesh Profile specification states that both these service shall NOT be present at the same time.

Which means part way through the provisioning process, the softdevice & ble stack was disabled and re-enabled so that the gatt table could be changed.

Because of this gatt table change in my own firmware I can only achieve that by restarting my device by doing a warm reset.

And I find that I can achieve the first part of the provisioning but can never see it complete because the iOS app seems to be getting confused.

I can recreate that in the sample app as follows:-

1) Flash erase the PCA10056

2) open the light switch proxy server application

3) Go to the function prov_evt_handler() in mesh_provisionee.c and comment out the line where gatt_database_reset(); is called

4) Build the app and then run it

5) Start provisioning from phone app

6) see that it gets to about 75% and never goes beyond

7) stop the app in the debugger and exit debug mode

8) now uncomment  gatt_database_reset() so that everything is as it was

9) rebuild and run

10) in the phone app you will see the device when you go to the 'network' screen

11) Reconnect and try to provision -- nothing happens.

I was expecting the phone app to be able to allow me to continue the provisioning process.

You might say that this is an invalid use case. Unfortunately I cannot disable/enable/install new gatt table because I have various context objects that will become invalidated and I have no way of updating them other than by doing a warm reset.

I am hoping that the problem here is that the phone app needs to be able to cater for this.

Look forward to hearing from you

Kind regards

Mahendra

  • Hi
    Using v2.1.1 I built the Light Switch Proxy Server app and then tried provisioning using my iPhone.

    Whereas, before, I used to be able to get to 100% of provisioning, it now only gets up to 91% and nothing more happens. It has now been on 91% for over 5 minutes and I am going to assume it is not going to get to 100%

    In SES output I see ...

    <t:          0>, main.c,  270, ----- BLE Mesh Light Switch Proxy Server Demo -----
    <t:        569>, main.c,  199, Initializing and adding models
    <t:       5870>, main.c,  313, Device UUID : 0059FFFF00000000EAAB6955A5215CAD
    <t:     199920>, main.c,  188, Successfully updated connection parameters
    <t:        554>, main.c,   94, Successfully provisioned
    <t:        558>, main.c,  102, Node Address: 0x0002 
    <t:     263468>, proxy.c,  572, Connected
    <t:     276229>, main.c,  188, Successfully updated connection parameters
    <t:     589341>, proxy.c,  598, TX ready
    <t:     605073>, proxy.c,  611, TX complete
    <t:     605076>, proxy.c,  603, RX
    <t:     605078>, proxy.c,  546, RX GATT PDU type 0x0, len 21
    <t:     620793>, proxy.c,  611, TX complete
    <t:     628664>, proxy.c,  603, RX
    <t:     628666>, proxy.c,  546, RX GATT PDU type 0x0, len 24
    <t:     636523>, proxy.c,  611, TX complete
    <t:     644394>, proxy.c,  603, RX
    <t:     644396>, proxy.c,  546, RX GATT PDU type 0x0, len 24
    <t:     652261>, proxy.c,  611, TX complete
    <t:     652266>, proxy.c,  603, RX
    <t:     652268>, proxy.c,  546, RX GATT PDU type 0x0, len 29
    <t:     652285>, proxy.c,  603, RX
    <t:     652287>, proxy.c,  546, RX GATT PDU type 0x0, len 29
    <t:     660128>, proxy.c,  611, TX complete
    <t:     660133>, proxy.c,  603, RX
    <t:     660135>, proxy.c,  546, RX GATT PDU type 0x0, len 24
    <t:     667989>, proxy.c,  603, RX
    <t:     667991>, proxy.c,  546, RX GATT PDU type 0x0, len 24
    <t:     675849>, proxy.c,  611, TX complete
    <t:     683719>, proxy.c,  603, RX
    <t:     683721>, proxy.c,  546, RX GATT PDU type 0x0, len 24
    <t:     691579>, proxy.c,  611, TX complete
    <t:     699449>, proxy.c,  603, RX
    <t:     699451>, proxy.c,  546, RX GATT PDU type 0x0, len 24
    <t:     707309>, proxy.c,  611, TX complete
    <t:     715178>, proxy.c,  603, RX
    <t:     715180>, proxy.c,  546, RX GATT PDU type 0x0, len 24
    <t:     723037>, proxy.c,  611, TX complete
    

    And this app was built with the SDK as-is and none of my changes are incorporated.

    Your insight most welcome

    Kind regards

    Mahendra

  • I have an android tablet and I updated nrf Mesh on that to 1.0.

    With that I can provision the 'virgin' application.


    I have checked and there is no new updated iOS version of nrf Mesh

  • I tried building the Light Switch Proxy Server example from Mesh SDK v2.1.1, then provioned it with my iPhone X. It seems to work fine, it went to 100%. Not sure when it stops at 91% on your phone. Have you tried it on other phones as well? Which phone are you using?

    Can you try erase the app on the device and reflash it, see if that helps?

  • I then loaded v1.0 of the nrf Mesh in my Android tablet and that worked.

    I have iPhoneX and it tells me I have application v1.0.1, build 7

    I am not sure if that has changed since I last tried.

    What version do you have?

  • I am using the same version on my iPhone X. Have you tested this with other iPhones? Which iOS version do you have?

Related