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

Simple ON Off Client, public address on Mesh 2.0

Hi all,

I am merging my code from Mesh 1.0 to 2.0.

I am trying to put both Provisioner and Simple On/Off Client into one board,

and then the other board is simple on/off server (as if the example in Mesh 1.0)

From Log, i believe i already config the node properly.

 0> <t:         24>, main.c,  932, ----- BLE Mesh Light Switch Mesh Demo -----
 0> <t:        508>, main.c,  861, Initializing and adding models
 0> <t:        513>, main.c,  880, Initializing and adding models finish
 0> <t:        525>, main.c,  911, Setup defaults: Adding keys, addresses, and bindings 
 0> <t:        688>, provisioner_helper.c,  378, netkey_handle: 0
 0> <t:       6018>, main.c, 1426, Device UUID : 0059ABCDEFABCDEFACCDEFABCDEFABCD
 0> <t:       6022>, main.c,  481, Waiting for Server node to be provisioned ...
 0> <t:    3679259>, provisioner_helper.c,  303, Static authentication data provided
 0> <t:    3822143>, provisioner_helper.c,  212, Provisioning completed received
 0> <t:    3822148>, provisioner_helper.c,  217, Adding device address, and device keys
 0> <t:    3822153>, provisioner_helper.c,  227, Going to address [0x0100]key_handle [0], dev_key[536886660]
 0> <t:    3822161>, access.c, 1101, #### public address handle 0, set to access_model_pool index 2
 0> <t:    3822166>, config_client.c,  438, >>>>>>>>>>>>>>>>>>>>>>>:0x02 Addr:0x00
 0> <t:    3822172>, provisioner_helper.c,  263, <t:    3826354>, provisioner_helper.c,  175, Local provisioning link closed: prov_state: 2  remaining retries: 2
 0> <t:    3826361>, main.c,  773, Provisioning successful
 0> <t:    3826365>, provisioner_helper.c,  201, Provisioning complete. Node addr: 0x0100 elements: 1
 0> <t:    3826371>, node_setup.c,  699, Configuring Node: 0x0100
 0> <t:    3826376>, config_client.c,  438, >>>>>>>>>>>>>>>>>>>>>>>:0x02 Addr:0x00
 0> <t:    3826381>, node_setup.c,  329, Setup select Step for addr 0x0100
 0> Getting composition data
 0> <t:    3826461>, main.c,  597, Flash write complete
 0> <t:    3826465>, main.c,  608, Flash write complete exit
 0> <t:    3901637>, main.c,  201, Config client event
 0> <t:    3901641>, node_setup.c,  393, Adding appkey
 0> <t:    3901662>, access_reliable.c,  413, access_model_publish statu 0
 0> <t:    3904830>, main.c,  201, Config client event
 0> <t:    3904834>, node_setup.c,  404, App key bind: Health server
 0> <t:    3904846>, access_reliable.c,  413, access_model_publish statu 0
 0> <t:    3905526>, main.c,  201, Config client event
 0> <t:    3905530>, node_setup.c,  419, App key bind: Simple On/Off server
 0> <t:    3905544>, access_reliable.c,  413, access_model_publish statu 0
 0> <t:    3906261>, main.c,  201, Config client event
 0> <t:    3906265>, node_setup.c,  472, Setting publication address for the health server to 0x0001
 0> <t:    3906285>, access_reliable.c,  413, access_model_publish statu 0
 0> <t:    3909966>, main.c,  201, Config client event
 0> <t:    3909970>, node_setup.c,  510, Adding subscription
 0> <t:    3909984>, access_reliable.c,  413, access_model_publish statu 0
 0> <t:    3919637>, main.c,  201, Config client event
 0> <t:    3919641>, main.c,  729, Configuration of device 0 successful
 0> <t:    3919646>, main.c,  742, Finish Init the Simple Onff 0 model handle 4
 0> <t:    3919652>, provisioner_helper.c,  331, Scanning For Unprovisioned Devices
 0> <t:    3919710>, main.c,  597, Flash write complete
 0> <t:    3919714>, main.c,  608, Flash write complete exit
 0> <t:    4235846>, main.c,  801, Node 0x0100 alive with 0 active fault(s), RSSI: -53
 0> <t:    4448517>, main.c,  332, Button 0 pressed
 0> <t:    4448521>, access.c,  351,  I am here 
 0> <t:    4448525>, access.c,  352,  App key Handle 0xFFFF
 0> <t:    4448529>, access.c,  353,  publish_address_handle key Handle 0xFFFF
 0> <t:    4448534>, access.c,  354,  Is valid opcode 1??
 0> <t:    4448538>, access.c,  374, packet tx return here. . at the handle 4
 0> <t:    4448545>, access_reliable.c,  413, access_model_publish statu 7
 0> <t:    4448549>, access_reliable.c,  442, access_model_reliable_publish failed 7
 0> <t:    4891751>, main.c,  801, Node 0x0100 alive with 0 active fault(s), RSSI: -67
 0> <t:    5219310>, main.c,  801, Node 0x0100 alive with 0 active fault(s), RSSI: -53

But When I send out the command thru simple_on_off_client_set(&m_clients[button_number], !hal_led_pin_get(BSP_LED_0 + button_number));

It say NRF_ERROR_INVALID_PARAM: -->
            /* Publication not enabled for this client. One (or more) of the following is wrong:
             * - An application key is missing, or there is no application key bound to the model
             * - The client does not have its publication state set
             *
             * It is the provisioner that adds an application key, binds it to the model and sets
             * the model's publication state.
             */
            __LOG(LOG_SRC_APP, LOG_LEVEL_INFO, "Publication not configured for client %u\n", button_number);

