Skip to content

nRF9160#

Integrate your Nordic nRF9160 board.

Prerequisites#

  • The nRF9160 board with a USB cable.
  • Installed minicom (for Linux) or RealTerm or PuTTy (for Windows) or other serial communication program.
  • Installed nrfjprog from Nordic Semiconductor page
  • A user with access to the Coiote IoT Device Management platform.

Prepare binaries#

Use an already built binary#

To get the latest binary file and flash the board:

  1. Go to Anjay-zephyr-client.
  2. Download the demo_nrf9160dk_merged.hex file.
  3. To program the board, go through the whole process of flashing nRF described here.
  4. Use the nRF Connect Programmer with the downloaded .hex file and execute steps from the Updating the application firmware section.
  5. Reset the board and go to the Connecting to the LwM2M Server.

Start development using samples#

Note

This step is optional. If you've gone through the Use an already built binary step, you can jump to Connecting to the LwM2M Server.

Part 1: Getting Zephyr and Python dependencies#

To get the Zephyr SDK and dependencies follow the first 4 steps of the instruction provided by the Zephyr Project (from the set up the OS to installing the Zephyr SDK).

Part 2: Cloning the Anjay zephyr repository#

Enter the command line interface on your machine and change the directory to the one where you set up the Zephyr project (usually, it's ~/zephyrproject), then paste and run the following command:

git clone https://github.com/AVSystem/Anjay-zephyr-client

Part 3: Compiling the example#

  1. Connect the nRF9160 board to a USB port of your machine.
  2. Set West manifest path to Anjay-zephyr-client/demo, manifest file to west-nrf.yml, and do west update:

    west config manifest.path Anjay-zephyr-client/demo
    west config manifest.file west-nrf.yml
    west update
    
  3. Compile the project for nRF9160:

    cd Anjay-zephyr-client/demo
    west build -b nrf9160dk_nrf9160ns
    
  4. Find the merged.hex file under the build/zephyr directory in the project folder.

  5. Use the nRF Connect Programmer to flash the created .hex file onto the board. For more information, follow the updating the application firmware documentation.

Connecting to the LwM2M Server#

To connect to Coiote IoT Device Management platform, please register at https://eu.iot.avsystem.cloud.

To connect the board:

  1. Log in to Coiote IoT DM and from the left side menu, select Device Inventory.
  2. In Device Inventory, click Add device.
  3. Select the Connect your LwM2M device directly via the Management server tile. Add via Mgmt
    1. In the Device credentials step:
      • In the Device ID enter your board endpoint name, e.g. test_device. Device credentials step
      • In the Security mode section, select the PSK (Pre-Shared Key) mode:
        • In the Key identity field, type the same name as in the Endpoint name field
        • In the Key field, type the shared secret used in the device-server authentication.
    2. Click the Add device button and Confirm in the confirmation pop-up.
    3. In the Connect your device step, follow the next section to run the client and connect it to the server.

Configuring the Client#

  1. With the board still connected to a serial port interface, open a serial communication program.
  2. Use the anjay command to list possible options:

    uart:~$ anjay
    anjay - Anjay commands
    Subcommands:
    start   :Save config and start Anjay
    stop    :Stop Anjay
    config  :Configure Anjay params
    

    Tip

    To show available subcommands, use the Tab key.

  3. Check your default credentials by following the instructions in the program: Anjay configuration

    Note

    If your default credentials are different from device credentials provided in Coiote IoT DM, change them using the anjay config set <possible_option> <value> command.
    Anjay set configuration

  4. Use the anjay start command to run the Client.

  5. Go to Coiote IoT DM to check if your device is connected. Click Next, then Go to Summary, then Finish. You will see your Device Center view: Registered device

Note

When Anjay has no connection with the server or network for a long time, warning at_monitor: No heap space for incoming notification: <notification> may appear. It does not affect the operation of the application and will no longer appear after reconnection.

Note

nRF9160 uses the same radio for GPS and LTE connectivity. GPS signal is caught between LTE transmissions and in case GPS "cold" fix acquisition takes too much time, Anjay turns off LTE transmissions for the time of fix acquisition. It can be seen by the following warning: gps_nrf: GPS was interrupted multiple times by the LTE modem when producing a fix. Anjay is notified by it, enters offline mode and reconnects when the first fix is acquired and LTE is enabled back.


Last update: July 18, 2023