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

light_switch example SDK v2.0.1 -- Problem with server

Dear all,

I am testing the light_switch demo (SDK for Mesh v2.0.1 and softdevice 6.0.0) below the following configuration:

-- One client: nrf52-PCA10040 DK (light_switch_client_nrf52832_xxAA_s132)

-- One server: nrf52-PCA10040 DK (light_switch_server_nrf52832_xxAA_s132)

-- One provisioner: nrf52-PCA10056 DK (light_switch_provisioner_nrf52840_xxAA_s140)

In light_switch_example_common.h:

#define SERVER_NODE_COUNT (1)
#define CLIENT_NODE_COUNT (1)

After programming all boards and debugging the provisioner I get:

   0>, main.c,  550, ----- BLE Mesh Light Switch Provisioner Demo -----
<t:          0>, mesh_softdevice_init.c,  112, Initializing SoftDevice...
<t:          0>, mesh_softdevice_init.c,   77, Enabling BLE...
<t:          2>, mesh_softdevice_init.c,   88, Ram base: 0x200032C8
<t:        547>, main.c,  488, Initializing and adding models
<t:        581>, main.c,  441, Restored: App data
<t:        583>, main.c,  540, Restored: Handles 
<t:        586>, provisioner_helper.c,  301, m_netkey_handle:0 m_appkey_handle:0 m_self_devkey_handle:1
<t:        592>, main.c,  578, <start> 
<t:      26844>, main.c,  565, Starting application ...
<t:      26846>, main.c,  567, Provisoned Nodes: 0, Configured Nodes: 0 Next Address: 0x0100
<t:      26850>, main.c,  568, Dev key : DD9DFDF59BC9645D89C114C86B2A6F80
<t:      26853>, main.c,  569, Net key : 19C47451084A42576555EE0EABDE9E14
<t:      26856>, main.c,  570, App key : 15C3C014F3B5593AD1EC2A6FE572F309
<t:      26859>, main.c,  571, Press Button 1 to start provisioning and configuration process. 
<t:     191475>, main.c,  448, Button 1 pressed
<t:     191477>, main.c,  361, Waiting for Client node to be provisioned ...
<t:     196239>, provisioner_helper.c,  282, Scanning For Unprovisioned Devices
<t:     201799>, provisioner_helper.c,  144, UUID seen: 0059ABCDEFABCDEFACCDEFABCDEFABCD
<t:     201802>, provisioner_helper.c,   95, UUID filter matched
<t:     202407>, provisioner_helper.c,  259, Provisioning link established
<t:     216232>, provisioner_helper.c,  254, Static authentication data provided
<t:     228301>, provisioner_helper.c,  192, Provisioning completed received
<t:     228304>, provisioner_helper.c,  197, Adding device address, and device keys
<t:     228309>, provisioner_helper.c,  214, Addr: 0x0100 addr_handle: 0 netkey_handle: 0 devkey_handle: 2
<t:     232418>, provisioner_helper.c,  155, Local provisioning link closed: prov_state: 2  remaining retries: 2
<t:     232422>, main.c,  282, Provisioning successful
<t:     232424>, provisioner_helper.c,  181, Provisioning complete. Node addr: 0x0100 elements: 5
<t:     232428>, node_setup.c,  672, Configuring Node: 0x0100
<t:     232431>, node_setup.c,  586, Config client setup: devkey_handle:2 addr_handle:0
<t:     232435>, node_setup.c,  361, Getting composition data
<t:     232475>, main.c,  117, Flash write complete
<t:     286192>, main.c,  332, Config client event
<t:     286195>, node_setup.c,  371, Adding appkey
<t:     290313>, main.c,  332, Config client event
<t:     290315>, node_setup.c,  234, Unexpected opcode: exp 0x8003  rx 0x0002
<t:     291984>, main.c,  332, Config client event
<t:     291986>, node_setup.c,  272, opcode status field: 0 
<t:     291989>, node_setup.c,  382, App key bind: Health server
<t:     292886>, main.c,  332, Config client event
<t:     292889>, node_setup.c,  272, opcode status field: 0 
<t:     292891>, node_setup.c,  450, Setting publication address for the health server to 0x0001
<t:     295957>, main.c,  332, Config client event
<t:     295959>, node_setup.c,  272, opcode status field: 0 
<t:     295962>, node_setup.c,  416, App key bind: Simple On/Off client on element 0x0101
<t:     297624>, main.c,  332, Config client event
<t:     297627>, node_setup.c,  272, opcode status field: 0 
<t:     297629>, node_setup.c,  416, App key bind: Simple On/Off client on element 0x0102
<t:     298344>, main.c,  332, Config client event
<t:     298347>, node_setup.c,  272, opcode status field: 0 
<t:     298349>, node_setup.c,  416, App key bind: Simple On/Off client on element 0x0103
<t:     300170>, main.c,  332, Config client event
<t:     300172>, node_setup.c,  272, opcode status field: 0 
<t:     300174>, node_setup.c,  416, App key bind: Simple On/Off client on element 0x0104
<t:     301127>, main.c,  332, Config client event
<t:     301129>, node_setup.c,  272, opcode status field: 0 
<t:     301132>, node_setup.c,  301, Set: on/off client: 0x0101  pub addr: 0x0105
<t:     304897>, main.c,  332, Config client event
<t:     304899>, node_setup.c,  272, opcode status field: 0 
<t:     304902>, node_setup.c,  301, Set: on/off client: 0x0102  pub addr: 0x0106
<t:     308733>, main.c,  332, Config client event
<t:     308736>, node_setup.c,  272, opcode status field: 0 
<t:     308738>, node_setup.c,  301, Set: on/off client: 0x0103  pub addr: 0xC003
<t:     313549>, main.c,  332, Config client event
<t:     313551>, node_setup.c,  272, opcode status field: 0 
<t:     313553>, node_setup.c,  301, Set: on/off client: 0x0104  pub addr: 0xC002
<t:     318005>, main.c,  332, Config client event
<t:     318007>, node_setup.c,  272, opcode status field: 0 
<t:     318010>, main.c,  248, Configuration of device 0 successful
<t:     318013>, main.c,  267, All servers provisioned
<t:     370499>, main.c,  117, Flash write complete

