Demonstrator2 implementation
In demonstrator 2, entitled "Decentralized Data Exchange", the scenario focuses on data exchange between IIoT devices and IoT services using data mapping based on service requirements. This achieved via TSMatch component and TSMatch Application.
Installation, Building, and Running The TSMatch Components
Use the package manager npm for the installation of modules and packages
database
Database uses latest Neo4j image. Run the container automatically with the provided script:
cd graphdb
chmod +x start_graphdb.sh
./start_graphdb.sh
broker
Broker uses Alpine image version 3.8: Run the container automatically with the provided script:
cd broker
chmod +x start_broker.sh
./start_broker.sh
sensor
Run with NPM:
cd thing
npm install
npm run build
npm start
Run with provided docker container runner script:
cd thing
chmod +x start_sensor.sh
./start_sensor.sh
robot
The current robot (mobile IoT thing) implementation has 2 use cases; i) rotation around the demonstrator stand; ii) going back and forth on the demonstrator stand based on a map of the stand. Both implementations are rule-based and overall the robot implementation is still work-in-progress.
In order to run the robot;
- First, connect to the NUC device where roscore is installed and run the roscore by simply running
roscore
command on the terminal. - Second, connect to the RPI device that is placed on the robot and run the following command to launch the robot
roslaunch turtlebot3_bringup turtlebot3_robot.launch
. - After that, place the robot in the middle of the demonstrator stand, go into the source directory of the robot code and run one of the following python scripts:
cd ./robot/src/
# run only one of the following python scripts
# moves robot around the demonstrator stand
python3 move_to_sides.py
# moves robot back and forth based on a map of the demonstrator stand
python3 send_goal.py
TSMatch API
Run with NPM:
cd TSMatch_API
npm install
npm run build
npm run service
Run with provided docker container runner script:
cd TSMatch_API
chmod +x start_tsmatch_api.sh
./start_tsmatch_api.sh
TSMatch Engine
Run with NPM:
cd TSMatch_Engine
npm install
npm run build
npm run service
Run with provided docker container runner script:
cd TSMatch_Engine
chmod +x start_tsmatch_engine.sh
./start_tsmatch_engine.sh
TSMatch Mobile App
The APK file is located under TSMatchMobileApp/android/app/build/outputs/apk/release folder. Requirements:
- Minimum SDK version of the app is 16. This means it supports Android 4.1 and above.
- In case there is no file manager in the smart phone, install one from Play Store. Some popular ones: EZ File Explorer, File Manager.
- Installing unknown apps must be allowed on the smart phone, since the app is not in Play Store. The way to allow unknown apps on a smart phone changes according to android version. How to do it is explained here.
Installation:
- Connect your phone to a computer with a USB cable and move the APK file into your smart phone. Or download the APK file directly to your smart phone.
- With using a file manager, move into the folder where APK file is located.
- Click on APK file and follow the instructions of the APK installer on your smart phone.
Runtime
- Upon start, the sensors are registred and advertised. The TSMatch component observe the registred sensors and store the sensor data(include sensor, thing, feature of interest description in the DB)
- Then, TSMatch App will ask you to fill in some basic service request through thecommand line, then the service request is advertised
- The TSMatch componenent then:
- received the service request and store the data in the DB.
- Sensors are first selected based on the feature of interest specified by the user (i.e. temperature)
- Sensors are grouped absed on the grouping defined by the user (i.e per-room)
- Average value per group is then created and advertised
- The TSMatch app observes advertised events about sensor selection results and shows it in the command line