/sag-c8y-nb-iot-demo

Internship project of Brent Swaenen, implementing a weather station, based on an Arduino devkit, that syncs data to Cumulocity over the Orange NB-IoT network.

Primary LanguageC++Apache License 2.0Apache-2.0

Index

Introduction

This project implements a weather station, based on an Arduino devkit, that syncs data to Software AG Cumulocity over the Orange NB-IoT network. It is similar to the sag-c8y-lora-demo project, but uses NB-IoT instead of LoRa. It's the result of Brent Swaenen's internship @ i8c during the spring of 2019.

DISCLAIMER: Internship projects are offered for demonstration purposes only and are provided "as is." We make no warranty that internship projects are error-free. Your use of internship projects for any other purposes is at your own risk. DO NOT USE THIS PROJECT IN A PRODUCTION ENVIRONMENT! Further instructions on terms and conditions for use, reproduction, and distribution can be found in the Apache License Version 2.0 LICENSE file.

🔝

What's in this project?

General diagram

NB-IOT blockSchema

General explanation

Above, you see the different components of this project. In the following table you'll see the general purpose of each part. These will be explained in more detail down below.

Component Purpose
Sensors Provides the data you need to capture.
NB-IoT Node Reads the sensor values and sends out NB-IoT packets.
Orange Antenna Receives the NB-IoT packets and forwards them to the Agent on AWS ECS.
AWS ECS Manages the containers that run the Agent, Broker and workers.
AWS ECS: NB-Iot Agent Routes the packets around to and from the device, broker and cumulocity.
AWS ECS: RabbitMQ Broker A broker to queue all messages between the Agent and the workers.
Cumulocity Core Receives the data from the Agent, cumulocity will respond with credentials on register, or store and visualise the data when pushing the measurement.

🔝

Communication between the device and the agent:

This diagram shows the entire flow in more detail. NB-IOT communication

🔝

Components

NB-IoT node (SODAQ Mbili)

The NB-IoT node contains a SODAQ Mbili board with and attached uBlox SaraN211 NB-IOT module. This is an arduino compatible board made for easy prototyping. Arduino comes with a big variety of opensource libraries to make programming easier.

The following modules are connected in this project:

  • TPH-board rev.4 : A sensor board for measuring Temperature(-40°C~+80°C), Pressure(3001100hPa) and the Humidity(0100%).(TPH)
  • Grove - Air quality sensor v1.3: Measures indoor air quality. Detects carbon monoxide, alcohol, acetone, thinner, formaldehyde and other slightly toxic gasses.
  • Grove - Light Sensor v1.2: Measures the intensity of light. The light sensor value reflects an approximated trend of light intensity.
  • Grove - PIR Motion sensor: Detects motion in a 0.1-6m range with a detection radius of 120 degrees.
  • Grove - Loudness Sensor v0.9b: Measures sounds in the environment(502000Hz, -4866dB). The loudness sensor output reflects an approximated trend of loudness intensity.
  • uBlox SaraN211 NB-IOT module: Used for NB-iot communication.
  • Orange NB-Iot SIM: Allows NB-Iot communication with the Orange Antenna's.

NB-IoT Agent

This agent will run on AWS ECS, Amazon Web Services, Elastic Container Service. It will run the Agent Docker container that reads the packets that were sent by the NB-IoT node module. It will then convert these packets into the different sensors' values and put them all in a json format to send to cumulocity.

Cumulocity platform

Cumulocity is an IOT platform from Software AG. This platform is used to capture, store and visualise the data from this project.

Cumulocity REST api

The cumulocity REST api will receive data from the NB-IoT_agent which it will then store.

Cumulocity Core

The stored data will be used in graphs and other means to visualise data.

🔝

NB-IoT

The internship will make use of an All Things Talk devkit. The existing LoRa devkits of the sag-c8y-lora-demo project project are reused, only the LoRa modem is replaced by an NB-IoT modem. This is the same modem as for the standard NB-IoT devkit. This modem requires an Orange NB-IoT Sim Card.

🔝

Usage Instructions

This wizard will help you configure, build & deploy from start to finish:

  1. Set up the development desktop environment using vagrant
    To build & test the solution, please make use of this development desktop VM. It contains all the development tools and prerequisites.

  2. Set up a new Cumulocity (trial) tenant.
    During the development of this project, a Cumulocity tenant was created for this internship at https://i8c-nb-iot.cumulocity.com. This tenant is a sub-tenant of https://i8c.cumulocity.com. Please replace this URL with the URL of your trial tenant in the configuration files.

  3. Set up, Build & Deploy the NB-Iot Agent
    This agent routes the data produced by the devices to the Cumulocity platform.

  4. Set up, Build & Deploy the NB-IoT node
    The devices run this code to read out the sensors values and send it as measurement data to Cumulocity via the NB-IoT Agent.

  5. Registering a Device on Cumulocity

🔝

Future goals:

🔝