Controlling the nRF52833 dk using serial communication, without the Python application.

I am using the following setup:

  1. A nRF52833 dk, running the serial example from the mesh sdk.
  2. A nRF52840, running the light switch server example from the mesh sdk.
  3. A pc running an application, which will send and receive serial commands to and from the nRF52833 dk.

This pc application has to do two things:

  1. Send the serial commands to the nRF52833, so it can provision the nRF52840.
  2. Send the serial commands to the nRF52833, so it can turn on and off the light on the nRF52840.

So far, I have succesfully sent and received serial commands like 'echo' and 'scan start' to the nRF52833, using the documentation (Infocenter/Software Development Kit/nRF5 SDK for Mesh v5.0.0/Bluetooth mesh stack user guide/Modules/Serial interface/Serial interface library). However, I have not yet figured out how to do either of the two points mentioned above. This is because I cannot find which commands I should and should not use, and in what order.

So my question comes down to: How do I provision and control the nRF52840 using the nRF52833 via serial communication?

  • The PyACI script and the PC application don't do exactly the same thing yet. This is because some commands are different each time I provision the nRF52840, so they require a different payload every time. One of the commands that has this "issue" is the ECDH secret command.

    I was wondering if you know how to determine the payload of this command, and the ones in my previous comment, or if I'm doing something else wrong entirely.

  • SiemV said:
    I was wondering if you know how to determine the payload of this command, and the ones in my previous comment, or if I'm doing something else wrong entirely.

    I merely know the concept that the ECDH Secret is going to be a key sharing procedure to encrypt messages. Thus, it makes sense that the payload has to be different each time. (See more in this article)

    As for the implementation details of how exactly that key, and subsequently the message's payload, is calculated/generated, I'm afraid that I don't know.

    There are two directions I would recommend here:

    • Modify the PyACI script into some sort of library that generates commands for your application
      This is the approach I better recommended, since it should save you a lot of time.

    • Reverse engineering the ECDH Secret command of the PyACI script
      The ECDH Secret command is most likely involved in the /mesh/provisioning.py folder. But you probably know that.

    For both approaches, the PyACI source code is available here: https://github.com/NordicSemiconductor/nRF5-SDK-for-Mesh/tree/master/scripts/interactive_pyaci. But you probably already have that from the installation of the script.
    I embarrassed myself here, the script is available with the SDK.

    How feasible do you think those approaches are for you?

    By the way, I am out of office for the rest of the week. If you need urgent support, please mention and we will try to find an alternative.

Related