However, pressing Button 1 on the client board doesn't have any effect on server. Am I making a mistake?

Parents
  • Hi,

    The example should work regardless of the SERVER_NODE_COUNT setting (as long as it is high enough to cover all your servers.) However I have experienced that it might be necessary to reset the server for it to work properly.

    Please also note that you may have to erase the full flash contents (nrfjprog -e) before programming the boards, since the configurations are stored in a separate area in flash that is not rewritten when you program the example. When things are not working properly it may be because of old configurations in the devices.

    Regards,
    Terje

  • Hi.

    I have the same problem with the server. I don't know Bluetooth very well, but it's weird that the server doesn't get the address.

    <t: 0>, main.c, 247, ----- BLE Mesh Light Switch Client Demo -----
    <t: 0>, mesh_softdevice_init.c, 112, Initializing SoftDevice...
    <t: 0>, mesh_softdevice_init.c, 77, Enabling BLE...
    <t: 2>, mesh_softdevice_init.c, 88, Ram base: 0x200032C8
    <t: 562>, main.c, 220, Initializing and adding models
    <t: 5422>, main.c, 275, Device UUID : 0059ABCDEFABCDEFACCDEFABCDEFABCD
    <t: 937009>, main.c, 98, Successfully provisioned
    <t: 937011>, main.c, 102, Node Address: 0x0100

    <t: 0>, main.c, 177, ----- BLE Mesh Light Switch Server Demo -----
    <t: 0>, mesh_softdevice_init.c, 112, Initializing SoftDevice...
    <t: 0>, mesh_softdevice_init.c, 77, Enabling BLE...
    <t: 2>, mesh_softdevice_init.c, 88, Ram base: 0x200032C8
    <t: 672>, main.c, 150, Initializing and adding models
    <t: 5556>, main.c, 205, Device UUID : 0059FFFF00000000218319663B85E9BB

    <t: 0>, main.c, 550, ----- BLE Mesh Light Switch Provisioner Demo -----
    <t: 0>, mesh_softdevice_init.c, 112, Initializing SoftDevice...
    <t: 0>, mesh_softdevice_init.c, 77, Enabling BLE...
    <t: 2>, mesh_softdevice_init.c, 88, Ram base: 0x200032C8
    <t: 629>, main.c, 488, Initializing and adding models
    <t: 640>, main.c, 531, Setup defaults: Adding keys, addresses, and bindings
    <t: 804>, provisioner_helper.c, 329, netkey_handle: 0
    <t: 816>, main.c, 578, <start>
    <t: 27281>, main.c, 117, Flash write complete
    <t: 27284>, main.c, 565, Starting application ...
    <t: 27286>, main.c, 567, Provisoned Nodes: 0, Configured Nodes: 0 Next Address: 0x0100
    <t: 27290>, main.c, 568, Dev key : C30E63BCBBA95DE6E75F4C7E5A7D5C97
    <t: 27293>, main.c, 569, Net key : 68D6724AD28AB95236DF4007ECFF55F0
    <t: 27296>, main.c, 570, App key : 38D6B422819AC84BF74B847AE148E5C2
    <t: 27299>, main.c, 571, Press Button 1 to start provisioning and configuration process.
    <t: 231574>, main.c, 448, Button 1 pressed
    <t: 231576>, main.c, 361, Waiting for Client node to be provisioned ...
    <t: 236337>, provisioner_helper.c, 282, Scanning For Unprovisioned Devices
    <t: 253384>, provisioner_helper.c, 144, UUID seen: 0059ABCDEFABCDEFACCDEFABCDEFABCD
    <t: 253387>, provisioner_helper.c, 95, UUID filter matched
    <t: 254355>, provisioner_helper.c, 259, Provisioning link established
    <t: 267133>, provisioner_helper.c, 254, Static authentication data provided
    <t: 279603>, provisioner_helper.c, 192, Provisioning completed received
    <t: 279607>, provisioner_helper.c, 197, Adding device address, and device keys
    <t: 279611>, provisioner_helper.c, 214, Addr: 0x0100 addr_handle: 0 netkey_handle: 0 devkey_handle: 2
    <t: 283836>, provisioner_helper.c, 155, Local provisioning link closed: prov_state: 2 remaining retries: 2
    <t: 283841>, main.c, 282, Provisioning successful
    <t: 283844>, provisioner_helper.c, 181, Provisioning complete. Node addr: 0x0100 elements: 5
    <t: 283847>, node_setup.c, 672, Configuring Node: 0x0100
    <t: 283851>, node_setup.c, 586, Config client setup: devkey_handle:2 addr_handle:0
    <t: 283854>, node_setup.c, 361, Getting composition data
    <t: 283895>, main.c, 117, Flash write complete
    <t: 337260>, main.c, 332, Config client event
    <t: 337263>, node_setup.c, 371, Adding appkey
    <t: 345407>, main.c, 332, Config client event
    <t: 345409>, node_setup.c, 234, Unexpected opcode: exp 0x8003 rx 0x0002
    <t: 349599>, main.c, 332, Config client event
    <t: 349601>, node_setup.c, 234, Unexpected opcode: exp 0x8003 rx 0x0002
    <t: 351336>, main.c, 332, Config client event
    <t: 351338>, node_setup.c, 272, opcode status field: 0
    <t: 351341>, node_setup.c, 382, App key bind: Health server
    <t: 352047>, main.c, 332, Config client event
    <t: 352049>, node_setup.c, 272, opcode status field: 0
    <t: 352052>, node_setup.c, 450, Setting publication address for the health server to 0x0001
    <t: 355376>, main.c, 332, Config client event
    <t: 355379>, node_setup.c, 272, opcode status field: 0
    <t: 355381>, node_setup.c, 416, App key bind: Simple On/Off client on element 0x0101
    <t: 360505>, main.c, 332, Config client event
    <t: 360507>, node_setup.c, 272, opcode status field: 0
    <t: 360510>, node_setup.c, 416, App key bind: Simple On/Off client on element 0x0102
    <t: 361353>, main.c, 332, Config client event
    <t: 361355>, node_setup.c, 272, opcode status field: 0
    <t: 361358>, node_setup.c, 416, App key bind: Simple On/Off client on element 0x0103
    <t: 362311>, main.c, 332, Config client event
    <t: 362313>, node_setup.c, 272, opcode status field: 0
    <t: 362315>, node_setup.c, 416, App key bind: Simple On/Off client on element 0x0104
    <t: 363063>, main.c, 332, Config client event
    <t: 363066>, node_setup.c, 272, opcode status field: 0
    <t: 363068>, node_setup.c, 301, Set: on/off client: 0x0101 pub addr: 0x0105
    <t: 366317>, main.c, 332, Config client event
    <t: 366319>, node_setup.c, 272, opcode status field: 0
    <t: 366322>, node_setup.c, 301, Set: on/off client: 0x0102 pub addr: 0x0106
    <t: 370645>, main.c, 332, Config client event
    <t: 370647>, node_setup.c, 272, opcode status field: 0
    <t: 370650>, node_setup.c, 301, Set: on/off client: 0x0103 pub addr: 0xC003
    <t: 382175>, main.c, 332, Config client event
    <t: 382177>, node_setup.c, 272, opcode status field: 0
    <t: 382180>, node_setup.c, 301, Set: on/off client: 0x0104 pub addr: 0xC002
    <t: 386570>, main.c, 332, Config client event
    <t: 386572>, node_setup.c, 272, opcode status field: 0
    <t: 386574>, main.c, 248, Configuration of device 0 successful
    <t: 386578>, main.c, 267, All servers provisioned
    <t: 439070>, main.c, 117, Flash write complete
    <t: 441871>, main.c, 332, Config client event

