Difference between revisions of "WISE-PaaS/EdgeSense"
Daniel.hung (talk | contribs) (Created page with "For RISC products, we adopt '''''lightweight '''''EdgeSense features. In this chapter, we introduce the basic concepts for these components. == <font color="#0070c0">Clo...") |
Daniel.hung (talk | contribs) |
||
(3 intermediate revisions by the same user not shown) | |||
Line 9: | Line 9: | ||
== <font color="#0070c0">Edge Intelligent Suite</font> == | == <font color="#0070c0">Edge Intelligent Suite</font> == | ||
− | === <font color="#0070c0"> | + | === <font color="#0070c0">Node-RED</font> === |
+ | |||
+ | [https://nodered.org/ Node-RED] is a programming tool for wiring together hardware devices, APIs and online services in new and interesting ways. | ||
+ | |||
+ | It provides a browser-based editor that makes it easy to wire together flows using the wide range of nodes in the palette that can be deployed to its runtime in a single-click. | ||
+ | |||
+ | To start up Node-RED server on your device, please | ||
+ | |||
+ | 1. Check your IP address on device first, e.g. <code>ifconfig</code> | ||
+ | |||
+ | 2. Execute <code>node-red</code> to start server. | ||
+ | |||
+ | $ '''node-red''' | ||
+ | |||
+ | 24 Nov 07:28:47 - [info] | ||
+ | |||
+ | Welcome to Node-RED | ||
+ | |||
+ | ====== ======= ====== | ||
+ | |||
+ | 24 Nov 07:28:47 - [info] Node-RED version: v0.16.2 | ||
+ | 24 Nov 07:28:47 - [info] Node.js version: v6.10.3 | ||
+ | 24 Nov 07:28:47 - [info] Linux 4.4.38-4760LIV1121 arm64 LE | ||
+ | 24 Nov 07:28:49 - [info] Loading palette nodes | ||
+ | 24 Nov 07:28:53 - [warn] ------------------------------------------------------ | ||
+ | 24 Nov 07:28:53 - [warn] [rpi-gpio] Info : Ignoring Raspberry Pi specific node | ||
+ | 24 Nov 07:28:53 - [warn] ------------------------------------------------------ | ||
+ | 24 Nov 07:28:53 - [info] Settings file : /home/root/.node-red/settings.js | ||
+ | 24 Nov 07:28:53 - [info] User directory : /home/root/.node-red | ||
+ | 24 Nov 07:28:53 - [info] Flows file : /home/root/.node-red/flows_rsb-4760.json | ||
+ | 24 Nov 07:28:53 - [info] Creating new flow file | ||
+ | 24 Nov 07:28:53 - [info] Starting flows | ||
+ | 24 Nov 07:28:53 - [info] Started flows | ||
+ | 24 Nov 07:28:53 - [info] Server now running at [http://127.0.0.1:1880/ http://127.0.0.1:1880/] | ||
+ | |||
+ | 3. Open your browser on your host PC, and go to | ||
+ | <nowiki>http://<your IP address>:1880</nowiki> | ||
+ | |||
+ | You are able to see the website like this. | ||
+ | |||
+ | [[File:Node-red-website.png|800px|RTENOTITLE]] | ||
− | + | Advantech also implements some Node-RED nodes. If you're interested, you can check it. | |
+ | |||
+ | *[[SW_Service/Node-Red_for_SW_Service|NodeRED for SusiIoT]] | ||
+ | *[[IoTGateway/Node-Red|NodeRED for IoTGW]] | ||
=== <font color="#0070c0">MQTT Broker</font> === | === <font color="#0070c0">MQTT Broker</font> === | ||
+ | |||
+ | There are many MQTT brokers, and we choose [https://mosquitto.org/ '''Mosquitto'''] as default broker. | ||
+ | |||
+ | You can try this sample flow. | ||
+ | |||
+ | 1. Enable Mosquitto broker | ||
+ | |||
+ | # '''/etc/init.d/mqtt start''' | ||
+ | Starting MQTT Server: [ OK ] | ||
+ | |||
+ | 2. Subscribe a topic | ||
+ | |||
+ | # '''mosquitto_sub -d -t 'risc/topic'''' | ||
+ | Client mosqsub/2768-rsb-4760 sending CONNECT | ||
+ | Client mosqsub/2768-rsb-4760 received CONNACK | ||
+ | Client mosqsub/2768-rsb-4760 sending SUBSCRIBE (Mid: 1, Topic: risc/topic, QoS: 0) | ||
+ | Client mosqsub/2768-rsb-4760 received SUBACK | ||
+ | Subscribed (mid: 1): 0 | ||
+ | |||
+ | 3. Connect from another terminal, e.g. SSH. Then, publish contents for this topic. | ||
+ | |||
+ | # '''mosquitto_pub -d -t 'risc/topic' -m 'advantech'''' | ||
+ | Client mosqpub/2767-rsb-4760 sending CONNECT | ||
+ | Client mosqpub/2767-rsb-4760 received CONNACK | ||
+ | Client mosqpub/2767-rsb-4760 sending PUBLISH (d0, q0, r0, m1, 'risc/topic', ... (9 bytes)) | ||
+ | Client mosqpub/2767-rsb-4760 sending DISCONNECT | ||
+ | |||
+ | 4. You should be able to see contents from Subscriber side. | ||
+ | |||
+ | Client mosqsub/2766-rsb-4760 received PUBLISH (d0, q0, r0, m0, 'risc/topic', ... (9 bytes)) | ||
+ | advantech | ||
=== <font color="#0070c0">SQLite</font> === | === <font color="#0070c0">SQLite</font> === | ||
+ | |||
+ | SQLite is an embedded SQL database engine. It reads and writes directly to ordinary disk files. SQLite is also a compact library. So, you can write programs that use SQLite in many supported languages, such as C/C++, GO, Java, Objective-C, Perl, PHP, Python, etc. | ||
+ | |||
+ | Here is a SQL example. You can input these commands on your devices for trial. | ||
+ | |||
+ | # '''sqlite3 test.db3''' | ||
+ | SQLite version 3.11.0 2016-02-15 17:29:24 | ||
+ | Enter ".help" for usage hints. | ||
+ | |||
+ | sqlite> '''create table project(model, vendor, chipset);''' | ||
+ | sqlite> '''create index project_model_index on project(model);''' | ||
+ | |||
+ | sqlite> '''insert into project values ('RSB-4760', 'Qualcomm', 'APQ8016');''' | ||
+ | sqlite>''' insert into project values ('RSB-4411', 'NXP', 'i.MX6');''' | ||
+ | sqlite> '''insert into project values ('ROM-7421', 'NXP', 'i.MX6');''' | ||
+ | sqlite> '''insert into project values ('UBC-221', 'Intel', 'Quark');''' | ||
+ | |||
+ | sqlite> '''select * from project;''' | ||
+ | RSB-4760|Qualcomm|APQ8016 | ||
+ | RSB-4411|NXP|i.MX6 | ||
+ | ROM-7421|NXP|i.MX6 | ||
+ | UBC-221|Intel|Quark | ||
+ | |||
+ | sqlite> '''select * from project where vendor='NXP';''' | ||
+ | RSB-4411|NXP|i.MX6 | ||
+ | ROM-7421|NXP|i.MX6 | ||
+ | |||
+ | sqlite> '''select count(*) from project;''' | ||
+ | 4 | ||
+ | |||
+ | sqlite> '''.quit''' | ||
+ | |||
+ | For more information, you can refer to the [https://sqlite.org/index.html SQLite official website]. | ||
+ | |||
+ | - [https://sqlite.org/quickstart.html SQLite In 5 Minutes Or Less] | ||
+ | |||
+ | - [https://sqlite.org/cli.html Command Line Shell For SQLite] | ||
== <font color="#0070c0">Security</font> == | == <font color="#0070c0">Security</font> == |
Latest revision as of 08:46, 24 November 2017
For RISC products, we adopt lightweight EdgeSense features. In this chapter, we introduce the basic concepts for these components.
Contents
Cloud Solution
WISE-PaaS
ARM mbed Cloud
Edge Intelligent Suite
Node-RED
Node-RED is a programming tool for wiring together hardware devices, APIs and online services in new and interesting ways.
It provides a browser-based editor that makes it easy to wire together flows using the wide range of nodes in the palette that can be deployed to its runtime in a single-click.
To start up Node-RED server on your device, please
1. Check your IP address on device first, e.g. ifconfig
2. Execute node-red
to start server.
$ node-red 24 Nov 07:28:47 - [info] Welcome to Node-RED ====== ======= ====== 24 Nov 07:28:47 - [info] Node-RED version: v0.16.2 24 Nov 07:28:47 - [info] Node.js version: v6.10.3 24 Nov 07:28:47 - [info] Linux 4.4.38-4760LIV1121 arm64 LE 24 Nov 07:28:49 - [info] Loading palette nodes 24 Nov 07:28:53 - [warn] ------------------------------------------------------ 24 Nov 07:28:53 - [warn] [rpi-gpio] Info : Ignoring Raspberry Pi specific node 24 Nov 07:28:53 - [warn] ------------------------------------------------------ 24 Nov 07:28:53 - [info] Settings file : /home/root/.node-red/settings.js 24 Nov 07:28:53 - [info] User directory : /home/root/.node-red 24 Nov 07:28:53 - [info] Flows file : /home/root/.node-red/flows_rsb-4760.json 24 Nov 07:28:53 - [info] Creating new flow file 24 Nov 07:28:53 - [info] Starting flows 24 Nov 07:28:53 - [info] Started flows 24 Nov 07:28:53 - [info] Server now running at http://127.0.0.1:1880/
3. Open your browser on your host PC, and go to http://<your IP address>:1880
You are able to see the website like this.
Advantech also implements some Node-RED nodes. If you're interested, you can check it.
MQTT Broker
There are many MQTT brokers, and we choose Mosquitto as default broker.
You can try this sample flow.
1. Enable Mosquitto broker
# /etc/init.d/mqtt start Starting MQTT Server: [ OK ]
2. Subscribe a topic
# mosquitto_sub -d -t 'risc/topic' Client mosqsub/2768-rsb-4760 sending CONNECT Client mosqsub/2768-rsb-4760 received CONNACK Client mosqsub/2768-rsb-4760 sending SUBSCRIBE (Mid: 1, Topic: risc/topic, QoS: 0) Client mosqsub/2768-rsb-4760 received SUBACK Subscribed (mid: 1): 0
3. Connect from another terminal, e.g. SSH. Then, publish contents for this topic.
# mosquitto_pub -d -t 'risc/topic' -m 'advantech' Client mosqpub/2767-rsb-4760 sending CONNECT Client mosqpub/2767-rsb-4760 received CONNACK Client mosqpub/2767-rsb-4760 sending PUBLISH (d0, q0, r0, m1, 'risc/topic', ... (9 bytes)) Client mosqpub/2767-rsb-4760 sending DISCONNECT
4. You should be able to see contents from Subscriber side.
Client mosqsub/2766-rsb-4760 received PUBLISH (d0, q0, r0, m0, 'risc/topic', ... (9 bytes)) advantech
SQLite
SQLite is an embedded SQL database engine. It reads and writes directly to ordinary disk files. SQLite is also a compact library. So, you can write programs that use SQLite in many supported languages, such as C/C++, GO, Java, Objective-C, Perl, PHP, Python, etc.
Here is a SQL example. You can input these commands on your devices for trial.
# sqlite3 test.db3 SQLite version 3.11.0 2016-02-15 17:29:24 Enter ".help" for usage hints. sqlite> create table project(model, vendor, chipset); sqlite> create index project_model_index on project(model); sqlite> insert into project values ('RSB-4760', 'Qualcomm', 'APQ8016'); sqlite> insert into project values ('RSB-4411', 'NXP', 'i.MX6'); sqlite> insert into project values ('ROM-7421', 'NXP', 'i.MX6'); sqlite> insert into project values ('UBC-221', 'Intel', 'Quark'); sqlite> select * from project; RSB-4760|Qualcomm|APQ8016 RSB-4411|NXP|i.MX6 ROM-7421|NXP|i.MX6 UBC-221|Intel|Quark sqlite> select * from project where vendor='NXP'; RSB-4411|NXP|i.MX6 ROM-7421|NXP|i.MX6 sqlite> select count(*) from project; 4 sqlite> .quit
For more information, you can refer to the SQLite official website.
- Command Line Shell For SQLite