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

Using Simple message model.

Hi,

I have certain doubts regarding simple message model

1. Why simple_message_client_init or simple_message_server_init is never used? Don't we need this function to bind model to the element?

2. I am sending a message from client to server. Can I receive it from simple_message_server.c and vice versa?

3. I could not understand how the model's functions can be used and how the communication takes place.

  • Log of client:

    <t:          0>, main.c,  336, ----- 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:        543>, main.c,  303, Initializing and adding models1
    <t:       5405>, main.c,  364, Device UUID : 0059ABCDEFABCDEFACCDEFABCDEFABCD
    <t:    1058393>, main.c,  127, Successfully provisioned
    <t:    1058396>, main.c,  131, Node Address: 0x0100 
    4<t:    2727012>, main.c,  228, Button 4 pressed
    entering button 4 field
    Sending to group address 0xCAFE
    <t:    2759785>, app_error_weak.c,  105, Mesh error 7 at 0x00026B15 (C:\Users\arya\Desktop\Bluetooth\BLE Tools\mesh_V_2.0.1\mesh\nrf5_SDK_for_Mesh_v2.0.1_src_II\examples\Simple_RSSI\client\src\main.c:479)
    

    Log of server:

    <t:          0>, main.c,  236, ----- 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:        584>, main.c,  204, Initializing and adding models
    <t:       5456>, main.c,  264, Device UUID : 0059FFFF00000000108AD6A930A6E556
    <t:      83213>, main.c,   97, Successfully provisioned
    <t:      83215>, main.c,  101, Node Address: 0x0105 
    

  • Could you please also upload the provisioner log information? Mesh error 7 refers to NRF_ERROR_INVALID_PARAM from nrf_error.h. It seems to me as if the client was successfully provisioned, but not configured. It would be useful to see the provisioner log to double check this assumption.

  • Provisioner Log:

    <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:          1>, mesh_softdevice_init.c,   88, Ram base: 0x200032C8
    <t:        604>, main.c,  488, Initializing and adding models
    <t:        617>, main.c,  531, Setup defaults: Adding keys, addresses, and bindings 
    <t:        769>, provisioner_helper.c,  329, netkey_handle: 0
    <t:        781>, main.c,  578, <start> 
    <t:      27358>, main.c,  117, Flash write complete
    <t:      27360>, main.c,  565, Starting application ...
    <t:      27362>, main.c,  567, Provisoned Nodes: 0, Configured Nodes: 0 Next Address: 0x0100
    <t:      27366>, main.c,  568, Dev key : B3A51809537338801488B944EDE54B01
    <t:      27369>, main.c,  569, Net key : 68F6AC161BB591FD9248501CF195BFF4
    <t:      27372>, main.c,  570, App key : F927212BDC82948FB0A60E1992F5EE3A
    <t:      27375>, main.c,  571, Press Button 1 to start provisioning and configuration process. 
    0<t:    2635493>, main.c,  448, Button 1 pressed
    <t:    2635495>, main.c,  361, Waiting for Client node to be provisioned ...
    <t:    2640249>, provisioner_helper.c,  282, Scanning For Unprovisioned Devices
    <t:    2667060>, provisioner_helper.c,  144, UUID seen: 0059FFFF00000000108AD6A930A6E556
    <t:    2696197>, provisioner_helper.c,  144, UUID seen: 0059ABCDEFABCDEFACCDEFABCDEFABCD
    <t:    2696200>, provisioner_helper.c,   95, UUID filter matched
    <t:    2696652>, provisioner_helper.c,  259, Provisioning link established
    <t:    2710138>, provisioner_helper.c,  254, Static authentication data provided
    <t:    2722171>, provisioner_helper.c,  192, Provisioning completed received
    <t:    2722174>, provisioner_helper.c,  197, Adding device address, and device keys
    <t:    2722179>, provisioner_helper.c,  214, Addr: 0x0100 addr_handle: 0 netkey_handle: 0 devkey_handle: 2
    <t:    2726297>, provisioner_helper.c,  155, Local provisioning link closed: prov_state: 2  remaining retries: 2
    <t:    2726301>, main.c,  282, Provisioning successful
    <t:    2726303>, provisioner_helper.c,  181, Provisioning complete. Node addr: 0x0100 elements: 5
    <t:    2726307>, node_setup.c,  672, Configuring Node: 0x0100
    <t:    2726310>, node_setup.c,  586, Config client setup: devkey_handle:2 addr_handle:0
    <t:    2726313>, node_setup.c,  361, Getting composition data
    <t:    2726377>, main.c,  117, Flash write complete
    <t:    2780045>, main.c,  332, Config client event
    <t:    2780048>, node_setup.c,  371, Adding appkey
    <t:    2800057>, main.c,  332, Config client event
    <t:    2800059>, node_setup.c,  234, Unexpected opcode: exp 0x8003  rx 0x0002
    <t:    2809682>, main.c,  332, Config client event
    <t:    2809684>, node_setup.c,  272, opcode status field: 0 
    <t:    2809687>, node_setup.c,  382, App key bind: Health server
    <t:    2810584>, main.c,  332, Config client event
    <t:    2810586>, node_setup.c,  272, opcode status field: 0 
    <t:    2810589>, node_setup.c,  450, Setting publication address for the health server to 0x0001
    <t:    2813780>, main.c,  332, Config client event
    <t:    2813782>, node_setup.c,  272, opcode status field: 0 
    <t:    2813784>, node_setup.c,  416, App key bind: Simple On/Off client on element 0x0101
    <t:    2815287>, main.c,  332, Config client event
    <t:    2815290>, node_setup.c,  272, opcode status field: 0 
    <t:    2815292>, node_setup.c,  416, App key bind: Simple On/Off client on element 0x0102
    <t:    2815979>, main.c,  332, Config client event
    <t:    2815981>, node_setup.c,  272, opcode status field: 0 
    <t:    2815984>, node_setup.c,  416, App key bind: Simple On/Off client on element 0x0103
    <t:    2816935>, main.c,  332, Config client event
    <t:    2816937>, node_setup.c,  272, opcode status field: 0 
    <t:    2816939>, node_setup.c,  416, App key bind: Simple On/Off client on element 0x0104
    <t:    2817875>, main.c,  332, Config client event
    <t:    2817877>, node_setup.c,  272, opcode status field: 0 
    <t:    2817880>, node_setup.c,  301, Set: on/off client: 0x0101  pub addr: 0x0105
    <t:    2821600>, main.c,  332, Config client event
    <t:    2821602>, node_setup.c,  272, opcode status field: 0 
    <t:    2821605>, node_setup.c,  301, Set: on/off client: 0x0102  pub addr: 0x0106
    <t:    2825063>, main.c,  332, Config client event
    <t:    2825065>, node_setup.c,  272, opcode status field: 0 
    <t:    2825067>, node_setup.c,  301, Set: on/off client: 0x0103  pub addr: 0xC002
    <t:    2829581>, main.c,  332, Config client event
    <t:    2829583>, node_setup.c,  272, opcode status field: 0 
    <t:    2829586>, node_setup.c,  301, Set: on/off client: 0x0104  pub addr: 0xC002
    <t:    2833837>, main.c,  332, Config client event
    <t:    2833839>, node_setup.c,  272, opcode status field: 0 
    <t:    2833842>, main.c,  248, Configuration of device 0 successful
    <t:    2833845>, provisioner_helper.c,  282, Scanning For Unprovisioned Devices
    <t:    2833902>, main.c,  117, Flash write complete
    <t:    2864209>, provisioner_helper.c,  144, UUID seen: 0059FFFF00000000108AD6A930A6E556
    <t:    2864212>, provisioner_helper.c,   95, UUID filter matched
    <t:    2864727>, provisioner_helper.c,  259, Provisioning link established
    <t:    2877566>, provisioner_helper.c,  254, Static authentication data provided
    <t:    2890351>, provisioner_helper.c,  192, Provisioning completed received
    <t:    2890354>, provisioner_helper.c,  197, Adding device address, and device keys
    <t:    2890359>, provisioner_helper.c,  214, Addr: 0x0105 addr_handle: 1 netkey_handle: 0 devkey_handle: 3
    <t:    2894056>, provisioner_helper.c,  155, Local provisioning link closed: prov_state: 2  remaining retries: 2
    <t:    2894060>, main.c,  282, Provisioning successful
    <t:    2894062>, provisioner_helper.c,  181, Provisioning complete. Node addr: 0x0105 elements: 2
    <t:    2894066>, node_setup.c,  672, Configuring Node: 0x0105
    <t:    2894069>, node_setup.c,  586, Config client setup: devkey_handle:3 addr_handle:1
    <t:    2894073>, node_setup.c,  361, Getting composition data
    <t:    2894136>, main.c,  117, Flash write complete
    <t:    2949503>, main.c,  332, Config client event
    <t:    2949505>, node_setup.c,  371, Adding appkey
    <t:    2952678>, main.c,  332, Config client event
    <t:    2952680>, node_setup.c,  272, opcode status field: 0 
    <t:    2952683>, node_setup.c,  382, App key bind: Health server
    <t:    2953486>, main.c,  332, Config client event
    <t:    2953489>, node_setup.c,  272, opcode status field: 0 
    <t:    2953491>, node_setup.c,  397, App key bind: Simple On/Off server
    <t:    2954236>, main.c,  332, Config client event
    <t:    2954238>, node_setup.c,  272, opcode status field: 0 
    <t:    2954241>, node_setup.c,  450, Setting publication address for the health server to 0x0001
    <t:    2957459>, main.c,  332, Config client event
    <t:    2957461>, node_setup.c,  272, opcode status field: 0 
    <t:    2957464>, node_setup.c,  476, Set: on/off server pub addr: 0x0101
    <t:    2960840>, main.c,  332, Config client event
    <t:    2960843>, node_setup.c,  272, opcode status field: 0 
    <t:    2960845>, node_setup.c,  487, Adding subscription
    <t:    2962841>, main.c,  332, Config client event
    <t:    2962843>, node_setup.c,  272, opcode status field: 0 
    <t:    2962845>, main.c,  248, Configuration of device 1 successful
    <t:    2962848>, provisioner_helper.c,  282, Scanning For Unprovisioned Devices
    <t:    2962905>, main.c,  117, Flash write complete
    <t:    3140366>, main.c,  311, Node 0x0100 alive with 0 active fault(s), RSSI: -53
    <t:    3283386>, main.c,  311, Node 0x0105 alive with 0 active fault(s), RSSI: -50
    <t:    3467786>, main.c,  311, Node 0x0100 alive with 0 active fault(s), RSSI: -52
    <t:    3611803>, main.c,  311, Node 0x0105 alive with 0 active fault(s), RSSI: -44
    <t:    3795738>, main.c,  311, Node 0x0100 alive with 0 active fault(s), RSSI: -52
    <t:    3939276>, main.c,  311, Node 0x0105 alive with 0 active fault(s), RSSI: -47

  • Hi Bjørn,

    My error comes from simple_RSSI_client_set_unreliable -> access_model_publish -> packet_tx -> check_tx_params. I think the way I am setting the publishing address is wrong. Or is it something related to provisioning? Can you please check the way I am initiating model and setting address to send message. Probably there will be something wrong I guess.

  • Hi,

    I think the error is in the way that I am adding the new model because, publish_appkey_handle, publish_address_handle, and opcodes are invalid in the function check_tx_params. Problem might be with the element index I guess. Should I begin  a new case for this?

Related