Application Development

Build and deploy custom applications tailored to your business needs.

Syrus 4 Full Architecture

Features:

  • SoC TI ARM Cortex-A8 core processor, AM3358 1GHz.
  • 512MB DDR3 RAM / 4GB 8-bit eMMC Flash storage
  • Micro-SD card slot can support up to 512GB of storage.
  • CAT 4 LTE Modem / Bluetooth BLE 4.2 - SBC +A2DP / WiFi
  • GNSS (GPS, Glonass)
  • Physical interfaces: CAN 1939/RS485/RS232/Ethernet
  • Software packages installed: Python 3.7.6 & Node v12.20.1
  • BLE Version: 4.2

Syrus 4 Lite Architecture

Features:

  • SoC TI ARM Cortex-A8 core processor, AM3358 1GHz.
  • 512MB DDR3 RAM / 4GB 8-bit eMMC Flash storage
  • CAT 4 LTE Modem
  • GNSS (GPS, Glonass)
  • Physical interfaces: CAN 1939/RS485/RS232/USB-A
  • Software packages installed: Python 3.7.6 & Node v12.20.1

Overview

This section provides tools and resources to create, test, and launch applications that streamline your workflows.

You have 2 paths to follow when running an application on Syrus:

  1. Use our SyrusJS application along with the SyrusLang configuration language to leverage signals, events, actions, and other mechanisms to meet your business needs. Click here to go directly to this option.
  2. Develop your own application from scratch in your preferred programming language by integrating all the data that Syrus4 provides to meet your business needs. Click here to go directly to this option.

Examples

Visit the following link to see some examples of custom applications.

Syrus4 Applications Repository

Software

Besides the python and node development packages, you can install software packages using the apx-core tool:

Core packages

These are the software packages that the device comes installed with: https://syrus4.dctserver.com/apex/core-packages.txt

Dev packages

These are the dev packages that can be installed: https://syrus4.dctserver.com/apex/dev-packages.txt

If your application requires software packages outside of these please contact our support team and we'll be glad to assist.

App Manager

Syrus comes with an application manager tool called syrus-apps-manager that allows you to manage applications and run instances of them with different versioning.

To explain how this works we'll start with a breakdown of the important paths on the file directory:

  • /data/app_data - contains application data and configuration files for your application
  • /data/applications - running instances of applications
  • /data/installed - installed applications
  • /data/logs - standard output and error logging for each application instance

Installing the Application

Once you create an application you can install it using the syrus-apps-manager tool.

syrus-apps-manager install mySampleApp 

this creates a folder your application in /data/installed/ followed by the name of the application mySampleApp/ and the version 1.0.0/ (specified in the package.json file). At this point we have installed the application on the device, we have not yet put it to use.

Running the Application

In order to run applications you have to create an instance of them using syrus-apps-manager. Instances are exactly as they sound, independent packaged versions of the application running on the device. To do this we need to specify how we want to call this instance of our application, and what version we want it to run (in case there are multiple versions installed).

syrus-apps-manager create-instance myRunningApp mySampleApp 1.0.0

Internally this will create a symbolic link from the /data/applications folder to the app that was installed under /data/installed

$ ls -l /data/applications

lrwxrwxrwx	1 root	 root	28 	Apr 24 21:24 myRunningApp -> /data/installed/mySampleApp/1.0.0

Output and Error Logs

At this point your application is running and any logging that occurs inside of it can be viewed under /data/logs followed by the name of the instance and the postfix -out.log for standard out, and -error.log for standard error logging.

$ ls -l /data/logs

-rw-r--r--	1 syrus4g  syrus4g		200 Apr 24 19:25 myRunningApp-error.log
-rw-r--r--	1 syrus4g  syrus4g	   1000 Apr 24 20:36 myRunningApp-out.log

User Input/JSON Schema

If your application requires any sort of user input you'll want to add a json schema to the package.json to accomplish this.
The json schema builds a form on the Syrus UI's App Manager section that the user can fill out. Once the user saves the form the contents get stored in a hidden file called .configuration.json under /data/app_data/INSTANCE_NAME

$ ls -la /data/app_data/myRunningApp

drwxr-xr-x	3 syrus4g  syrus4g	4096 Apr 13 19:54 .
drwxr-xr-x	8 syrus4g  syrus4g	4096 Apr 15 20:30 ..
-rw-r--r--	1 syrus4g  syrus4g	  27 Apr 13 19:43 .configuration.json
-rw-r--r--	1 syrus4g  syrus4g	  70 Apr  9 19:21 other_config_file.conf

These fields can therefore be accessed with process.env.APP_DATA_FOLDER/.configuration.json

{
	"token": "ABC1234567890"
}

here's an example snippet using js to get the contents of the .configuration.json file.

const fs = require("fs");
const app_data_folder = process.env.APP_DATA_FOLDER;

let filePath = `${app_data_folder}/.configuration.json`;
let configuration = JSON.parse(fs.readFileSync(filePath).toString());
let TOKEN = configuration.token;

FAQs

Why is my app restarting?

To diagnose why an application is restarting you can look at the /data/core/apex.log . One reasons why it could be happening is that the application is not handling the release of connections to redis correctly.

Apex uses around 45 clients for redis and the limit is 100, this means that if your application is connecting to the redis core and the connections are not being released / closed correctly then it could fail after you reach 100. You will see an error message like this in the logs:

> May 3 14:42:19 syrus-XXX user.crit system-check: redis-core maxclients limit reached, restarting device

Look up redis connection handling on the specific programming language that you're developing with to find more information on how to manage those connections.