Skip to content

AVSystem/Anjay-zephyr-client

master
Switch branches/tags
Code

Latest commit

Features:
- Added support for factory provisioning
- Added `nls_agps_req` shell command for Nordic Location Services A-GPS testing purposes

Improvements:
- Updated Anjay-zephyr to 3.1.1
- Updated static partition definitions
- Improved logging in Location Assistance object
- Cleaned up use of logging statements
- Separated factory provisioning-related code from the main application

Bugfixes:
- Enabled full printf to work with Zephyr SDK 0.14.2
- Fixed PWM code for Thingy:91
- LwM2M 1.1 is not enforced anymore when using persistence
- Fixed memleak in persist_target_to_settings()
44ea5a1

Git stats

Files

Permalink
Failed to load latest commit information.

Anjay-zephyr-client

Overview

This repository contains LwM2M Client samples based on open-source Anjay Zephyr Module and Zephyr OS.

The following examples are present:

Directory Description
demo/ Showcase example implementing all features and sensors available on board. Supports experimental factory provisioning feature of Anjay 3.0. Supported boards:
B-L475E-IOT01A Discovery kit
nRF9160 Development kit
Nordic Thingy:91 Prototyping kit
any other board of your choice (by adding appropriate *.conf/*.overlay files). FOTA support for selected boards.
minimal/ Minimalistic client samples which may serve as a base for specific application. Supported boards/targets:
qemu_x86
B-L475E-IOT01A Discovery kit
nRF9160 Development kit
Nordic Thingy:91 Prototyping kit
ei_demo/ An example containing motion recognition model, built with Edge Impulse. Supported boards/targets:
Nordic Thingy:91 Prototyping kit

Getting started

First of all, get Zephyr, SDK and other dependecies, as described in Zephyr's Getting Started Guide (first 4 steps).

After navigating to Zephyr workspace (~/zephyrproject is default after following Getting Started Guide), clone Anjay Zephyr client repository.

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

If you want to compile for nRF9160 targets, additional GNU Arm Embedded Toolchain is necessary, to install it follow installing the toolchain for NCS guide. Also for flashing nRF Command Line Tools have to be installed.

For further instructions, check README.md in the folder with the example in which you are interested.

Setting up Visual Studio Code (for nRF9160 targets)

The nRF Connect SDK has a set of plugins for Visual Studio Code (VSC). They can be used to simplify the build process for the nRF boards. To do that we need to set up VSC first.

NOTE: On a Linux system, first make sure that GNUARMEMB_TOOLCHAIN_PATH variable is set in the scope that Visual Studio Code is run.

You can set this permanently by adding a line similar to the following (adjusted to your toolchain installation directory) to your ~/.profile file (or ~/.bash_profile or ~/.zprofile etc., depending on your shell and preferences):

export GNUARMEMB_TOOLCHAIN_PATH="$HOME/gcc-arm-none-eabi-10.3-2021.10"

Open VSC and, on the Extensions tab, install the "nRF Connect for VS Code" plugin or the "nRF Connect Extension Pack" (which includes the former). After the installation, the "Welcome to nRF Connect" window should appear. In case it doesn't, you can open it from the nRF Connect tab -> Welcome -> Open Welcome page. Set nRF Connect SDK to the folder where west initialized Zephyr (~/zephyrproject is the default suggested in the Getting Started Guide). The "nRF Connect Toolchain" setting should point to the gnuarmemb toolchain installation folder, or in case of Linux, it should be set as "PATH" (it will use the setting from GNUARMEMB_TOOLCHAIN_PATH to find it).

If the environment was not set up earlier, go to the Source Control tab, open the Terminal tab (Ctrl+Shift+`). In case it opens in a wrong directory, navigate to where you have initialized Zephyr and its dependencies (e.g. ~/zephyrproject). Then run:

west config manifest.path Anjay-zephyr-client/demo
west config manifest.file west-nrf.yml
west update

NOTE: If building a project other than demo, please adjust the path in the above commands accordingly.

NOTE: West manifest folder can be changed in Source Control by clicking "Select manifest" on the root of the Zephyr repository and choosing a different folder. If the manifest is different a "west update" icon will show up next to the manifest file name. Clicking it will update the repository. If the manifest you want to change to has a different name (and not only a different path) then it must be changed directly using the west config command in the terminal.

This is why using the command line is necessary to choose the manifest for this project - the nRF-specific manifests are called west-nrf.yml, which is not supported by the plugin's GUI at the moment.

Now we can add the application to VSC workspace. Click on nRF Connect tab -> Application -> Add Application. Open the folder containing the prj.conf file (e.g. Anjay-zephyr-client/demo). In the Application section the demo application should show up. Click on "No build configuration" to add a configuration for the desired target, e.g. nrf9160dk_nrf9160_ns (you can have multiple configurations for different targets). Choose your target and click "Build Configuration" in order to build the application. Next builds can be started by choosing Actions -> Build.

Connecting to the LwM2M Server

To connect to Coiote IoT Device Management LwM2M Server, please register at https://eu.iot.avsystem.cloud/. Then have a look at the example configuration to configure security credentials and other necessary settings (like Wi-Fi SSID etc.).

Guide showing basic usage of Coiote DM is available on IoT Developer Zone.

NOTE: You may use any LwM2M Server compliant with LwM2M 1.0 TS. The server URI can be changed in the example configuration options.