Zephyr Blueprint

Overview

The Zephyr Project is a scalable real-time operating system (RTOS) supporting multiple hardware architectures, optimized for resource constrained devices, and built with security in mind.

The Zephyr OS is based on a small-footprint kernel designed for use on resource-constrained systems: from simple embedded environmental sensors and LED wearables to sophisticated smart watches and IoT wireless gateways.

1NCE Zephyr blueprint is a concise application that provides an overview of various features of 1NCE OS including Device Authenticator, IoT Integrator and Energy Saver. In combination with 1NCE SDK

Supported Boards

The Blueprint works with following boards:

Getting Started

Follow this guide to:

  • Set up the 1NCE IoT C SDK with different features.
  • Get the source code.
  • Build, flash, and run Secure CoAP Application.

Prerequisites

Integrate 1NCE IoT C SDK

1NCE IoT C SDK is a collection of C source files that can be used to connect and benefit from different services from 1NCE OS.

In order to integrate 1NCE IoT C SDK, you will need to go to nrf connect in your path (you can see in your
Quick Setup VS Code

NOTE: It is recommended to extract the Zephyr SDK at %HOMEPATH%

  • Open the west.yml
    %HOMEPATH%\ncs\v2.2.0\nrf\west.yml
  • Add in name-allowlist name of our sdk module nce-sdk (NOTE: the list with alphabetical order).
  • Go to %HOMEPATH%\ncs\v2.2.0\zephyr\submanifests rename example.yaml.sample to example.yaml and paste the following code on it.
manifest:
	projects:
		- name: nce-sdk
		  url: https://github.com/1NCE-GmbH/1nce-iot-c-sdk
		  revision: main
  • Open a cmd.exe window by pressing the Windows key typing “cmd.exe”
cd %HOMEPATH%\ncs\2.2.0
west update

Running the 1NCE Zephyr blueprint

  • Clone the Repository
git clone https://github.com/1NCE-GmbH/blueprint-zephyr.git
  • Open VS Code
  • Go nRF Connect extension or press Ctrl+Alt+N
  • Press Add an existing application
  • Add the 1NCE Zephyr blueprint, which cloned in the first step.
  • Add build configuration
  • Choose the Board nrf9160dk_nrf9160_ns or thingy91_nrf9160_ns
  • Press Build Configuration
  • Connect your device with the Laptop
  • Press DEBUG or Flash to flash the device.

To show the Log press NRF TERMINAL

  • Press Start Terminal with new configuration.
  • Press Serial Port
  • Choose the Port used by nRF DK

Sample Demos

UDP Demo

Overview

1NCE Zephyr UDP Demo allows customers to communicate with 1NCE endpoints via UDP Protocol, and it can send compressed payload using the Energy Saver feature.

Using 1NCE Energy saver

The demo can send optimized payload using 1NCE Energy saver. To enable this feature, add the following flag to prj.conf

CONFIG_NCE_ENERGY_SAVER=y

Configuration options

The configuration options for UDP sample are:

CONFIG_UDP_SERVER_HOSTNAME is set to 1NCE endpoint.

CONFIG_UDP_SERVER_PORT is set by default to the 1NCE UDP endpoint port 4445.

CONFIG_UDP_DATA_UPLOAD_FREQUENCY_SECONDS the interval between UDP packets.

CONFIG_PAYLOAD Message to send to 1NCE IoT Integrator.

CONFIG_PAYLOAD_DATA_SIZE Used when 1NCE Energy Saver is enabled to define the payload data size of the translation template.

CONFIG_UDP_PSM_ENABLE PSM mode configuration
This configuration option, if set, allows the sample to request PSM from the modem or cellular network.

CONFIG_UDP_EDRX_ENABLE eDRX mode configuration
This configuration option, if set, allows the sample to request eDRX from the modem or cellular network.

CONFIG_UDP_RAI_ENABLE RAI configuration
This configuration option, if set, allows the sample to request RAI for transmitted messages.

CoAP Demo

Overview

1NCE Zephyr CoAP Demo allows customers to establish a secure communication with 1NCE endpoints via CoAPs after receiving DTLS credentials from Device Authenticator using the SDK. It can also send compressed payload using the Energy Saver feature.

Secure Communication with DTLS using 1NCE SDK

By default, the demo uses 1NCE SDK to send a CoAP GET request to 1NCE OS Device Authenticator. The response is then processed by the SDK and the credentials are used to connect to 1NCE endpoint via CoAP with DTLS.

Using 1NCE Energy saver

The demo can send optimized payload using 1NCE Energy saver. To enable this feature, add the following flag to prj.conf

CONFIG_NCE_ENERGY_SAVER=y

Unsecure CoAP Communication

To test unsecure communication, disable the device authenticator by adding the following flag to prj.conf

CONFIG_NCE_DEVICE_AUTHENTICATOR=n

Configuration options

The configuration options for CoAP sample are:

CONFIG_COAP_SERVER_HOSTNAME is set to 1NCE endpoint.

CONFIG_COAP_SERVER_PORT is set automatically based on security options (with/without DTLS).

CONFIG_COAP_URI_QUERY the URI Query option used to set the MQTT topic for 1NCE IoT integrator.

CONFIG_COAP_DATA_UPLOAD_FREQUENCY_SECONDS the interval between CoAP packets.

CONFIG_PAYLOAD Message to send to 1NCE IoT Integrator.

CONFIG_PAYLOAD_DATA_SIZE Used when 1NCE Energy Saver is enabled to define the payload data size of the translation template.

LwM2M Demo

Overview

1NCE Zephyr LwM2M Demo allows customers to communicate with 1NCE endpoints via LwM2M Protocol.

Configuration options

The configuration options for LwM2M sample are:

CONFIG_LWM2M_CLIENT_UTILS_SERVER is set to 1NCE endpoint with port.

CONFIG_NCE_ICCID the ICCID of 1NCE SIM Card.

Asking for Help

The most effective communication with our team is through GitHub. Simply create a new issue and select from a range of templates covering bug reports, feature requests, documentation issue, or Gerneral Question.