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

How to use Mesh Serial Example?

I have a PCA10040 working with the mesh sdk.v1.0.0 serial example. I can do an Echo via the Python interactive_syaci and get a back a response. I have seen the documentation with the commands and events. However, other than the example showing how to connect /dev/ttyACM0 /dev/ttyACM1 how are the other commands used? More specifically:

Why does send(cmd.BeaconStart(0, "0000000000000000000000000000000")) give a 'Success' message back but there's no advertising in the (Android) nRF Connect app? What's a slot? (The code seems to hardcode to only one slot? Why?)

What commands need to be sent to discover mesh devices in range? I have tried send(cmd.ScanStart()) but it just sends back a 'Success' message.

Given mesh devices in range can be determined, what commands provision them? (the example just shows provisioning physically UART connected devices).

The code seems to provide for PB-Remote via serial (infocenter.nordicsemi.com/.../group__SERIAL__PB__REMOTE__CLIENT.html. How is this accessed using the serial example?

Thanks

Simon

  • I still don't understand what the ScanStart does and how to use it to provision devices.

    With an unprovisioned device (the light server sample + beacon sample mix as discussed in devzone.nordicsemi.com/.../ except using v1.0 mesh) in range, a ScanStart just returns "Success". How do I then see them and then provision them?

    Also, I think there might be another bug. If I start the Serial sample while the unprovisioned device is powered, the python UI returns a timeout, even for a simple Echo. If I power off the unprovisioned device, start the serial sample, and then power the unprovisioned device, the Python commands work ok. Looks like something in the Serial init gets mixed up when there are unprovisioned devices present.

    Thanks

    Simon

  • ScanStart should start make your device start listening for unprovisioned device beacons. If you connect two devices, the following set of commands should give:

    In [7]: d[0].send(cmd.ScanStart())
    2018-01-09 15:58:34,881 - DEBUG - ttyACM1: parsed_packet {event: CmdRsp, data: {'opcode': 97, '}
    2018-01-09 15:58:34,881 - INFO - ttyACM1: Success
    In [8]: d[1].send(cmd.Listen())
    2018-01-09 15:58:43,279 - DEBUG - ttyACM2: parsed_packet {event: CmdRsp, data: {'opcode': 100, }
    2018-01-09 15:58:43,280 - INFO - ttyACM2: Success
    2018-01-09 15:58:44,520 - DEBUG - ttyACM1: parsed_packet {event: ProvUnprovisionedReceived, data: {'uui...
    

    cmd.Listen() starts the unprovisioned node beacon for the second device. Have you tested this example infocenter.nordicsemi.com/.../md_scripts_interactive_pyaci_README.html ?

  • Thanks for pointer to sample but as I mentioned in original question, I have seen that. It's not the same as my scenario as I need to provision nearby unprovisioned deviced not connected via UART. I now have the serial example seeing my unprovisioned devices. I am getting multiple:

    2018-01-10 12:14:00,611 - INFO - COM6: {event: ProvUnprovisionedReceived, data: {'uuid': bytearray(b'\xc2\xa8\xd0\xbe\x8
    1\xc6\x1co\xce\x12}\x19\xd5LQz'), 'adv_addr_type': 1, 'rssi': 208, 'gatt_supported': 0, 'adv_addr': bytearray(b'\xce\x12
    }\x19\xd5\xcc')}}
    2018-01-10 12:16:41,936 - INFO - COM6: {event: ProvUnprovisionedReceived, data: {'uuid': bytearray(b"v\r5\n\x0b\x89ZT~\x
    bf\x1d\x10\'\x84\xa3\xf9"), 'adv_addr_type': 1, 'rssi': 205, 'gatt_supported': 0, 'adv_addr': bytearray(b"~\xbf\x1d\x10\
    '\xc4")}}
    

    How do I provision these devices via the PyACI command line?

    Thanks Simon

  • The devices in the example are connected on UART, but the provisioning is happening via the normal provisioning protocol. You can use the same method for any provisionee device, e.g., the light switch server. In provisioning.py there is two simple provisionee and provisioner interfaces. Using the provisioner as in the example documentation is as easy as:

    p = Provisioner(d[0])
    p.scan_start()
    p.provision()
    
Related