amnimo G Series Developer's Manual

amnimo G Series Developer's Manual

Hide thumbs Also See for G Series:
Table of Contents

Advertisement

Quick Links

Developer's manual
for amnimo G series
IM AMD03A01-51EN 6th edition

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the G Series and is the answer not in the manual?

Questions and answers

Summary of Contents for amnimo G Series

  • Page 1 Developer's manual for amnimo G series IM AMD03A01-51EN 6th edition...
  • Page 2: Licenses And Trademarks

    Warranty coverage and responsibilities  In this product, amnimo does not offer any warranties for the operation of the open source software itself under the terms of the GPL, etc. Trademarks Proper nouns including product or company names, etc. mentioned in this manual are the ...
  • Page 3: Introduction

    Introduction Thank you for choosing our Edge Gateway amnimo G series (hereinafter referred to as "Edge Gateway"). The amnimo Developer's Manual (hereinafter referred to as "this manual") provides information for "developers" who create applications that run on Edge Gateway. This manual assumes that you are familiar with the information in the "User's Manual (IM AMD03A01-01EN)".
  • Page 4 Icons and Symbols Used in This Manual The icons and symbols in this manual have the following meanings: Provides information about features and operations that should be paid special attention. Provides additional information about features and operations. Provides reference information in this manual or other documents. ...
  • Page 5: Safety And Modification Precautions

    For the protection and safety of yourself and Edge Gateway or systems that include Edge  Gateway, follow the safety instructions in this manual when handling Edge Gateway. If you do not follow these instructions, amnimo cannot guarantee safety. Modification to Edge Gateway without permission is strictly prohibited. ...
  • Page 6: Table Of Contents

    Table of Contents Licenses and Trademarks ......................2 Introduction ............................. 3 About This Manual .......................... 3 List of Manuals ..........................3 Safety and Modification Precautions ................... 5 Table of Contents ..........................6 Development Environment for Edge Gateway ............8 Overview ..........................8 Hardware specifications for Edge Gateway ............
  • Page 7 Installing/uninstalling packages ..............37 Linking the Digital Input (D IN) with Nx Witness ............38 Setting of amnimo-dimoni ................38 Setting Events of Nx Witness ................40 Troubleshooting ......................42 Utilizing Edge Gateway Setting Functions ..............42 Default configuration file ................... 42 Backing up the configuration file ..............
  • Page 8: Development Environment For Edge Gateway

    Development Environment for Edge Gateway This chapter explains the development environment for Edge Gateway. Overview Edge Gateway has an ARMv8 64-bit CPU. To develop applications that run on Edge Gateway, you must build a native development environment to build and execute programs on Edge Gateway. If you need to build programs for this CPU's architecture on your host PC, you must build a cross development environment.
  • Page 9: Software Specifications For Edge Gateway

    IPsec/remote.it VPN Clock synchronization NTP/GPS Security Packet filters Operational management Setting method amsh Dedicated command line interface (CLI) for amnimo Gateway Firmware update apt (incremental update) / amfirm (full update) Log management syslog Device management amnimo DMS Development tool chain ...
  • Page 10: Setup Preparation

    Setup Preparation This section explains what needs to be prepared before you build your Edge Gateway development environment. Hardware configuration The hardware configuration for building an Edge Gateway development environment is shown as follows. ❹ ❻ ❺ Serial console eth0 lan0-3 Internet ❷...
  • Page 11: Setting Up Edge Gateway

    Asia/Tokyo This is the factory default setting. Display a setting list on the amsh configuration mode to check the setting details. gateway amnimo(cfg)# show config  # ---- transition to configure mode ---- configure # ---- hostname configure ---- hostname amnimo...
  • Page 12 exit # ---- interface lan1 configure ---- interface lan1 enable pmtu auto mtu 1500 mode 100baseT-Auto proxy-arp no optional exit # ---- interface lan2 configure ---- interface lan2 enable pmtu auto mtu 1500 mode 100baseT-Auto proxy-arp no optional exit # ---- interface lan3 configure ---- interface lan3 enable pmtu auto...
  • Page 13 exit # ---- rule 120 ---- filter forward 120 enable policy drop match protocol tcp dst-port 137 exit # ---- rule 130 ---- filter forward 130 enable policy drop match protocol tcp src-port 137 exit # ---- rule 140 ---- filter forward 140 enable policy drop...
  • Page 14 tnc control exit # ---- ntp configure ---- no enable exit # ---- ssh configure ---- no enable exit # ---- syslog local configure ---- syslog local enable rotate-size 10240 rotate-count 8 level informational exit # ---- syslog remote configure ---- syslog remote no enable server-port 514...
  • Page 15 mode high temperature 100.0 hysteresis 10.0 log detection warnings log restoration notifications state 200MHZ exit # ---- thermal cpufreq low configure ---- thermal cpufreq low enable mode low temperature -10.0 hysteresis 5.0 log detection warnings log restoration notifications state 1000MHZ exit # ---- thermal mobile high configure ---- thermal mobile high...
  • Page 16: Preparing Your Pc Environment

    Preparing your PC environment For your PC's OS, install the same Ubuntu 18.04 LTS version as Edge Gateway. Download URL: https://releases.ubuntu.com/18.04/ If you are developing in a Windows environment, it is recommended that you build a virtual environment such as by using Virtual Box or VMware virtualization software before developing (explanation in this manual shall be omitted).
  • Page 17: Creating A Cross Development Environment

    Creating a Cross Development Environment This section explains how to develop applications for Edge Gateway in a cross development environment. Preparing your PC environment ▌ Installing the apt package Update and upgrade the apt package list on the PC side's Ubuntu environment to install the following apt packages.
  • Page 18: Executing A Cross Build

    Makefile CC = aarch64-linux-gnu-gcc CFLAGS = -O3 -Wall DESTDIR = /usr/bin LIBS = OBJS = main.o PROG = amnimo-sample-app all: $(PROG) $(PROG): $(OBJS) $(CC) $(OBJS) $(LIBS) -o $(PROG) clean: rm -f *.o $(PROG) install: $(PROG) sudo install -s $(PROG) $(DESTDIR) The directory structure and file placement are shown as follows.
  • Page 19 ▌ Checking the executable file type for the build result host ~/sample$ file amnimo-sample-app  amnimo-sample-app: ELF 64-bit LSB shared object, ARM aarch64, version 1 (SYSV), dynamic ally linked, interpreter /lib/ld-linux-aarch64.so.1, for GNU/Linux 3.7.0, BuildID[sha1] =1e9a9503efe79366a8c4f51bba5d20cc65f9a7fe, not stripped ▌ Transferring the executable file Send the generated executable file amnimo-sample-app to Edge Gateway via scp.
  • Page 20: Native Development Environment

    Log in to Edge Gateway, update and upgrade the apt package list in the Ubuntu environment of the Edge Gateway to install the following apt packages. Before proceeding, check "4.5 Update of Edge Gateway apt Package Repository" in the "Edge Gateway amnimo G series User's Manual". gateway $ sudo apt update ...
  • Page 21: Executing A Native Build

    ▌ Checking the tool chain version Check the tool chain version. gateway admin@amnimo:~$ gcc --version  gcc (Ubuntu/Linaro 7.5.0-3ubuntu1~18.04) 7.5.0 Copyright (C) 2017 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty;...
  • Page 22 ▌ Checking the executable file type for the build result gateway $ file amnimo-sample-app  amnimo-sample-app: ELF 64-bit LSB shared object, ARM aarch64, version 1 (SYSV), dynamic ally linked, interpreter /lib/ld-linux-aarch64.so.1, for GNU/Linux 3.7.0, BuildID[sha1] =1436db4cc909f72d8565e5f8d14a2b4be47c0515, not stripped ▌ Executing the executable file Log in to Edge Gateway and execute the executable file.
  • Page 23: Building An Environment For A Distributed Build

    Building an environment for a distributed build In a native development environment, the CPU processing capacity of Edge Gateway underperforms that of a general-purpose PC. Therefore, it takes longer than the build time of a cross development environment. This difference becomes prominent as the program scale increases. The following subsection explains how to speed up the build process of a native development environment by building a distributed build environment using distcc.
  • Page 24: Preparing Edge Gateway

    As on the host side, install distcc/ccache, edit the configuration file, and restart the daemon. However, only STARTDISTCC is to be modified in the configuration file. ▌ Installing the distcc/ccache package gateway admin@amnimo:~$ sudo apt install distcc ccache  ▌ Modifying configuration files of distcc Edit the part after /etc/default/distcc. gateway # Defaults for distcc initscript # sourced by /etc/init.d/distcc...
  • Page 25: Executing A Distributed Build

    This subsection provides an explanation assuming a build environment in which the Makefile is available. You can specify the number of parallel processing by specifying values after -j. gateway admin@amnimo:~$ make -j8  ▌ Checking the status of the distributed build You can check the operation status of distcc by using the following command.
  • Page 26: Firmware For Edge Gateway

    *3 SSD is optional. In addition, users can select the mount point or the file system. The description above is an example. For information on how to enable SSDs, refer to "Chapter 6 Storage Operations" in the "Edge Gateway amnimo G series...
  • Page 27: Creating A Firmware Image For Edge Gateway

     It is recommended that you reduce the size of the redundant area before executing the command. Example The following is an example to generate a firmware image that includes the rootfs and userfs in the currently running area. gateway admin@amnimo:~$ sudo amfwgen snapshot --target=fore --partition=rootfs,userfs /home/adm in/firmware.amf...
  • Page 28: Edge Gateway Utilization

    Edge gateway has a mechanism to hook users' own processing in certain cases. The script files located under the following directory will be executed. ▌ Hook processing list Function Directory Execution condition /etc/amnimo/if-up.d Interface link up Ethernet /etc/amnimo/if-down.d Interface link down interface Occurrence of a thermal error /etc/poe/hook/temp-alert-occur.d...
  • Page 29: Service Management Using Systemd

    This section explains how to create a unit file of systemd when you use the sample program amnimo-sample-app in "1.3.2" as a service. Creating a unit file...
  • Page 30: Control And Management Of The Service State

    Service unit startup and status check When you start the service unit, execute the command as follows. gateway admin@amnimo:~$ sudo systemctl start amnimo-sample-app  You can check if the service unit has started successfully in the following way. gateway admin@amnimo:~$ sudo systemctl status amnimo-sample-app ...
  • Page 31: Creating A Package

     admin@amnimo:~$ sudo apt upgrade  admin@amnimo:~$ sudo apt install devscripts cdbs debhelper dh-make  ▌ Source code for the sample application For the sample program, use the sample code in "1.3.2". For the unit file for the service, use the unit file created in "3.2.1".
  • Page 32 -f *.o $(PROG) install: $(PROG) install -D -s $(PROG) $(DESTDIR)/usr/sbin/$(PROG) install -D -m 644 $(UNITFILE) $(DESTDIR)/lib/systemd/system/$(UNITFILE) amnimo-sample-app.service [Unit] Description= amnimo sample application After=syslog.target [Service] Type=simple ExecStart=/usr/sbin/amnimo-sample-app [Install] WantedBy=multi-user.target The directory structure and file placement are shown as follows.
  • Page 33: Creating A Package

    Creating a package ▌ Creating a package template Use dh_make to create a package template in the sample application directory. gateway admin@amnimo:~$ cd sample  admin@amnimo:~/sample$ dh_make --native --single --email support@amnimo.com --packagena me amnimo-sample-app_1.0.0  Maintainer Name: unknown Email-Address : support@amnimo.com Date...
  • Page 34 When you create a package template, the following files in blue are output. gateway admin@amnimo:~/sample$ tree  ├── amnimo-sample-app.service ├── debian │ ├── amnimo-sample-app.cron.d.ex │ ├── amnimo-sample-app.doc-base.EX │ ├── amnimo-sample-app-docs.docs │ ├── changelog │ ├── compat │ ├── control │...
  • Page 35 By executing dh_make, you have created the files necessary to create the package. Next, create the package with debuild. gateway admin@amnimo:~/sample$ debuild -us -uc -ui  When you execute this, the following files in blue are output. The files related to the package are output one level higher in the execution directory.
  • Page 36 ▌ Checking the contents in the created package Check the contents in the created deb package archive. gateway admin@amnimo:~$ dpkg -c amnimo-sample-app_1.0.0_arm64.deb  drwxr-xr-x root/root 0 2020-01-02 00:53 ./ drwxr-xr-x root/root 0 2020-01-02 00:53 ./lib/ drwxr-xr-x root/root 0 2020-01-02 00:53 ./lib/systemd/...
  • Page 37: Installing/Uninstalling Packages

    ▌ Installing packages Specify the package file name. The following is an example of installing the package under /home/admin. gateway admin@amnimo:~$ sudo apt install /home/admin/amnimo-sample-app_1.0.0_arm64.deb  ▌ Checking the installed packages Specify the package name. gateway admin@amnimo:~$ apt list amnimo-sample-app ...
  • Page 38: Linking The Digital Input (D In) With Nx Witness

    Linking the Digital Input (D IN) with Nx Witness Edge Gateway has been preinstalled with amnimo-dimoni, an application that monitors changes in the digital input (D IN) terminals on the rear of the device and notifies Nx Witness of them as events.
  • Page 39 ▌ Disabling the linkage settings amnimo-dimoni is automatically started when starting the system. If you disable Nx Witness, you will need to delete the password set for NX_PASSWOARD and restart the amnimo-dimoni service as shown below. gateway admin@amnimo:~$ sudo vi /etc/amnimo/dimoni.conf ...
  • Page 40: Setting Events Of Nx Witness

    Setting Events of Nx Witness You can specify actions such as displaying texts on the LIVE video screen, assigning bookmarks to recorded videos, and sending messages when changing the digital input (D IN). ▌ Operating the Nx Witness Client application Start the Nx Witness Client application from your PC, and set the event.
  • Page 41  If you specify a port number other than 7001 for Nx Witness, change the port settings as well. gateway amnimo(cfg)# nxwitness  amnimo(cfg-nxwitness)# password  Enter new password: Retype new password: passwd: password updated successfully. amnimo(cfg-nxwitness)# port 7001  amnimo(cfg-nxwitness)# exit  amnimo(cfg)# config nxwitness save  amnimo(cfg)# config file save startup-config ...
  • Page 42: Troubleshooting

    89 Aug 7 10:57 startup-config.sha256 Backing up the configuration file Save the backup file using the function that renames the configuration file. Refer to "5.6 Changing the Name of a Configuration File" in the "Edge Gateway amnimo G series  User’s Manual" for details.
  • Page 43: Managing Generations Of Configuration Files

    "pattern-B-config", and "pattern-C-config". Finally, display a list of the configuration files. gateway After completing the various settings, execute the following amnimo# config file save pattern-A-config  After completing some settings, execute the following amnimo# config file save pattern-B-config ...
  • Page 44: Reflecting The Configuration File

    ← Save the loaded settings as startup-config and reflect it admin@amnimo:~$ sudo amcfg save  as the settings for the next startup startup-config file already exists. Do you want to overwrite? (y/N): y ← Execute a software reboot admin@amnimo:~$ sudo amctrl reboot -t soft ...
  • Page 45: Troubleshooting For Cases Of Startup Failure

    Enter ] key Return to boot status(0x55) for login ← It is reset by Watchdog IC after a few minutes. If the o Amnimo>> run stopwdt  peration takes time, execute the stop process. Amnimo>>  For the initial password, please contact our Customer Support.
  • Page 46 ← Area 0 Boot Area : 0 (1st Area) Boot Count : 385 ← Change the startup area to area 1 Amnimo>> ambootsw set 1  ← Check the startup area again Amnimo>> ambootsw get  ← Area 1 Boot Area : 1 (2nd Area)
  • Page 47: Step 2. Check The Startup Area After Starting Linux

    You can check the startup area after you start Linux. After performing a restart, make sure that it is the startup area that you have set on the U-Boot side. Refer to "4.4.6 Configuring a redundant area to boot" in the "Edge Gateway amnimo G series ...
  • Page 48: Step 3. Synchronizing The Firmware

    Now that you have confirmed successful startup on the Area 1 side of the startup area, synchronize the firmware contents of the Area 1 side to the Area 0 side so that the Area 0 side starts successfully. Refer to "4.4.5 Synchronizing redundant areas of firmware" in the "Edge Gateway amnimo G ...
  • Page 49: Revision History

    Revision history edition Issued in November 2020 edition Issued in December 2020 edition Issued in March 2021 edition Issued in August 2021 edition Issued in January 2022 edition Issued in May 2022...
  • Page 50 Edge Gateway amnimo G series Developerʼs Manual edition, May 6, 2022 IM AMD03A01-51EN All Rights Reserved. Copyright © 2020, amnimo Inc...

This manual is also suitable for:

Ag10Ag20

Table of Contents