Call-for-Code / Frida

Frida, AI and IoT comes to the aid of teachers, students, and first responders. A Call for Code project from IBM.
http://frida-ai.org
Apache License 2.0
20 stars 8 forks source link

[Code] Simulate Sensor data flow into application #9

Closed LinJu closed 5 years ago

LinJu commented 5 years ago

Requirement: In order to simulate sensor data streaming into Frida Application, we can develop Node.RED application to Watson IoT platform to show the workflow. Implementation: We are using Node.RED in IBM Cloud.

  1. Log in or sign-up for an account at bluemix.net

  2. Navigate to the catalog and search for ‘Node-RED’

  3. This will present you with two options:

  4. Node-RED Starter - a vanilla Node-RED instance

  5. Internet of Things Platform Starter - this gives you everything you need to start quickly using Node-RED with the Watson IoT Platform, including some default flows to show how things work

  6. a Cloudant database instance to store your flow configuration a collection of nodes that make it easy to access various Bluemix services, including both the Watson IoT platform and the Watson Cognitive services

  7. Click the starter application you want to use, give it a name and click create.

  8. A couple of minutes later, you’ll be able to access your instance of Node-RED at https://.mybluemix.net

LinJu commented 5 years ago

Detail implementation:

Purpose

Simulate Frida IOT server to serve the escape routes on a map functionality in Frida-app (https://github.com/IBM/Frida/issues/5)

Description (Use Case)

We are trying to serve the same use case mentioned in (https://github.com/IBM/Frida/issues/5 and https://github.com/IBM/Frida-app/pull/1) where there are 4 rooms in a school connected to the Frida IOT simulator. The Simulator has been built using IBM Node-RED. Components of Node-RED flow includes a web socket server, Watson Assistant Service, Watson Studio & user defined functions which tie them together to enable exchange of information.

To simulate the feeds from the rooms we have used the node to inject the file locally in Node-RED as well from your Webcam. The images captured from these nodes are sent to the trained VR model (using Watson Studio) along with the device info. VR model helps us to identify the damaged rooms in the school. The alerts are generated based on the VR model result and sent to Frida app using sockets.

Steps to runs the simulator

  1. Follow the implementation steps mentioned in https://github.com/IBM/Frida/issues/9
  2. Open the Node-RED instance on the browser
  3. Click the hamburger icon on the home page and select Clipboard option under Import
  4. Insert the contents of the Frida-IOT-simulator.json file from this repo and select the Import to option as new flow
  5. Add the API Key from your watson-vision-combined service provisioned under you IBM Cloud account to the VR model node in Node-RED.
  6. Update the hostname of your socket client in Frida-app (in school.js) with the hostname of your Node-RED instance to receive socket events.

Screenshot

screen shot 2019-02-05 at 12 48 50 pm
LinJu commented 5 years ago

Done by @yasinghcse! Thank you!