Difference between revisions of "WISE-PaaS/EdgeSense"
Daniel.hung (talk | contribs) |
Daniel.hung (talk | contribs) |
||
Line 50: | Line 50: | ||
Here is a SQL example. You can input these commands on your devices for trial. | Here is a SQL example. You can input these commands on your devices for trial. | ||
− | # sqlite3 test.db3 | + | # '''sqlite3 test.db3''' |
SQLite version 3.11.0 2016-02-15 17:29:24 | SQLite version 3.11.0 2016-02-15 17:29:24 | ||
Enter ".help" for usage hints. | Enter ".help" for usage hints. | ||
− | sqlite> create table project(model, vendor, chipset); | + | sqlite> '''create table project(model, vendor, chipset);''' |
− | sqlite> create index project_model_index on project(model); | + | sqlite> '''create index project_model_index on project(model);''' |
− | sqlite> insert into project values ('RSB-4760', 'Qualcomm', 'APQ8016'); | + | sqlite> '''insert into project values ('RSB-4760', 'Qualcomm', 'APQ8016');''' |
− | sqlite> insert into project values ('RSB-4411', 'NXP', 'i.MX6'); | + | 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 ('ROM-7421', 'NXP', 'i.MX6');''' |
− | sqlite> insert into project values ('UBC-221', 'Intel', 'Quark'); | + | sqlite> '''insert into project values ('UBC-221', 'Intel', 'Quark');''' |
− | sqlite> select * from project; | + | sqlite> '''select * from project;''' |
RSB-4760|Qualcomm|APQ8016 | RSB-4760|Qualcomm|APQ8016 | ||
RSB-4411|NXP|i.MX6 | RSB-4411|NXP|i.MX6 | ||
Line 68: | Line 68: | ||
UBC-221|Intel|Quark | UBC-221|Intel|Quark | ||
− | sqlite> select * from project where vendor='NXP'; | + | sqlite> '''select * from project where vendor='NXP';''' |
RSB-4411|NXP|i.MX6 | RSB-4411|NXP|i.MX6 | ||
ROM-7421|NXP|i.MX6 | ROM-7421|NXP|i.MX6 | ||
− | sqlite> select count(*) from project; | + | sqlite> '''select count(*) from project;''' |
4 | 4 | ||
− | sqlite> .quit | + | sqlite> '''.quit''' |
For more information, you can refer to the [https://sqlite.org/index.html SQLite official website]. | For more information, you can refer to the [https://sqlite.org/index.html SQLite official website]. |
Revision as of 06:40, 22 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
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