Skip to content

Agile-IoT/agile-dlink-notifier

Repository files navigation

agile-dlink-notifier

(enControl) Anomalies detection notifier java implementation for AGILE gateway.

This component is a small microservice that connects enControl anomalies detection with AGILE gateway. It’s a simple but very powerful tool enabling the platform to handle critical events in real time.

This work is related with https://github.com/Agile-IoT/agile-dlink

When AGILE platform starts, our microservice for anomalies detection (which is also a docker container) opens a persistent connection to enControl using lightweight Websockets technology which allows real time server push updates.

enControl is constantly monitoring devices data received from the gateway and when an anomaly is detected, it’s pushed immediately to the anomaly notifier microservice who then proceeds to parse the data and store it in a local database.

Local database can be reached through a small REST API provided by the same microservice in the path (GET) http://AGILE_GATEWAY_IP:4567/notifications .

A convenience method to clear the stored data is also provided in the path (GET) http://AGILE_GATEWAY_IP:4567/clear .

Pre-requisites:

  1. Choose an AGILE installation method http://agile-iot.eu/resources/agile-wiki/
  2. Clone agile-dev repo (https://github.com/Agile-IoT/agile-dev) to your working machine and follow the step defined on the README of agile-stack repository (https://github.com/Agile-IoT/agile-stack) to configure your development environment
  3. Test that your development environment is working (try to build and deploy it, agile-stack includes an agile-dummy protocol that you can modify for your tests)
  4. [Optional] have agile-dlink running

Steps to use it in your AGILE project:

  1. Clone agile-dlink-notifier github repository (https://github.com/Agile-IoT/agile-dlink-notifier)
  2. Modify agile-dlink-notifier configuration parameters:
  a.	enControl API key (found in file DLinkNotifier.java and SStackWebApiConsumer.java
  b.	enControl username (found in file SStackWebApiConsumer.java)
  c.	enControl password (found in file SStackWebApiConsumer.java)
  d.	enControl user Id (found in file DLinkNotifier.java)
  1. Modify agile-stack Docker/Docker Compose files as needed for your development environment and your deployment target chosen in the pre-requisites (you can take agile-dummy as an example or follow the complete and detailed AGILE’s official documentation in the following link http://agile-iot.eu/wiki/index.php?title=How_to_develop_a_new_Protocol)
  2. Launch a Docker build (for the specific command check the complete and detailed AGILE’s official documentation in the following link http://agile-iot.eu/wiki/index.php?title=How_to_develop_a_new_Protocol or check docker documentation https://docs.docker.com/)
  3. Launch a Docker deploy (for the specific command check the complete and detailed AGILE’s official documentation in the following link http://agile-iot.eu/wiki/index.php?title=How_to_develop_a_new_Protocol or check docker documentation https://docs.docker.com/)
  4. Now you will be able to register receive anomaly detection notifications generated by enControl. You can see the logs printing agile-dlink-notifier docker container logs (for the specific command check docker documentation https://docs.docker.com/). Additionally you can check http://{YOUR_HOST_ID}:4567/notifications to get a JSON with all notifications received or use http://{YOUR_HOST_ID}:4567/clear to remove all stored notifications.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages