Deployment on Nano Devices
This section describes how to deploy the Agent on Nano devices, which are edge devices with limited resources and edge computing capabilities. For such edge devices, you can deploy the Nano Agent, which is a lightweight version of the Gateway Agent.
Architecture
Just like the Gateway Agent, the Nano Agent has a modular architecture. There is a number of available components, which can be installed, depending on individual needs. See here for an overview of available components.
Depending on a specific use case, you can install the Nano Agent in various architecture variants. All of them include the relayr Cloud Adapter or the Azure Cloud Adapter for the cloud connection and Protocol Adapters for data acquisition. If remote configuration and software updates are required, you also need to install the Task Executor.
Optionally, you can also install other components.
Requirements
The Nano Agent platform requirements depend on how the software is configured.
The more measurements and alerts are configured for Protocol Adapters, the more memory and computing capabilities are required by the Nano Agent.
If the Rule Engine and/or the Task Executor are installed, the Nano Agent requirements depend on a type and complexity of included Lua scripts.
The table below presents minimum platform requirements that must be met to run the Nano Agent.
Name | Requirement |
---|---|
CPU | 1 core, 200 MHz |
Memory | 64 megabytes (MB) or more |
Disc | 32 MB or more available storage |
OS | POSIX Linux, with kernel 2.6.28 or newer. Recommended: Debian Buster |
Libraries | cURL, paho, lua, libssl, libsqlite, libevent, rapidjson, spdlog |
Reference Platform | ARIETTA-G25-V (ARM9@400Mhz, 128MB DDR2, MicroSD flash drive 2GB) Retail Price: 25 EUR |
When data persistence is enabled, the minimum storage is 128 MB.
For a list of supported Linux distributions, see here.
Installation
It is recommended to use the Nano Agent using the Bash installer. It provides a more lightweight way to install the Agent, compared with the Gateway Agent Python installer.
The Nano Agent installer requires providing a user and password to the Nano Agent package repository. For access credentials, contact the relayr Support team.
To install the Nano Agent, follow these steps:
- Download the installation script:
wget https://gwa.relayr.io/public/tools/gwa-nano-installer/gwa-installer.sh
- Run the script:
bash gwa-installer.sh
Nano Agent installation script
************************************************
* relayr Nano Agent Installer [2.1]
*
* Copyright (c) 2020 Relayr, Inc.
* All Rights Reserved
************************************************
Please choose which action you would like to perform:
1) Install Nano Agent
2) Remove Nano Agent and all its components
3) Exit
select action:
- Type 1 and press Enter. The script detects your operating system and installs the prerequisites:
Detected Operating System: ubuntu 18.10.
Installing prerequisites..
Reading package lists... Done
Building dependency tree
Reading state information... Done
sudo is already the newest version (1.8.23-2ubuntu1).
- When prompted, provide access credentials to the relayr package repository. For access credentials, contact the relayr Support team.
Access to the relayr Nano Agent repository is restricted.
Contact relayr Support Team for access credentials.
Login:
- Select components to be installed. Type the component number and press Enter.
The selected components are marked with the + sign. To deselect a component, type its number again.
Menu Options
[+] 1) relayr Cloud Adapter
[ ] 2) Azure Cloud Adapter
[ ] 3) Modbus Protocol Adapter
[ ] 4) Step7 Protocol Adapter
[ ] 5) OSIsoft Protocol Adapter
[+] 6) OPC-UA Protocol Adapter
[ ] 7) Ethernet/IP Protocol Adapter
[ ] 8) BACnet Protocol Adapter
[ ] 9) Canbus Protocol Adapter
[ ] 10) Pico Agent CoAP Protocol Adapter
[ ] 11) Configuration Manager
[ ] 12) Rule Engine
[ ] 13) Task Executor
[ ] 14) Generic Protocol Adapter
[ ] 15) Storage Service
[ ] 16) EtherCAT Protocol Adapter
[ ] 17) GWA Analytics
Select the desired options using their number (again to uncheck, ENTER when done):
The GWA Analytics component is available for Debian Buster and only. If you have any other supported Linux distribution, this component is not displayed on the installer's list.
- Press Enter to start the installation process.
The selected Nano Agent components are now successfully installed.
Configuration and Usage
This section provides information only on those aspects of the Nano Agent configuration and usage that are different from the standard Gateway Agent deployment.
For general configuration options, refer to the component-specific sections.
MQTT Access Credentials
MQTT credentials authorize access to a device or a device group created in the relayr Cloud. MQTT credentials are configured in the relayr Cloud Adapter.
Unlike the Gateway Agent Python installer, the Nano Agent installation script does not have an option to configure the credentials. If you have the Configuration Manager installed, you can use its interface to configure your MQTT credentials automatically. If not, you can do it manually.
To configure your MQTT credentials manually, follow these steps:
Log in to the relayr Cloud and get your MQTT credentials. For details, refer to the relayr Cloud API documentation.
In the relayr Cloud Adapter application configuration file, enter the obtained credentials in the
username
andpassword
fields in thecloud_connection
section. See here for more information.
The Nano Agent is now able to exchange information about a given device or device group with the relayr Cloud.
Data Buffering and Compression
The relayr Cloud Adapter provides an advanced data buffering and compression mechanism to manage the amount of data sent to the relayr Cloud. This mechanism offers numerous data buffering scenarios, but not all of them are available for Nano devices, because of their limited computing capabilities.
To use data buffering and compression on Nano devices, set the
data_buffering
andin_memory_database
options totrue
in the relayr Cloud Adapter configuration file. Besides, set the maximum database size (max_db_size
). This setting guarantees that the buffered data will not use the entire RAM memory of a device.
See here for the relayr Cloud Adapter configuration options.
Global MQTT Prefix for Protocol Adapters
In the Nano Agent, all data obtained from devices is reported directly to the Agent's northbound interface. To ensure that, all Protocol Adapters must have the Global MQTT Prefix (custom_prefix
) configured.
When configuring Protocol Adapters, set the
"custom_prefix"
to"v1/nb"
.
For more information, see the Configuring Custom Prefix documentation section of the Protocol Adapter you are using.
Task Executor on Nano Devices
While processing tasks, e.g. remote configuration and software updates, the Task Executor uses a database to store task updates.
On Nano devices, it is recommended to use the in-memory database mode. Otherwise, each task is saved on the SD card (or some other device's storage), which may have a negative impact on the data carrier's lifetime.
To store tasks in RAM, set
":memory:"
in thedatabase.path
section of the Task Executor's configuration:
"path": ":memory:",
See here for more information on the Task Executor's configuration options.