Reply
  • Hi.

    I have the same problem with the server. I don't know Bluetooth very well, but it's weird that the server doesn't get the address.

    <t: 0>, main.c, 247, ----- BLE Mesh Light Switch Client Demo -----
    <t: 0>, mesh_softdevice_init.c, 112, Initializing SoftDevice...
    <t: 0>, mesh_softdevice_init.c, 77, Enabling BLE...
    <t: 2>, mesh_softdevice_init.c, 88, Ram base: 0x200032C8
    <t: 562>, main.c, 220, Initializing and adding models
    <t: 5422>, main.c, 275, Device UUID : 0059ABCDEFABCDEFACCDEFABCDEFABCD
    <t: 937009>, main.c, 98, Successfully provisioned
    <t: 937011>, main.c, 102, Node Address: 0x0100

    <t: 0>, main.c, 177, ----- BLE Mesh Light Switch Server Demo -----
    <t: 0>, mesh_softdevice_init.c, 112, Initializing SoftDevice...
    <t: 0>, mesh_softdevice_init.c, 77, Enabling BLE...
    <t: 2>, mesh_softdevice_init.c, 88, Ram base: 0x200032C8
    <t: 672>, main.c, 150, Initializing and adding models
    <t: 5556>, main.c, 205, Device UUID : 0059FFFF00000000218319663B85E9BB

    <t: 0>, main.c, 550, ----- BLE Mesh Light Switch Provisioner Demo -----
    <t: 0>, mesh_softdevice_init.c, 112, Initializing SoftDevice...
    <t: 0>, mesh_softdevice_init.c, 77, Enabling BLE...
    <t: 2>, mesh_softdevice_init.c, 88, Ram base: 0x200032C8
    <t: 629>, main.c, 488, Initializing and adding models
    <t: 640>, main.c, 531, Setup defaults: Adding keys, addresses, and bindings
    <t: 804>, provisioner_helper.c, 329, netkey_handle: 0
    <t: 816>, main.c, 578, <start>
    <t: 27281>, main.c, 117, Flash write complete
    <t: 27284>, main.c, 565, Starting application ...
    <t: 27286>, main.c, 567, Provisoned Nodes: 0, Configured Nodes: 0 Next Address: 0x0100
    <t: 27290>, main.c, 568, Dev key : C30E63BCBBA95DE6E75F4C7E5A7D5C97
    <t: 27293>, main.c, 569, Net key : 68D6724AD28AB95236DF4007ECFF55F0
    <t: 27296>, main.c, 570, App key : 38D6B422819AC84BF74B847AE148E5C2
    <t: 27299>, main.c, 571, Press Button 1 to start provisioning and configuration process.
    <t: 231574>, main.c, 448, Button 1 pressed
    <t: 231576>, main.c, 361, Waiting for Client node to be provisioned ...
    <t: 236337>, provisioner_helper.c, 282, Scanning For Unprovisioned Devices
    <t: 253384>, provisioner_helper.c, 144, UUID seen: 0059ABCDEFABCDEFACCDEFABCDEFABCD
    <t: 253387>, provisioner_helper.c, 95, UUID filter matched
    <t: 254355>, provisioner_helper.c, 259, Provisioning link established
    <t: 267133>, provisioner_helper.c, 254, Static authentication data provided
    <t: 279603>, provisioner_helper.c, 192, Provisioning completed received
    <t: 279607>, provisioner_helper.c, 197, Adding device address, and device keys
    <t: 279611>, provisioner_helper.c, 214, Addr: 0x0100 addr_handle: 0 netkey_handle: 0 devkey_handle: 2
    <t: 283836>, provisioner_helper.c, 155, Local provisioning link closed: prov_state: 2 remaining retries: 2
    <t: 283841>, main.c, 282, Provisioning successful
    <t: 283844>, provisioner_helper.c, 181, Provisioning complete. Node addr: 0x0100 elements: 5
    <t: 283847>, node_setup.c, 672, Configuring Node: 0x0100
    <t: 283851>, node_setup.c, 586, Config client setup: devkey_handle:2 addr_handle:0
    <t: 283854>, node_setup.c, 361, Getting composition data
    <t: 283895>, main.c, 117, Flash write complete
    <t: 337260>, main.c, 332, Config client event
    <t: 337263>, node_setup.c, 371, Adding appkey
    <t: 345407>, main.c, 332, Config client event
    <t: 345409>, node_setup.c, 234, Unexpected opcode: exp 0x8003 rx 0x0002
    <t: 349599>, main.c, 332, Config client event
    <t: 349601>, node_setup.c, 234, Unexpected opcode: exp 0x8003 rx 0x0002
    <t: 351336>, main.c, 332, Config client event
    <t: 351338>, node_setup.c, 272, opcode status field: 0
    <t: 351341>, node_setup.c, 382, App key bind: Health server
    <t: 352047>, main.c, 332, Config client event
    <t: 352049>, node_setup.c, 272, opcode status field: 0
    <t: 352052>, node_setup.c, 450, Setting publication address for the health server to 0x0001
    <t: 355376>, main.c, 332, Config client event
    <t: 355379>, node_setup.c, 272, opcode status field: 0
    <t: 355381>, node_setup.c, 416, App key bind: Simple On/Off client on element 0x0101
    <t: 360505>, main.c, 332, Config client event
    <t: 360507>, node_setup.c, 272, opcode status field: 0
    <t: 360510>, node_setup.c, 416, App key bind: Simple On/Off client on element 0x0102
    <t: 361353>, main.c, 332, Config client event
    <t: 361355>, node_setup.c, 272, opcode status field: 0
    <t: 361358>, node_setup.c, 416, App key bind: Simple On/Off client on element 0x0103
    <t: 362311>, main.c, 332, Config client event
    <t: 362313>, node_setup.c, 272, opcode status field: 0
    <t: 362315>, node_setup.c, 416, App key bind: Simple On/Off client on element 0x0104
    <t: 363063>, main.c, 332, Config client event
    <t: 363066>, node_setup.c, 272, opcode status field: 0
    <t: 363068>, node_setup.c, 301, Set: on/off client: 0x0101 pub addr: 0x0105
    <t: 366317>, main.c, 332, Config client event
    <t: 366319>, node_setup.c, 272, opcode status field: 0
    <t: 366322>, node_setup.c, 301, Set: on/off client: 0x0102 pub addr: 0x0106
    <t: 370645>, main.c, 332, Config client event
    <t: 370647>, node_setup.c, 272, opcode status field: 0
    <t: 370650>, node_setup.c, 301, Set: on/off client: 0x0103 pub addr: 0xC003
    <t: 382175>, main.c, 332, Config client event
    <t: 382177>, node_setup.c, 272, opcode status field: 0
    <t: 382180>, node_setup.c, 301, Set: on/off client: 0x0104 pub addr: 0xC002
    <t: 386570>, main.c, 332, Config client event
    <t: 386572>, node_setup.c, 272, opcode status field: 0
    <t: 386574>, main.c, 248, Configuration of device 0 successful
    <t: 386578>, main.c, 267, All servers provisioned
    <t: 439070>, main.c, 117, Flash write complete
    <t: 441871>, main.c, 332, Config client event

Children
No Data
Related