-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
49 changed files
with
26,159 additions
and
6,907 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
|
||
# enebular-agent - アクティベーション | ||
|
||
*Read this in other languages: [English](README-enebular-activator.md), [日本語](README-enebular-activator.ja.md)* | ||
|
||
enebular-agentはenebularとのアクティベーションをサポートしています。 | ||
アクティベーションとは、reserve状態になっているライセンスをデバイスと紐づけて有償デバイスにする機能です。 | ||
|
||
## 利用方法 | ||
|
||
アクティベーション用の有効な設定ファイルが保存されている場合にenebular-agentが適切なタイミングでアクティベーションを行います。 | ||
|
||
## 設定方法 | ||
|
||
アクティベーション用の設定ファイルのパスはデフォルトで`.enebular-activation-config.json`となっています。 | ||
この設定は、 `ACTIVATOR_CONFIG_PATH` 環境変数で違うパスに指定することができます。 | ||
|
||
設定ファイルは以下の例のように `enebularBaseURL` と `licenseKey` の値を含む必要があります。 | ||
|
||
``` | ||
{ | ||
"enebularBaseURL": "https://enebular.com/api/v1", | ||
"licenseKey": "<KEY>" | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
|
||
# enebular-agent - Activation | ||
|
||
*Read this in other languages: [English](README-enebular-activator.md), [日本語](README-enebular-activator.ja.md)* | ||
|
||
enebular-agent supports activation with enebular. Activation is the process of associating a device with a 'reserved' license in order to make it a 'paid' device. | ||
|
||
## Usage | ||
|
||
enebular-agent will attempt activation at the appropriate time if a valid activation configuration file exists. | ||
|
||
## Configuration | ||
|
||
The path of the activation configuration file defaults to `.enebular-activation-config.json`, but a different path can be specified with the `ACTIVATOR_CONFIG_PATH` environment variable. | ||
|
||
The configuration file should contain values for `enebularBaseURL` and `licenseKey`, as the example shows below. | ||
|
||
``` | ||
{ | ||
"enebularBaseURL": "https://enebular.com/api/v1", | ||
"licenseKey": "<KEY>" | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,76 @@ | ||
|
||
# enebular agent | ||
# enebular-agent | ||
|
||
*Read this in other languages: [English](README.md), [日本語](README.ja.md)* | ||
|
||
enebular-agentは、Linuxデバイス用のNode.jsベースのIoTエージェントソフトウェアです。 eneublar-agentはenebularと連携して、Node-REDのフローをIoTデバイスにデプロイして実行することができます。また、IoTデバイスの状態をenebularに通知します。 | ||
enebular-agentは、Linux OSを搭載したゲートウェイ向けのenebular用IoTエージェントソフトウェアです。 eneublar-agentはenebularと連携して、Node-REDのフローをIoTデバイスにデプロイして実行することができます。また、IoTデバイスの状態をenebularに通知します。 | ||
|
||
enebular-agentには次の主要機能があります。 | ||
|
||
- IoTデバイス(エージェント)の登録と認証 | ||
- Node-REDインスタンスの管理とenebularから送られたフローのデプロイと実行 | ||
- IoTデバイス(エージェント)のアクティベーションと登録、認証 | ||
- Node-REDインスタンスの管理とenebularからデプロイされたフローの実行 | ||
- enebularへのステータス通知およびログ送信 | ||
|
||
enebularは、サードパーティのIoTプラットフォーム接続を介してenebular-agentと通信します。 サポートされているIoTプラットフォームの接続タイプは次のとおりです。 | ||
enebularは、サードパーティのIoTプラットフォーム接続を介してenebular-agentと通信します。 | ||
|
||
- AWS IoT | ||
## 機能 | ||
|
||
### アクティベーションと登録、認証 | ||
|
||
enebular-agentがenebularと通信するには、認証のための登録情報を取得する必要があります。この登録情報の取得には2つの方法が用意されています。 | ||
|
||
- enebularがIoTプラットフォーム接続経由で登録情報を自動的にenebular-agentに送信する | ||
- enebular-agentがenebularに「アクティベーション」を直接に要求した時のレスポンスとして受信する | ||
|
||
基本的に前者で登録情報を取得します。また、後者のアクティベーションについては[activationのreadmeファイル](README-activation.ja.md)に更なる詳細情報が記載されています。 | ||
|
||
ロギングやステータス通知のようにデバイスの有償デバイス化が必要となっている機能の利用をenebular-agentに許可を与えるために、enebularはenebular-agentの認証情報を必要に応じて更新します。 | ||
|
||
|
||
### Node-REDのフロー | ||
|
||
enebular-agentはenebularからデプロイされたフローをNode-REDで実行します。また、フローにnpmで公開されているノードが使用されている場合、そのノードを自動的にインストールします。 | ||
|
||
### ロギング | ||
|
||
enebular-agentは、定期的にenebularにログメッセージを送信します。また、標準出力ストリーム(コマンドラインのコンソールなど)にもロギングできますが、デフォルトでは有効になっていません。ロギングするには、`DEBUG`環境変数を設定します。 | ||
|
||
enebular-agentは、Node-REDが標準出力と標準エラー出力(stdoutとstderr)に出力するメッセージをキャプチャしてロギングします。Node-REDが出力するメッセージは全てinfoレベルでロギングされます。また、実行中のフローに含まれているノードからのメッセージもロギングします(debugノードで"debug tab and console"の設定がされている場合など)。 | ||
|
||
ログをenebularで確認するには、対象デバイスが有償デバイスになっている必要があります。 | ||
|
||
### ステータス通知 | ||
|
||
enebular-agentは有償デバイスの場合に簡易なステータス情報をenebularに送信します。 | ||
|
||
## 構成 | ||
|
||
enebular-agentは、Node.jsモジュールの集合として実装されています。enebular-agentのコアランタイム機能は`enebular-runtime-agent`モジュールとして(`agent`ディレクトリの下で)実装されています。この上に、サポートされているIoTプラットフォームの接続タイプごとにモジュールが(`ports`ディレクトリの下に)あります。 各ポートがenebular-runtime-agentコアのモジュールを依存モジュールとして含んでいます。 | ||
|
||
Node-REDもNode.jsのモジュールとしてインストールされます。 | ||
|
||
## インストール方法 | ||
|
||
enebular-agentを実行するには、利用するIoTプラットフォームのポート(※)に必要となっているNode.jsモジュールをインストールし、IoTプラットフォームの接続情報を正しく設定する必要があります。 | ||
|
||
必要なモジュールと接続情報は、各IoTプラットフォームのポートによって異なります。enebular-agentの設定と実行の詳細については、各ポートのreadmeファイルを参照してください。 | ||
|
||
- [ポート](ports) | ||
|
||
(※) ここでのポートとは、enebular-agentをAWS IoTやMbed Cloudなどの外部サービスと連携するために個別に準備されたenebular-agentのエディションのことを指します。 | ||
|
||
## 設定方法 | ||
|
||
enebular-runtime-agentコアは、IoTプラットフォーム共通の設定オプションをいくつかサポートしています。例として以下のオプションがあります。 | ||
enebular-agentは、環境変数で設定できるIoTプラットフォーム共通の設定オプションをいくつかサポートしています。例として以下のオプションがあります。 | ||
|
||
- ログレベル | ||
- コンソールへのログ出力のオン/オフ | ||
- enebularログ用のキャッシュのサイズや場所など | ||
- Node-REDインスタンスの場所(path)と実行コマンド | ||
- `DEBUG` - 指定したログレベル(`debug`や`info`)でコンソールにロギングします。なお、`debug`に設定すればデバッグメッセージがenebularに送信されます | ||
|
||
enebular-runtime-agentコアの設定オプションは、enebular-runtime-agentコアがポートによって実行される時に設定されます。 設定方法の詳細には、各ポートを参照してください。 | ||
- `NODE_RED_DIR` - インストール済みのNode-REDのパス | ||
|
||
## 利用方法 | ||
- `NODE_RED_DATA_DIR` - Node-REDのワーキングディレクトリ(userDir)のパス | ||
|
||
enebular-agentを実行するには、必要なNode.jsモジュールをnpmなどでインストールし、IoTプラットフォームの接続情報を正しく設定する必要があります。必要なモジュールと接続情報は、各IoTプラットフォームによって異なります。 | ||
- `NODE_RED_COMMAND` - Node-REDを実行するためのコマンド | ||
|
||
enebular-agentの設定と実行の詳細については、各ポートのreadmeファイルを参照してください。 | ||
- `ENEBULAR_CONFIG_PATH` - enebular-agentの設定ファイルのパス | ||
|
||
- [AWS IoT](ports/awsiot/README.ja.md) | ||
さらに、各ポートにはそれぞれの専用設定オプションがあります。詳細については、各ポートのreadmeファイルを参照してください。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,73 @@ | ||
|
||
# enebular agent | ||
# enebular-agent | ||
|
||
*Read this in other languages: [English](README.md), [日本語](README.ja.md)* | ||
|
||
enebular-agent is Node.js based IoT agent software for Linux devices. enebular-agent works together with enebular to allow Node-RED flows to be deployed to and executed on the IoT device, and for the status of the IoT device to be reported back to enebular. | ||
enebular-agent is Node.js based enebular IoT agent software for Linux gateways. enebular-agent works together with enebular to allow Node-RED flows to be deployed to and executed on the IoT device, and for the status of the IoT device to be reported back to enebular. | ||
|
||
enebular-agent has the following key functionality. | ||
|
||
- IoT device (agent) registration and authentication. | ||
- IoT device (agent) activation, registration and authentication. | ||
- Management of a Node-RED instance, and deployment and execution of flows sent from enebular to that. | ||
- Status and log reporting to enebular. | ||
|
||
enebular communicates with enebular-agent via a third-party IoT platform connection. The supported IoT platform connection types are as follows. | ||
enebular communicates with enebular-agent via a third-party IoT platform connection. | ||
|
||
- AWS IoT | ||
## Features | ||
|
||
### Activation, Registration and Authentication | ||
|
||
To communicate with enebular, enebular-agent needs to receive its required device 'registration' information. This can occur in one of two supported ways. | ||
|
||
- enebular automatically sends it to enebular-agent via the IoT platform connection | ||
- enebular-agent receives it in response to it directly requesting 'activation' with enebular. | ||
|
||
In most cases the first method is used. For more information on using activation, see the [activation readme](README-activation.md). | ||
|
||
enebular will also automatically update the enebular-agent's authentication information when required to allow it to use 'paid' device features (i.e logging and status reporting). | ||
|
||
### Node-RED Flows | ||
|
||
enebular-agent accepts flows deployed from enebular and manages a Node-RED instance to run them. It will also automatically install any published node modules that are depended on by the flow being deployed. | ||
|
||
### Logging | ||
|
||
enebular-agent will periodically send logged messages to enebular (when it has been made a 'paid' device). It can also log to its own standard output streams (command-line console), but this is not enabled by default. To have it also log to the console, set the `DEBUG` environment variable. | ||
|
||
Along with its own logging, enebular-agent captures and re-logs any messages that Node-RED logs to its standard output streams (stdout and stderr). This includes any messages from nodes in the flow being run which log to the console, like when the debug node is configured to log to the "debug tab and console". All messages captured from Node-RED are currently re-logged at the 'info' log level. | ||
|
||
### Status Reporting | ||
|
||
enebular-agent provides simple reporting on its status to enebular (when it has been made a 'paid' device). | ||
|
||
## Structure | ||
|
||
enebular-agent is implemented as a collection of Node.js modules. The agent's core runtime functionality is implemented as the `enebular-runtime-agent` module (under the `agent` directory). On top of this, there is a module for each of the supported IoT platform connection types (under the `ports` directory). Each of the ports includes the enebular-runtime-agent core module as a dependency. | ||
enebular-agent is implemented as a collection of Node.js modules. Its core runtime functionality is implemented as the `enebular-runtime-agent` module (under the `agent` directory). On top of this, there is a module for each of the supported IoT platform connection types (under the `ports` directory). Each of the ports includes the enebular-runtime-agent core module as a dependency. | ||
|
||
Node-RED is also installed as a Node.js module. | ||
|
||
## Installation | ||
|
||
To run enebular-agent you need to install the Node.js modules required by the IoT platform port [1] you want to use and also correctly configure the IoT platform's connection details. | ||
|
||
The required modules and connection configuration differs for each IoT platform port. Please see the readme files of each port for details on how to set up and run the enebular-agent. | ||
|
||
- [Ports](ports) | ||
|
||
[1]: Here a 'port' refers to the individual enebular-agent editions created to allow it to work with external services such as AWS IoT and Mbed Cloud. | ||
|
||
## Configuration | ||
|
||
The enebular-runtime-agent core supports a number of configuration options that are available no matter what IoT platform port is used. This includes the following. | ||
enebular-agent supports a number of configuration options set via environment variables that are available no matter what IoT platform port is used. This includes the following. | ||
|
||
- Logging level | ||
- Logging to console on/off | ||
- enebular log cache size and location etc | ||
- Node-RED instance location (path) and run command | ||
- `DEBUG` - Have enebular-agent log to the console at the specified log level (i.e. `debug` or `info` etc). Note that if set to `debug` then debug messages will also be sent to enebular (when enebular-agent is authenticated). | ||
|
||
The enebular-runtime-agent core's configuration options are set by the port when it is instantiated. See each port for details on how the configuration is set. | ||
- `NODE_RED_DIR` - The path of the installed Node-RED instance. | ||
|
||
## Usage | ||
- `NODE_RED_DATA_DIR` - The path to use as Node-RED's working data (userDir) directory. | ||
|
||
To run enebular-agent you need to install the required Node.js modules (with npm etc) and correctly configure the required IoT platform connection details. The required modules and connection configuration differs for each IoT platform. | ||
- `NODE_RED_COMMAND` - The command to use to start Node-RED. | ||
|
||
Please see the readme files of each port for details on how to set up and run the enebular-agent. | ||
- `ENEBULAR_CONFIG_PATH` - The path of the enebular-agent's main configuration file. | ||
|
||
- [AWS IoT](ports/awsiot/README.md) | ||
Each of the ports have additional configuration options. Please see the readme files of each port for details. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/lib | ||
/node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"extends": [ | ||
"standard", | ||
"plugin:flowtype/recommended", | ||
"prettier", | ||
"prettier/flowtype", | ||
"prettier/standard" | ||
], | ||
"plugins": ["flowtype", "prettier", "standard"], | ||
"parserOptions": { | ||
"sourceType": "module" | ||
}, | ||
"env": { | ||
"es6": true, | ||
"node": true | ||
}, | ||
"rules": { | ||
"prettier/prettier": "error" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"printWidth": 80, | ||
"tabWidth": 2, | ||
"parser": "flow", | ||
"trailingComma": "none", | ||
"semi": false, | ||
"singleQuote": true | ||
} |
Oops, something went wrong.