Difference between revisions of "IoTGateway/WiseSnail Simulator"

From ESS-WIKI
Jump to: navigation, search
(Created page with "== Methodology == *Machine Learning Train Steps == Open Source Library == *TensorFlow Introduction *How_to_ev...")
 
 
(13 intermediate revisions by the same user not shown)
Line 1: Line 1:
== Methodology ==
+
== Introduction ==
  
*[[Machine_Learning_Train_Steps|Machine Learning Train Steps]]
+
This '''Simulator''' parse '''wisesnail''' directory and convert parse result to WiseSnail packet, then send to MQTT broker.
  
== Open Source Library ==
+
== Download source code and install required modules ==
  
*[[TensorFlow_Introduction|TensorFlow Introduction]]
+
1. Install nodejs: [https://nodejs.org/en/download/package-manager/ https://nodejs.org/en/download/package-manager/]
*[[How_to_evaluate_model_with_TensorBoard|How to evaluate model with TensorBoard]]
 
*[[TensorFlow_Sample_Code|TensorFlow Sample Code]]
 
*[[Scikit-learn_Sample_Code|Scikit-learn Sample Code]]
 
  
== Modulized ==
+
2. Checkout SVN source code: [https://172.20.2.44/svn/essrisc/IoT/source/Projects/WiseSnail_simulator https://172.20.2.44/svn/essrisc/IoT/source/Projects/WiseSnail_simulator]
  
*[[Wrap_a_Machine_Learning_NodeRed_Component|Wrap a Machine Learning NodeRed Component]]
+
3. Enter the directroy '''WiseSnail_simulator''' and use '''npm''' tool to install '''mqtt''' and '''keypress''' modules.
 +
<pre>$ cd  ./WiseSnail_simulator
 +
$ npm install mqtt --save
 +
$ npm install keypress -- save
 +
</pre>
 +
 
 +
== Folder/File mapping introduction ==
 +
 
 +
1. In source code '''WiseSnail_simulator''' directory, you can find '''wisesnail'''
 +
 
 +
2. This '''Simulator''' parse '''wisesnail''' directory and convert parse result to WiseSnail packet, then send to MQTT broker.
 +
 
 +
3. Below is folder/file mapping introduction
 +
 
 +
*Folder/File naming rule is using prefix '''VGW_''' or '''CONN_''' or '''SENSORHUB_''' + device '''MAC address'''
 +
 
 +
[[File:20161011 nodejs wisesnail 3.png|RTENOTITLE]]
 +
 
 +
*Read data files in sensor hub folder to show sensor data.
 +
 
 +
[[File:20161012 nodejs wisesnail 1.png|RTENOTITLE]]
 +
 
 +
== How to test ==
 +
 
 +
1. add device by adding folder and files.(or you can use default folder wisesnail)
 +
 
 +
2. modify MQTT broker address in '''mqtt_server.conf'''
 +
 
 +
3. Launch '''Simulator''', then check RMM server.
 +
<pre>$node wisesnail.js
 +
</pre>
 +
 
 +
4. '''Ctrl+C''' to disconnect device from RMM server

Latest revision as of 03:27, 12 October 2016

Introduction

This Simulator parse wisesnail directory and convert parse result to WiseSnail packet, then send to MQTT broker.

Download source code and install required modules

1. Install nodejs: https://nodejs.org/en/download/package-manager/

2. Checkout SVN source code: https://172.20.2.44/svn/essrisc/IoT/source/Projects/WiseSnail_simulator

3. Enter the directroy WiseSnail_simulator and use npm tool to install mqtt and keypress modules.

$ cd  ./WiseSnail_simulator
$ npm install mqtt --save
$ npm install keypress -- save

Folder/File mapping introduction

1. In source code WiseSnail_simulator directory, you can find wisesnail

2. This Simulator parse wisesnail directory and convert parse result to WiseSnail packet, then send to MQTT broker.

3. Below is folder/file mapping introduction

  • Folder/File naming rule is using prefix VGW_ or CONN_ or SENSORHUB_ + device MAC address

RTENOTITLE

  • Read data files in sensor hub folder to show sensor data.

RTENOTITLE

How to test

1. add device by adding folder and files.(or you can use default folder wisesnail)

2. modify MQTT broker address in mqtt_server.conf

3. Launch Simulator, then check RMM server.

$node wisesnail.js

4. Ctrl+C to disconnect device from RMM server