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

In Mesh SDK 2.0.1 Light Switch Client demo is not working with interactive_pyaci

I have followed the exact steps mentioned here http://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.meshsdk.v2.0.1%2Fmd_scripts_interactive_pyaci_doc_demo_configuration.html&cp=4_1_0_2_0_2

But From Light Switch Client after successful provisioning configuration, button press events from Light Switch Client node is not sending it to Light Switch Server getting following messages in RTT viewer.  But any state change from Light switch Server will be received by Light Switch Client.

I'm not sure what went wrong, almost repeated the steps like fresh programming multiple times and followed the steps exactly but nothing works. It's Blocking the Gateway implementation

Hardware Setup:

1. nRF52832-DK1 Programmed with serial_nrf52832_xxAA_s132_6_0_0.emProject

2. nRF52832-DK2 Programmed with light_switch_server_nrf52832_xxAA_s132_6_0_0.emProject

3. nRF52832-DK3 Programmed with light_switch_client_nrf52832_xxAA_s132_6_0_0.emProject

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# IPython log file
db = MeshDB("database/example_database.json")
db.provisioners
p = Provisioner(device, db)
p.scan_start()
p.scan_stop()
p.provision(name="Light bulb")
cc = ConfigurationClient(db)
device.model_add(cc)
cc.publish_set(8, 0)
cc.composition_data_get()
cc.appkey_add(0)
cc.model_app_bind(db.nodes[0].unicast_address, 0, mt.ModelId(0, 0x59))
sc = SimpleOnOffClient()
device.model_add(sc)
sc.publish_set(0, 0)
sc.set(True)
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
2018-05-13 11:37:34,944 - DEBUG - COM8: TX: 6169a8bebad2f3229fcc80a5e72577d6b5dd3209e06939661817baf38830f89e79390ba428b7a079ddad5cebef1fc59ef5efba02df74a5ba72e74370fe69121dbce69cd7d8cf7e2a7c64c3c9a57ef84ea24de0fda0adad9112a4370e7f2450cbc05e
2018-05-13 11:37:34,955 - DEBUG - COM8: RX: 03846900
2018-05-13 11:37:34,956 - DEBUG - COM8: parsed_packet {event: CmdRsp, data: {'opcode': 105, 'status': 0, 'data': bytearray(b'')}}
2018-05-13 11:37:34,957 - DEBUG - COM8: TX: 059f01000100
2018-05-13 11:37:34,956 - INFO - COM8: Success
2018-05-13 11:37:35,002 - DEBUG - COM8: RX: 03849f00
2018-05-13 11:37:35,018 - DEBUG - COM8: parsed_packet {event: CmdRsp, data: {'opcode': 159, 'status': 0, 'data': bytearray(b'')}}
2018-05-13 11:37:35,022 - DEBUG - COM8: TX: 1392000018eed9c2a56add85049ffc3c59ad0e12
2018-05-13 11:37:35,021 - INFO - COM8: Success
2018-05-13 11:37:35,026 - DEBUG - COM8: RX: 058492000000
2018-05-13 11:37:35,026 - DEBUG - COM8: parsed_packet {event: CmdRsp, data: {'opcode': 146, 'status': 0, 'data': bytearray(b'\x00\x00')}}
2018-05-13 11:37:35,027 - DEBUG - COM8: TX: 1597000000004f68ad85d9f48ac8589df665b6b49b8a
2018-05-13 11:37:35,026 - INFO - COM8: SubnetAdd: {'subnet_handle': 0}
2018-05-13 11:37:35,030 - DEBUG - COM8: RX: 058497000000
2018-05-13 11:37:35,030 - DEBUG - COM8: parsed_packet {event: CmdRsp, data: {'opcode': 151, 'status': 0, 'data': bytearray(b'\x00\x00')}}
2018-05-13 11:37:35,031 - DEBUG - COM8: TX: 1597010000002aa2a6ded5a0798ceab5787ca3ae39fc
2018-05-13 11:37:35,030 - INFO - COM8: AppkeyAdd: {'appkey_handle': 0}
2018-05-13 11:37:35,034 - DEBUG - COM8: RX: 058497000100
2018-05-13 11:37:35,034 - DEBUG - COM8: parsed_packet {event: CmdRsp, data: {'opcode': 151, 'status': 0, 'data': bytearray(b'\x01\x00')}}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Parents
  • you have to modify the light switch example for it to send the simple_on_off message even when you only have a publication address configured.

    something like what i did below...

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    static bool client_publication_configured(uint8_t i)
    {
    dsm_handle_t pub_addr_handle;
    if (i < CLIENT_MODEL_INSTANCE_COUNT)
    {
    if (access_model_publish_address_get(m_clients[i].model_handle, &pub_addr_handle) == NRF_SUCCESS)
    {
    if (pub_addr_handle == DSM_HANDLE_INVALID)
    {
    return false;
    }
    return true;
    }
    else
    {
    return false;
    }
    }
    else
    {
    return false;
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    jing

  • Hi,

    This should not be necessary. The root cause of this and similar issues seems to be an off by one error related to the SERVER_NODE_COUNT define in light_switch_example_common.h. If you set it to one higher than the number of servers and closely follow the "Running the example" section of the Light switch demo documentation then everything should work as intended.

    Alternatively, find in main.c of the provisioner example the comparisons "m_nw_state.provisioned_devices < SERVER_NODE_COUNT" and "m_nw_state.configured_devices < SERVER_NODE_COUNT". Replace "SERVER_NODE_COUNT" with "(SERVER_NODE_COUNT + CLIENT_NODE_COUNT)".

    Regards,
    Terje

Reply
  • Hi,

    This should not be necessary. The root cause of this and similar issues seems to be an off by one error related to the SERVER_NODE_COUNT define in light_switch_example_common.h. If you set it to one higher than the number of servers and closely follow the "Running the example" section of the Light switch demo documentation then everything should work as intended.

    Alternatively, find in main.c of the provisioner example the comparisons "m_nw_state.provisioned_devices < SERVER_NODE_COUNT" and "m_nw_state.configured_devices < SERVER_NODE_COUNT". Replace "SERVER_NODE_COUNT" with "(SERVER_NODE_COUNT + CLIENT_NODE_COUNT)".

    Regards,
    Terje

Children
  • Hi Terje,

           Thanks for your response, currently i have below configuration in light_switch_example_common.h

    SERVER_NODE_COUNT which is more than 1 but still the issue is same. I'm using serial node interfaced to PC with interactive_pyaci as provisioner. I'm not using the provisioner example application. Our application doesn't need  prevision example.

    Best Regards,

    Manoj

  • I think that the solution proposed by Jing in this thread solves the problem since, without that change, the client is not successfully configured until the subscription address is added.

  • Ah, sorry. I confused this with a couple of other threads using the provisioner from the example (and not provisioning through the python interface).