How should I configure the Publication?

Regards,

Ajay

  • I am using the server_config_steps for config and provision the device in the function of setup_select_steps

  •  0> <t:24>, main.c, 932, ----- BLE Mesh Light Switch Mesh Demo -----
     0> <t:518>, main.c, 861, Initializing and adding models
     0> <t:524>, main.c, 880, Initializing and adding models finish
     0> <t:535>, main.c, 911, Setup defaults: Adding keys, addresses, and bindings
     0> <t:703>, provisioner_helper.c, 376, netkey_handle: 0
     0> <t:6031>, main.c, 1426, Device UUID : 0059ABCDEFABCDEFACCDEFABCDEFABCD
     0> <t:6035>, main.c, 481, Waiting for Server node to be provisioned ...
     0> <t:25>, main.c, 932, ----- BLE Mesh Light Switch Mesh Demo -----
     0> <t:518>, main.c, 861, Initializing and adding models
     0> <t:524>, main.c, 880, Initializing and adding models finish
     0> <t:559>, main.c, 853, Restored: App data
     0> <t:563>, main.c, 920, Restored: Handles
     0> <t:568>, provisioner_helper.c, 348, m_netkey_handle:0 m_appkey_handle:0 m_self_devkey_handle:1
     0> <t:998>, main.c, 1426, Device UUID : 0059ABCDEFABCDEFACCDEFABCDEFABCD
     0> <t:1004>, main.c, 481, Waiting for Server node to be provisioned ...
     0> <t: 6270>, provisioner_helper.c, 329, Scanning For Unprovisioned Devices
     0> <info> app: Debug logging for UART over RTT started.
     0> <t:350217>, provisioner_helper.c, 157, UUID seen: 0059FFFF00000000A117145116817393
     0> <t:350222>, provisioner_helper.c, 96, UUID filter matched
     0> <t:519188>, provisioner_helper.c, 166, Start Provision with : 0059FFFF00000000A117145116817393
     0> <t:519194>, provisioner_helper.c, 115, key data index 0
     0> <t:519198>, provisioner_helper.c, 116, key address 0x100
     0> <t:519203>, provisioner_helper.c,117, key type 1
     0> <t:519208>, nrf_mesh_prov.c, 219, nrf_mesh_prov_provision exit with status 0
     0> <t:520641>, provisioner_helper.c, 306, Provisioning link established
     0> <t:601086>, provisioner_helper.c, 301, Static authentication data provided
     0> <t:679059>, provisioner_helper.c, 210, Provisioning completed received
     0> <t:679064>, provisioner_helper.c, 215, Adding device address, and device keys
     0> <t:679069>, provisioner_helper.c, 225, Going to address [0x0100]key_handle [0], dev_key[536886660]
     0> <t:679078>, access.c, 1092, #### public address handle 0, set to access_model_pool index 2
     0> <t:679083>, config_client.c, 438, >>>>>>>>>>>>>>>>>>>>>>>:0x02 Addr:0x00
     0> <t:679088>, provisioner_helper.c, 261, <t: 682720>, provisioner_helper.c, 173, Local provisioning link closed: prov_state: 2  remaining retries: 2
     0> <t:682726>, main.c, 773, Provisioning successful
     0> <t:682731>, provisioner_helper.c, 199, Provisioning complete. Node addr: 0x0100 elements: 1
     0> <t:682736>, node_setup.c, 679, Configuring Node: 0x0100
     0> <t:682741>, config_client.c, 438, >>>>>>>>>>>>>>>>>>>>>>>:0x02 Addr:0x00
     0> <t:682747>, node_setup.c, 369, Getting composition data
     0> <t:682815>, main.c, 597, <t: 752461>, main.c, 201, Config client event<t: 752466>, node_setup.c,  379, Adding appkey
     0> <t:755406>, main.c, 201, Config client event<t: 755410>, node_setup.c, 272, opcode status field: 0
     0> <t:755415>, node_setup.c, 390, App key bind: Health server
     0> <t:765600>, main.c, 201, Config client event<t: 765604>, node_setup.c, 272, opcode status field: 0
     0> <t:765608>, node_setup.c, 405, App key bind: Simple On/Off server
     0> <t:776555>, main.c, 201, Config client event<t: 776559>, node_setup.c, 272, opcode status field: 0
     0> <t:776563>, node_setup.c, 458, Setting publication address for the health server to 0x0001
     0> <t:781004>, main.c, 201, Config client event<t: 781009>, node_setup.c, 272, opcode status field: 0
     0> <t: 781013>, node_setup.c, 484, Set: on/off server pub addr: 0x00FC
     0> <t: 805714>, main.c, 201, Config client event<t: 805721>, node_setup.c, 272, opcode status field: 0
     0> <t: 805726>, node_setup.c, 495, Adding subscription
     0> <t: 815328>, main.c, 201, Config client event<t: 815332>, node_setup.c, 272, opcode status field: 0
     0> <t: 815337>, main.c, 729, Configuration of device 0 successful

  • If i use the server1_server2_config_steps, it give the log as above

  • Hi ajay,

    Have you taken a look at the migration guide on our Infocenter?

    Kind Regards,

    Bjørn

  • Yes, i have read the migration guide in the In Infocenter?

    I think my bluetooth mesh stack and the provision process is done correctly (I can read from my Board #2, it said it is correctly provisioned.)

    The problem is, seems i did not make the configuration of the node properly. That's why i am asking a if there is reference config_steps.

    As, now i am doing the same in Mesh v1.0, the Board #1 will be the provisioner , also the on/off client. And Board #2 is the on/off server.

    Now, sees it said it did not have the publication state set for the board #1

Related