diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
new file mode 100644
index 0000000..896dd24
--- /dev/null
+++ b/CONTRIBUTING.md
@@ -0,0 +1,292 @@
+# Asociación de Investigacion en Inteligencia Artificial Para la Leucemia Peter Moss
+## Contributing To Our Projects
+
+
+
+Asociación de Investigacion en Inteligencia Artificial Para la Leucemia Peter Moss encourages and welcomes code contributions, bug fixes and enhancements from the Github community.
+
+The following is a guide on how to contribute to Asociación de Investigacion en Inteligencia Artificial Para la Leucemia Peter Moss Github projects and **_should be followed in all cases_**.
+
+
+
+# Table Of Contents
+
+- [Repository Issues](#repository-issues)
+ - [Bug reports](#bug-reports)
+ - [Feature requests](#feature-requests)
+ - [Feature proposals](#feature-proposals)
+- [Creating a fork of the repository](#creating-a-fork-of-the-repository)
+- [Repository structure](#repository-structure)
+- [Documentation](#documentation)
+- [Installation Scripts](#documentation)
+- [Naming](#documentation)
+- [Code Styling Guide](#code-styling-guide)
+- [Attribution](#documentation)
+- [.md Files](#documentation)
+- [Push changes to forked repository](#documentation)
+- [Pull requests](#documentation)
+- [Pull requests process](#documentation)
+- [Code of conduct](#documentation)
+ - [Our pledge](#documentation)
+ - [Our standards](#documentation)
+ - [Our responsibilities](#documentation)
+
+
+
+
+
+# Repository Issues
+
+The first step is to head to our repository issues tab and decide how you would like to contribute.
+
+![Repository Issues](assets/images/repo-issues.png)
+
+## Bug reports
+
+![Bug Reports](assets/images/bug-report.png)
+
+If you would like to contribute bug fixes or make the team aware of bugs you have identified in the project, please raise a **Bug report** issue in the [issues section](issues/new/choose) section. A template is provided that will allow you to provide your suggestions for your bug report / bug fix(es) which will be reviewed by the team.
+
+Bug fix issues are the first step to creating a pull request for bug fixes, once you have created your issue and it has been approved you can proceed with your bug fixes.
+
+## Feature requests
+
+![Bug Reports](assets/images/feature-request.png)
+
+If you would like to suggest a new feature/new features for this project, please raise a **Feature request** issue in the [issues section](issues/new/choose) section. A template is provided that will allow you to provide your suggestions for your feature request.
+
+## Feature proposals
+
+![Bug Reports](assets/images/feature-proposals.png)
+
+If you would like to contribute new features to the project, please raise a **Feature proposal** issue in the [issues section](issues/new/choose) section. A template is provided that will allow you to provide your suggestions for your feature proposal.
+
+
+
+# Creating a fork of the repository
+
+![Creating a fork of the repository](assets/images/fork.png)
+If you are going to be contributing code or documentation to the repository you will need to make a fork of the current development branch. The current development branch will always be the highest branch or master. Once you have created a fork of the repository, you will be able to clone the repository to a location on your development machine using terminal and Git or Github Desktop if using Windows.
+
+
+
+# Repository structure
+
+```
+- Project Root (Directory)
+ - config (Directory) *
+ - config.json (File) *
+ - credentials.json (File) *
+ - modules (Directory) *
+ - AbstractAgent.py (File) *
+ - AbstractData.py (File) *
+ - AbstractModel.py (File) *
+ - AbstractServer.py (File) *
+ - helpers.py (File) *
+ - data.py (File) *
+ - model.py (File) *
+ - mqtt.py (File) *
+ - server.py (File) *
+ - docs (Directory)
+ - installation (Directory)
+ - Ubuntu
+ - Windows
+ - Raspberry Pi OS
+ - logs (Directory)
+ - logfiles
+ - assets
+ - media
+ - images (Directory)
+ - videos (Directory)
+ - model
+ - data (Directory) *
+ - test (Directory) *
+ - train (Directory) *
+ - plots (Directory) *
+ - model.json (File)
+ - weights.h (File)
+ - scripts
+ - install.sh (File)
+ - agent.py (File)
+ - Project README (File)
+```
+
+
+
+# Documentation
+
+All projects should have documentation, changes you make to the code in the repository or new projects that you make should also have documentation. In the structures above you can see the **Documentation** directories, and the **Installation** file. This installation file should contain a step by step guide to how to install your project, while directions of use will be a high level tutorial in your project README. If you are contributing an existing repository you will ensure that these documents are updated to reflect your changes.
+
+
+
+# Installation Scripts
+
+You will notice the **Scripts** directory above, this is home to any scripts that make it easier for the end use to set up and / or use your project. By default every project must have an installation script when installations are required. If you are contributing an existing repository you will ensure that these scripts are updated to reflect your changes.
+
+
+
+# Naming
+
+We use CamelCase for our directory and file names (except images), we would like this to stay uniform across all of our projects. Please use descriptive but short names where possible, and make sure you do not use spaces in directory and file names.
+
+
+
+# Code Styling Guide
+
+Code contributed to HIASBCH MQTT Blockchain Agent must follow the [PEP 8 -- Style Guide for Python Code](https://www.python.org/dev/peps/pep-0008/) in order to set a common programming style for all developers working on the code.
+
+# Attribution
+
+Whenever relevant you should add yourself to the contributors section of the READMEs. If you have a public profile on the Peter Moss Leukemia AI Research website, you should use this in your link. Please see the contributing section of any of our READMEs for examples.
+
+
+
+# .md Files
+
+Each .md file in the repository should use the same header. An example of this is as follows:
+
+```
+# Asociación de Investigacion en Inteligencia Artificial Para la Leucemia Peter Moss
+## Acute Lymphoblastic Leukemia oneAPI Classifier
+
+![Acute Lymphoblastic Leukemia oneAPI Classifier](assets/images/all-oneapi-classifier-2020.png)
+```
+If the .md file is the README in the project root, it should including the following markdown, ensuring the repository URLS and versions are correct.
+
+```
+[![CURRENT RELEASE](https://img.shields.io/badge/CURRENT%20RELEASE-0.0.0-blue.svg)](https://github.com/AIIAL/Acute-Lymphoblastic-Leukemia-oneAPI-Classifier/tree/0.0.0) [![UPCOMING RELEASE](https://img.shields.io/badge/CURRENT%20DEV%20BRANCH-0.1.0-blue.svg)](https://github.com/AIIAL/Acute-Lymphoblastic-Leukemia-oneAPI-Classifier/tree/0.1.0) [![Contributions Welcome!](https://img.shields.io/badge/Contributions-Welcome-lightgrey.svg)](CONTRIBUTING.md) [![Issues](https://img.shields.io/badge/Issues-Welcome-lightgrey.svg)](issues) [![LICENSE](https://img.shields.io/badge/LICENSE-MIT-blue.svg)](LICENSE)
+```
+
+```
+
+# Contributing
+Asociación de Investigacion en Inteligencia Artificial Para la Leucemia Peter Moss encourages and welcomes code contributions, bug fixes and enhancements from the Github community.
+
+Please read the [CONTRIBUTING](CONTRIBUTING.md "CONTRIBUTING") document for a full guide to forking our repositories and submitting your pull requests. You will also find information about our code of conduct on this page.
+
+## Contributors
+- [Adam Milton-Barker](https://www.leukemiaairesearch.com/association/volunteers/adam-milton-barker "Adam Milton-Barker") - [Asociación de Investigacion en Inteligencia Artificial Para la Leucemia Peter Moss](https://www.leukemiaresearchassociation.ai "Asociación de Investigacion en Inteligencia Artificial Para la Leucemia Peter Moss") President/Founder & Lead Developer, Sabadell, Spain
+
+
+
+# Versioning
+We use SemVer for versioning.
+
+
+
+# License
+This project is licensed under the **MIT License** - see the [LICENSE](LICENSE "LICENSE") file for details.
+
+
+
+# Bugs/Issues
+We use the [repo issues](issues "repo issues") to track bugs and general requests related to using this project. See [CONTRIBUTING](CONTRIBUTING.md "CONTRIBUTING") for more info on how to submit bugs, feature requests and proposals.
+```
+
+The project README contributors should contain a list of all contributors in the entire repository.
+
+
+
+# Push changes to forked repository
+
+When you have made your changes, you need to push them to your forked repository. This process requires a commit with a message about what your commit is, and then finally a push to the repository which will place your changes or created files to your forked repository.
+
+Show the status of all changed/added files.
+
+```
+git status
+```
+
+You may want to do check the differences between changed files, you can do this using the following command.
+
+```
+git diff
+```
+
+Add all changes ready to commit. (You may not want to add all changed files, in this case please follow instructions to add single files to commit that you were shown using git status). To repeat, the following will add all changes shown by using git status to your commit.
+
+```
+git add .
+```
+
+Commit your changes.
+
+```
+git commit -m "Your descriptive commit message"
+```
+
+Push changes to your fork.
+
+```
+git push
+```
+
+You can also Github Desktop if on Windows as shown in the image above.
+
+
+
+# Pull requests
+
+When you are satisfied with your changes you can submit a pull request that will request that your changes be pulled into the latest development branch.
+
+## Pull Request Process
+
+1. Ensure all documentation has been updated and matches the style of our repository layouts, including repository directory structures etc.
+2. Add new README.md files for new directories / ** init **.py files for empty directories.
+3. Ensure that your READMEs, documentation and code match the format/design of the rest of the repoistory.
+4. Include the project header banner on all documentation pages / READMEs.
+5. Incude the Contributing, Versioning, Licensing, Bugs/Issues information in all READMEs and documentation.
+6. Do not ever upload licensed software or images that you do not own the rights to.
+7. Submit your Pull Request with an accurate description of the changes you have made.
+8. Your Pull Request will be reviewed by the team.
+
+
+
+# Code of conduct
+
+Please note we have a code of conduct, please follow it in all your interactions with the project.
+
+## Our Pledge
+
+In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
+
+## Our Standards
+
+Examples of behavior that contributes to creating a positive environment include:
+
+- Using welcoming and inclusive language
+- Being respectful of differing viewpoints and experiences
+- Gracefully accepting constructive criticism
+- Focusing on what is best for the community
+- Showing empathy towards other community members
+
+Examples of unacceptable behavior by participants include:
+
+- The use of sexualized language or imagery and unwelcome sexual attention or advances
+- Trolling, insulting/derogatory comments, and personal or political attacks
+- Public or private harassment
+- Publishing others' private information, such as a physical or electronic address, without explicit permission
+- Other conduct which could reasonably be considered inappropriate in a professional setting
+
+## Our Responsibilities
+
+Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
+
+Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or
+permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
+
+## Scope
+
+This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
+
+## Enforcement
+
+Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at github@leukemiaresearchassociation.ai All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
+
+Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
+
+
+
+# Attribution
+
+This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org/version/1/4), version 1.4.
\ No newline at end of file
diff --git a/LICENSE b/LICENSE
index ff6c301..1f7fb6f 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,6 +1,6 @@
MIT License
-Copyright (c) 2021 Peter Moss MedTech Research Project
+Copyright (c) 2021 Asociación de Investigacion en Inteligencia Artificial Para la Leucemia Peter Moss
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/README.md b/README.md
index d57feb0..29c3031 100644
--- a/README.md
+++ b/README.md
@@ -1,2 +1,88 @@
-# HIAS-Bluetooth-IoT-Agent
-The HIAS Bluetooth IoT Agent is a bridge between HIAS devices that support Bluetooth/Bluetooth Low Energy protocol and the HIASCDI Context Broker.
+# Asociación de Investigacion en Inteligencia Artificial Para la Leucemia Peter Moss
+## HIAS Bluetooth IoT Agent
+
+![HIAS Bluetooth IoT Agent](assets/images/HIAS-Bluetooth-IoT-Agent.jpg)
+
+[![CURRENT RELEASE](https://img.shields.io/badge/CURRENT%20RELEASE-1.0.0-blue.svg)](https://github.com/AIIAL/HIAS-Bluetooth-IoT-Agent/tree/1.0.0) [![UPCOMING RELEASE](https://img.shields.io/badge/CURRENT%20DEV%20BRANCH-2.0.0-blue.svg)](https://github.com/AIIAL/HIAS-Bluetooth-IoT-Agent/tree/2.0.0) [![Contributions Welcome!](https://img.shields.io/badge/Contributions-Welcome-lightgrey.svg)](CONTRIBUTING.md) [![Issues](https://img.shields.io/badge/Issues-Welcome-lightgrey.svg)](issues) [![LICENSE](https://img.shields.io/badge/LICENSE-MIT-blue.svg)](LICENSE) [![PEP8](https://img.shields.io/badge/code%20style-pep8-orange.svg)](https://www.python.org/dev/peps/pep-0008/)
+ [![Documentation Status](https://readthedocs.org/projects/hias-bluetooth-iot-agent/badge/?version=latest)](https://hias-bluetooth-iot-agent.readthedocs.io/en/latest/?badge=latest)
+ [![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/4983/badge)](https://bestpractices.coreinfrastructure.org/projects/4983)
+
+
+
+
+# Table Of Contents
+
+- [Introduction](#introduction)
+- [HIAS](#hias)
+- [HIAS IoT Agents](#hias-iot-agents)
+- [GETTING STARTED](#getting-started)
+- [Contributing](#contributing)
+ - [Contributors](#contributors)
+- [Versioning](#versioning)
+- [License](#license)
+- [Bugs/Issues](#bugs-issues)
+
+
+
+# Introduction
+
+The **HIAS Bluetooth IoT Agent** is a bridge between HIAS devices that support Bluetooth/Bluetooth Low Energy protocol and the HIASCDI Context Broker.
+
+
+
+# HIAS
+
+![HIAS - Hospital Intelligent Automation Server](assets/images/HIAS.jpg)
+
+[HIAS - Hospital Intelligent Automation Server](https://github.com/AIIAL/HIAS-Server) is an open-source automation server designed to control and manage an intelligent network of IoT connected devices and applications.
+
+
+
+# HIAS IoT Agents
+
+The HIAS iotJumpWay Agents are a selection of protocol/transfer specific applications that act as a bridge between the HIAS Context Broker and the devices and applications connected to the HIAS network via the iotJumpWay. Supported protocols currently include HTTP, MQTT, Websockets, AMQP and Bluetooth/Bluetooth Low Energy (BLE).
+
+Each IoT Agent provides a North & South Port interface that allows communication to and from the Context Broker.
+
+
+
+__Source: [FIWARE IoT Agents](https://fiware-tutorials.readthedocs.io/en/latest/iot-agent/index.html)__
+
+The North Port interface of an IoT Agent listens to southbound traffic coming from the Context Broker towards the devices and applications.
+
+
+
+__Source: [FIWARE IoT Agents](https://fiware-tutorials.readthedocs.io/en/latest/iot-agent/index.html)__
+
+The IoT Agent sends southbound traffic to devices and applications using a protocol that is supported by the device/application, and receives northbound traffic from the devices/applications which it then forwards to the Context Broker.
+
+
+
+# GETTING STARTED
+
+To get started follow the [Getting Started](docs/getting-started.md) guide.
+
+
+
+# Contributing
+Asociación de Investigacion en Inteligencia Artificial Para la Leucemia Peter Moss encourages and welcomes code contributions, bug fixes and enhancements from the Github community.
+
+Please read the [CONTRIBUTING](CONTRIBUTING.md "CONTRIBUTING") document for a full guide to forking our repositories and submitting your pull requests. You will also find information about our code of conduct on this page.
+
+## Contributors
+- [Adam Milton-Barker](https://www.leukemiaairesearch.com/association/volunteers/adam-milton-barker "Adam Milton-Barker") - [Asociación de Investigacion en Inteligencia Artificial Para la Leucemia Peter Moss](https://www.leukemiaresearchassociation.ai "Asociación de Investigacion en Inteligencia Artificial Para la Leucemia Peter Moss") President/Founder & Lead Developer, Sabadell, Spain
+
+
+
+# Versioning
+We use SemVer for versioning.
+
+
+
+# License
+This project is licensed under the **MIT License** - see the [LICENSE](LICENSE "LICENSE") file for details.
+
+
+
+# Bugs/Issues
+We use the [repo issues](issues "repo issues") to track bugs and general requests related to using this project. See [CONTRIBUTING](CONTRIBUTING.md "CONTRIBUTING") for more info on how to submit bugs, feature requests and proposals.
\ No newline at end of file
diff --git a/agent.py b/agent.py
new file mode 100644
index 0000000..445f1fe
--- /dev/null
+++ b/agent.py
@@ -0,0 +1,160 @@
+#!/usr/bin/env python
+""" HIAS Bluetooth IoT Agent Class
+
+HIAS Bluetooth IoT Agents are bridges between HIAS devices that support
+Bluetooth/Bluetooth Low Energy protocol and the HIASCDI Context Broker.
+
+MIT License
+
+Copyright (c) 2021 Asociación de Investigacion en Inteligencia Artificial
+Para la Leucemia Peter Moss
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files(the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and / or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+Contributors:
+- Adam Milton-Barker
+"""
+
+from gevent import monkey
+monkey.patch_all()
+
+import json
+import os
+import psutil
+import requests
+import signal
+import sys
+import time
+import threading
+
+import os.path
+sys.path.append(
+ os.path.abspath(os.path.join(__file__, "..", "..", "..", "..")))
+
+from abc import ABC, abstractmethod
+from datetime import datetime
+from flask import Flask, request, Response
+from threading import Thread
+
+from components.agents.AbstractAgent import AbstractAgent
+
+
+class Agent(AbstractAgent):
+ """ Class representing a HIAS Bluetooth IoT Agent.
+
+ This object represents a HIAS Bluetooth IoT Agent which
+ process all data coming from IoT Agents and store immutable
+ hashes in the HIASBCH Blockchain providing the functionality
+ to perform data integrity checks.
+ """
+
+ def __init__(self, protocol):
+ super().__init__(protocol)
+
+ def statusCallback(self, topic, payload):
+ pass
+
+ def lifeCallback(self, topic, payload):
+ pass
+
+ def sensorsCallback(self, topic, payload):
+ pass
+
+ def life(self):
+ """ Sends entity statistics to HIAS """
+
+ cpu = psutil.cpu_percent()
+ mem = psutil.virtual_memory()[2]
+ hdd = psutil.disk_usage('/fserver').percent
+ tmp = psutil.sensors_temperatures()['coretemp'][0].current
+ r = requests.get('http://ipinfo.io/json?token=' +
+ self.helpers.credentials["iotJumpWay"]["ipinfo"])
+ data = r.json()
+ location = data["loc"].split(',')
+
+ self.mqtt.publish("Life", {
+ "CPU": str(cpu),
+ "Memory": str(mem),
+ "Diskspace": str(hdd),
+ "Temperature": str(tmp),
+ "Latitude": str(location[0]),
+ "Longitude": str(location[1])
+ })
+
+ self.helpers.logger.info("Agent life statistics published.")
+ threading.Timer(300.0, self.life).start()
+
+ def respond(self, responseCode, response):
+ """ Returns the request repsonse """
+
+ return Response(response=json.dumps(response, indent=4), status=responseCode,
+ mimetype="application/json")
+
+ def signal_handler(self, signal, frame):
+ self.helpers.logger.info("Disconnecting")
+ self.mqtt.disconnect()
+ sys.exit(1)
+
+app = Flask(__name__)
+Agent = Agent("hiasbch")
+
+@app.route('/About', methods=['GET'])
+def about():
+ """
+ Returns Agent details
+ Responds to GET requests sent to the North Port About API endpoint.
+ """
+
+ return Agent.respond(200, {
+ "Identifier": Agent.credentials["iotJumpWay"]["entity"],
+ "Host": Agent.credentials["server"]["ip"],
+ "NorthPort": Agent.credentials["server"]["port"],
+ "CPU": psutil.cpu_percent(),
+ "Memory": psutil.virtual_memory()[2],
+ "Diskspace": psutil.disk_usage('/').percent,
+ "Temperature": psutil.sensors_temperatures()['coretemp'][0].current
+ })
+
+def main():
+
+ signal.signal(signal.SIGINT, Agent.signal_handler)
+ signal.signal(signal.SIGTERM, Agent.signal_handler)
+
+ Agent.mongodbConn()
+ Agent.hiascdiConn()
+ Agent.hiasbchConn()
+ Agent.mqttConn({
+ "host": Agent.credentials["iotJumpWay"]["host"],
+ "port": Agent.credentials["iotJumpWay"]["port"],
+ "location": Agent.credentials["iotJumpWay"]["location"],
+ "zone": Agent.credentials["iotJumpWay"]["zone"],
+ "entity": Agent.credentials["iotJumpWay"]["entity"],
+ "name": Agent.credentials["iotJumpWay"]["name"],
+ "un": Agent.credentials["iotJumpWay"]["un"],
+ "up": Agent.credentials["iotJumpWay"]["up"]
+ })
+
+ Agent.mqtt.integrityCallback = Agent.integrityCallback
+
+ Thread(target=Agent.life, args=(), daemon=True).start()
+
+ app.run(host=Agent.helpers.credentials["server"]["ip"],
+ port=Agent.helpers.credentials["server"]["port"])
+
+if __name__ == "__main__":
+ main()
diff --git a/assets/images/HIAS-Bluetooth-IoT-Agent.jpg b/assets/images/HIAS-Bluetooth-IoT-Agent.jpg
new file mode 100644
index 0000000..2174bf0
Binary files /dev/null and b/assets/images/HIAS-Bluetooth-IoT-Agent.jpg differ
diff --git a/assets/images/HIAS.jpg b/assets/images/HIAS.jpg
new file mode 100644
index 0000000..2072576
Binary files /dev/null and b/assets/images/HIAS.jpg differ
diff --git a/assets/images/bug-report.png b/assets/images/bug-report.png
new file mode 100644
index 0000000..05cf23c
Binary files /dev/null and b/assets/images/bug-report.png differ
diff --git a/assets/images/feature-proposals.png b/assets/images/feature-proposals.png
new file mode 100644
index 0000000..8e01473
Binary files /dev/null and b/assets/images/feature-proposals.png differ
diff --git a/assets/images/feature-request.png b/assets/images/feature-request.png
new file mode 100644
index 0000000..d80541c
Binary files /dev/null and b/assets/images/feature-request.png differ
diff --git a/assets/images/fork.png b/assets/images/fork.png
new file mode 100644
index 0000000..c9f50b6
Binary files /dev/null and b/assets/images/fork.png differ
diff --git a/assets/images/northbound.jpg b/assets/images/northbound.jpg
new file mode 100644
index 0000000..f045bc3
Binary files /dev/null and b/assets/images/northbound.jpg differ
diff --git a/assets/images/repo-issues.png b/assets/images/repo-issues.png
new file mode 100644
index 0000000..2a9fc9a
Binary files /dev/null and b/assets/images/repo-issues.png differ
diff --git a/assets/images/southbound.jpg b/assets/images/southbound.jpg
new file mode 100644
index 0000000..f742ae2
Binary files /dev/null and b/assets/images/southbound.jpg differ
diff --git a/configuration/config.json b/configuration/config.json
new file mode 100644
index 0000000..c39c3fe
--- /dev/null
+++ b/configuration/config.json
@@ -0,0 +1,49 @@
+{
+ "agent": {
+ "cores": 8,
+ "params": [
+ "train",
+ "classify",
+ "server",
+ "classify_http",
+ "classify_openvino",
+ "server_openvino",
+ "classify_openvino_http"
+ ]
+ },
+ "data": {
+ "dim": 100,
+ "file_type": ".jpg",
+ "labels": [0, 1],
+ "rotations": 10,
+ "seed": 2,
+ "split": 0.3,
+ "test": "model/data/test",
+ "test_data": [],
+ "train_dir": "model/data/train",
+ "valid_types": []
+ },
+ "model": {
+ "device": "CPU",
+ "freezing_log_dir": "model/freezing",
+ "frozen": "frozen.pb",
+ "ir": "model/ir/frozen.xml",
+ "model": "model/model.json",
+ "saved_model_dir": "model",
+ "weights": "model/weights.h5"
+ },
+ "train": {
+ "batch": 100,
+ "decay_adam": 1e-6,
+ "epochs": 150,
+ "learning_rate_adam": 1e-4,
+ "val_steps": 10
+ },
+ "rpi4": {
+ "freezing_log_dir": "model/freezing",
+ "frozen": "frozen.pb",
+ "ir": "model/ir/frozen.xml",
+ "inScaleFactor": 0.007843,
+ "meanVal": 0
+ }
+}
\ No newline at end of file
diff --git a/docs/getting-started.md b/docs/getting-started.md
new file mode 100644
index 0000000..45efef7
--- /dev/null
+++ b/docs/getting-started.md
@@ -0,0 +1,73 @@
+# Getting Started
+
+![HIAS Bluetooth IoT Agent](img/HIAS-Bluetooth-IoT-Agent.jpg)
+
+# Table Of Contents
+
+- [Introduction](#introduction)
+- [Installation](#installation)
+- [Start the Agent](#start-the-agent)
+- [Manage the Agent](#manage-the-agent)
+- [Contributing](#contributing)
+ - [Contributors](#contributors)
+- [Versioning](#versioning)
+- [License](#license)
+- [Bugs/Issues](#bugs-issues)
+
+
+
+# Introduction
+This guide will guide you through getting started with the HIAS Bluetooth IoT Agent.
+
+
+
+# Installation
+First you need to install the required software. Below are the available installation guides:
+
+- [Ubuntu installation guide](installation/ubuntu.md)
+
+**PLEASE NOTE** At this point both **HIAS** and **HIASCDI** should be **running** and you should be able to log in to the HIAS UI.
+
+
+
+# Start the Agent
+
+Now you are ready to fire up your HIAS Bluetooth IoT Agent, to do so use the following command:
+
+``` bash
+sudo systemctl start HIAS-Bluetooth-IoT-Agent.service
+```
+
+# Manage the Agent
+
+To manage the agent you can use the following commands:
+
+``` bash
+sudo systemctl restart HIAS-Bluetooth-IoT-Agent.service
+sudo systemctl stop HIAS-Bluetooth-IoT-Agent.service
+```
+
+
+
+# Contributing
+Asociación de Investigacion en Inteligencia Artificial Para la Leucemia Peter Moss encourages and welcomes code contributions, bug fixes and enhancements from the Github community.
+
+Please read the [CONTRIBUTING](https://github.com/AIIAL/HIAS-Bluetooth-IoT-Agent/blob/main/CONTRIBUTING.md "CONTRIBUTING") document for a full guide to forking our repositories and submitting your pull requests. You will also find information about our code of conduct on this page.
+
+## Contributors
+- [Adam Milton-Barker](https://www.leukemiaairesearch.com/association/volunteers/adam-milton-barker "Adam Milton-Barker") - [Asociación de Investigacion en Inteligencia Artificial Para la Leucemia Peter Moss](https://www.leukemiaresearchassociation.ai "Asociación de Investigacion en Inteligencia Artificial Para la Leucemia Peter Moss") President/Founder & Lead Developer, Sabadell, Spain
+
+
+
+# Versioning
+We use SemVer for versioning.
+
+
+
+# License
+This project is licensed under the **MIT License** - see the [LICENSE](https://github.com/AIIAL/HIAS-Bluetooth-IoT-Agent/blob/main/LICENSE "LICENSE") file for details.
+
+
+
+# Bugs/Issues
+We use the [repo issues](https://github.com/AIIAL/HIAS-Bluetooth-IoT-Agent/issues "repo issues") to track bugs and general requests related to using this project. See [CONTRIBUTING](https://github.com/AIIAL/HIAS-Bluetooth-IoT-Agent/CONTRIBUTING.md "CONTRIBUTING") for more info on how to submit bugs, feature requests and proposals.
\ No newline at end of file
diff --git a/docs/img/HIAS-Bluetooth-IoT-Agent.jpg b/docs/img/HIAS-Bluetooth-IoT-Agent.jpg
new file mode 100644
index 0000000..2174bf0
Binary files /dev/null and b/docs/img/HIAS-Bluetooth-IoT-Agent.jpg differ
diff --git a/docs/img/create-hias-iotjumpway-agent.jpg b/docs/img/create-hias-iotjumpway-agent.jpg
new file mode 100644
index 0000000..a2101d0
Binary files /dev/null and b/docs/img/create-hias-iotjumpway-agent.jpg differ
diff --git a/docs/img/edit-hias-iotjumpway-agent.jpg b/docs/img/edit-hias-iotjumpway-agent.jpg
new file mode 100644
index 0000000..6434f52
Binary files /dev/null and b/docs/img/edit-hias-iotjumpway-agent.jpg differ
diff --git a/docs/img/hias-iotjumpway-agents.jpg b/docs/img/hias-iotjumpway-agents.jpg
new file mode 100644
index 0000000..0fac5ed
Binary files /dev/null and b/docs/img/hias-iotjumpway-agents.jpg differ
diff --git a/docs/index.md b/docs/index.md
new file mode 100644
index 0000000..8be0e06
--- /dev/null
+++ b/docs/index.md
@@ -0,0 +1,32 @@
+# Agent Documentation
+
+![HIAS Bluetooth IoT Agent](img/HIAS-Bluetooth-IoT-Agent.jpg)
+
+# Welcome
+
+Welcome to the **HIAS Bluetooth IoT Agent** official documentation. This documentation includes a [getting started guide](getting-started.md) and a step by step [installation guide for Ubuntu](installation/ubuntu.md).
+
+
+
+# Contributing
+Asociación de Investigacion en Inteligencia Artificial Para la Leucemia Peter Moss encourages and welcomes code contributions, bug fixes and enhancements from the Github community.
+
+Please read the [CONTRIBUTING](https://github.com/AIIAL/HIAS-Bluetooth-IoT-Agent/blob/main/CONTRIBUTING.md "CONTRIBUTING") document for a full guide to forking our repositories and submitting your pull requests. You will also find information about our code of conduct on this page.
+
+## Contributors
+- [Adam Milton-Barker](https://www.leukemiaairesearch.com/association/volunteers/adam-milton-barker "Adam Milton-Barker") - [Asociación de Investigacion en Inteligencia Artificial Para la Leucemia Peter Moss](https://www.leukemiaresearchassociation.ai "Asociación de Investigacion en Inteligencia Artificial Para la Leucemia Peter Moss") President/Founder & Lead Developer, Sabadell, Spain
+
+
+
+# Versioning
+We use SemVer for versioning.
+
+
+
+# License
+This project is licensed under the **MIT License** - see the [LICENSE](https://github.com/AIIAL/HIAS-Bluetooth-IoT-Agent/blob/main/LICENSE "LICENSE") file for details.
+
+
+
+# Bugs/Issues
+We use the [repo issues](https://github.com/AIIAL/HIAS-Bluetooth-IoT-Agent/issues "repo issues") to track bugs and general requests related to using this project. See [CONTRIBUTING](https://github.com/AIIAL/HIAS-Bluetooth-IoT-Agent/CONTRIBUTING.md "CONTRIBUTING") for more info on how to submit bugs, feature requests and proposals.
\ No newline at end of file
diff --git a/docs/installation/ubuntu.md b/docs/installation/ubuntu.md
new file mode 100644
index 0000000..dae8b77
--- /dev/null
+++ b/docs/installation/ubuntu.md
@@ -0,0 +1,152 @@
+# Ubuntu Installation
+
+![HIAS Bluetooth IoT Agent](../img/HIAS-Bluetooth-IoT-Agent.jpg)
+
+# Table Of Contents
+
+- [Introduction](#introduction)
+- [Prerequisites](#prerequisites)
+ - [HIAS Server](#hias-server)
+- [Installation](#installation)
+ - [Clone the repository](#clone-the-repository)
+ - [Developer forks](#developer-forks)
+ - [Installation Script](#installation-script)
+- [HIAS](#hias)
+ - [HIAS IoT Agent](#hias-iot-agent)
+- [Service](#service)
+- [Continue](#continue)
+- [Contributing](#contributing)
+ - [Contributors](#contributors)
+- [Versioning](#versioning)
+- [License](#license)
+- [Bugs/Issues](#bugs-issues)
+
+# Introduction
+This guide will guide you through the installation process for the HIAS Bluetooth IoT Agent.
+
+
+
+# Prerequisites
+You will need to ensure you have the following prerequisites installed and setup.
+
+## HIAS Server
+
+The HIAS Bluetooth IoT Agent is a core component of the [HIAS - Hospital Intelligent Automation Server](https://github.com/AIIAL/HIAS-Server). Before beginning this tutorial you should complete the HIAS installation guide and have a HIAS server online.
+
+
+
+# Installation
+You are now ready to install the HIAS Bluetooth IoT Agent software.
+
+## Clone the repository
+
+Clone the [HIAS Bluetooth IoT Agent](https://github.com/AIIAL/HIAS-Bluetooth-IoT-Agent " HIAS Bluetooth IoT Agent") repository from the [Asociación de Investigacion en Inteligencia Artificial Para la Leucemia Peter Moss](https://github.com/AIIAL "Asociación de Investigacion en Inteligencia Artificial Para la Leucemia Peter Moss") Github Organization.
+
+To clone the repository and install the project, make sure you have Git installed. Now navigate to your HIAS installation project root and then use the following command.
+
+``` bash
+ git clone https://github.com/AIIAL/HIAS-Bluetooth-IoT-Agent.git
+ mv HIAS-Bluetooth-IoT-Agent components/agents/hiasbcha
+```
+
+This will clone the HIAS Bluetooth IoT Agent repository and move the cloned repository to the agents directory in the HIAS project (components/agents/hiasbcha/).
+
+``` bash
+ cd components/agents/
+ ls
+```
+
+Using the ls command in your home directory should show you the following.
+
+``` bash
+ hiasbcha
+```
+
+Navigate to the **components/agents/hiasbcha/** directory in your HIAS project root, this is your project root directory for this tutorial.
+
+### Developer forks
+
+Developers from the Github community that would like to contribute to the development of this project should first create a fork, and clone that repository. For detailed information please view the [CONTRIBUTING](https://github.com/AIIAL/HIAS-Bluetooth-IoT-Agent/blob/main/CONTRIBUTING.md "CONTRIBUTING") guide. You should pull the latest code from the development branch.
+
+``` bash
+ git clone -b "2.0.0" https://github.com/AIIAL/HIAS-Bluetooth-IoT-Agent.git
+```
+
+The **-b "2.0.0"** parameter ensures you get the code from the latest master branch. Before using the below command please check our latest master branch in the button at the top of the project README.
+
+## Installation script
+
+All other software requirements are included in **scripts/install.sh**. You can run this file on your machine from the HIAS project root in terminal. Use the following command from the HIAS project root:
+
+``` bash
+ sh components/agents/hiasbcha/scripts/install.sh
+```
+
+
+
+# HIAS
+
+This device is a HIAS IoT Agent and uses the HIAS MQTT Broker to communicate with the HIAS network. To setup an IoT Agent on the HIAS network, head to the HIAS UI.
+
+The HIAS network is powered by a context broker that stores contextual data and exposes the data securely to authenticated HIAS applications and devices.
+
+Each HIAS IoT Agent has a JSON representation stored in the HIASCDI Context Broker that holds their contextual information.
+
+## HIAS IoT Agent
+
+A HIAS IoT Agent is a bridge between HIAS devices and applications, and the HIASCDI Context Broker. The IoT Agents process incoming data using a specific machine to machine communication protocol and then converting into a format compatible with HIASCDI, before sending the data to HIASCDI to update the contextual information.
+
+![HIAS IoT Agents](../img/hias-iotjumpway-agents.jpg)
+
+You will now need to create your HIASC IoT Agent and retrieve the agent credentials. Navigate to **IoT->Entities->Agents** and click on the **+** next to the **Network Agents** title to create a HIAS IoT Agent.
+
+![HIAS IoT Agent](../img/create-hias-iotjumpway-agent.jpg)
+
+Make sure to select **Bluetooth** as the protocol for your Agent. Once you have completed the form and submitted it, you can find the newly created AI Agent by navigating to **IoT->Entities->Agents** and clicking on the relevant Agent.
+
+On the HIAS IoT Agent page you will be able to update the contextual data for the agent, and also find the JSON representation.
+
+![HIAS IoT Agent](../img/edit-hias-iotjumpway-agent.jpg)
+
+You now need to download the credentials required to connect the Acute Lymphoblastic Leukemia oneAPI Classifier to the HIAS network.
+
+Click on the **Agent Credentials** section to download the credentials file. This should open your file browser, navigate to the **HIAS/components/agents/hiasbcha/configuration/** directory and save the file as **credentials.json**.
+
+
+
+# Service
+You will now create a service that will run your IoT Agent. Making sure you are in the HIAS project root, use the following command:
+
+``` bash
+sh components/agents/hiasbcha/scripts/service.sh
+```
+
+
+
+# Continue
+Now you can continue with the HIAS [getting started guide](../getting-started.md)
+
+
+
+# Contributing
+Asociación de Investigacion en Inteligencia Artificial Para la Leucemia Peter Moss encourages and welcomes code contributions, bug fixes and enhancements from the Github community.
+
+Please read the [CONTRIBUTING](https://github.com/AIIAL/HIAS-Bluetooth-IoT-Agent/blob/main/CONTRIBUTING.md "CONTRIBUTING") document for a full guide to forking our repositories and submitting your pull requests. You will also find information about our code of conduct on this page.
+
+## Contributors
+- [Adam Milton-Barker](https://www.leukemiaairesearch.com/association/volunteers/adam-milton-barker "Adam Milton-Barker") - [Asociación de Investigacion en Inteligencia Artificial Para la Leucemia Peter Moss](https://www.leukemiaresearchassociation.ai "Asociación de Investigacion en Inteligencia Artificial Para la Leucemia Peter Moss") President/Founder & Lead Developer, Sabadell, Spain
+
+
+
+# Versioning
+We use SemVer for versioning.
+
+
+
+# License
+This project is licensed under the **MIT License** - see the [LICENSE](https://github.com/AIIAL/HIAS-Bluetooth-IoT-Agent/blob/main/LICENSE "LICENSE") file for details.
+
+
+
+# Bugs/Issues
+We use the [repo issues](https://github.com/AIIAL/HIAS-Bluetooth-IoT-Agent/issues "repo issues") to track bugs and general requests related to using this project. See [CONTRIBUTING](https://github.com/AIIAL/HIAS-Bluetooth-IoT-Agent/CONTRIBUTING.md "CONTRIBUTING") for more info on how to submit bugs, feature requests and proposals.
\ No newline at end of file
diff --git a/logs/.gitkeep b/logs/.gitkeep
new file mode 100644
index 0000000..e69de29
diff --git a/mkdocs.yml b/mkdocs.yml
new file mode 100644
index 0000000..2dd5073
--- /dev/null
+++ b/mkdocs.yml
@@ -0,0 +1,8 @@
+site_name: HIAS Bluetooth IoT Agent
+site_url: https://hias-bluetooth-iot-agent.readthedocs.io/
+repo_url: https://github.com/AIIAL/HIAS-Bluetooth-IoT-Agent
+pages:
+ - Home: index.md
+ - 'Getting Started': 'getting-started.md'
+ - 'Installation':
+ - 'Ubuntu Installation Guide': 'installation/ubuntu.md'
\ No newline at end of file
diff --git a/modules/__init__.py b/modules/__init__.py
new file mode 100644
index 0000000..e69de29
diff --git a/modules/helpers.py b/modules/helpers.py
new file mode 100644
index 0000000..2faa9ba
--- /dev/null
+++ b/modules/helpers.py
@@ -0,0 +1,91 @@
+""" AI Agent Helpers file.
+
+Configuration and logging functions.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files(the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and / or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+
+Contributors:
+- Adam Milton-Barker
+
+"""
+
+import logging
+import logging.handlers as handlers
+import json
+import os
+import sys
+import time
+
+from datetime import datetime
+
+
+class helpers():
+ """ Helper Class
+
+ AI Agent helper functions.
+ """
+
+ def __init__(self, ltype, log=True):
+ """ Initializes the Helpers Class. """
+
+ # Loads system configs
+ self.confs = {}
+ self.loadConfs()
+
+ # Sets system logging
+ self.logger = logging.getLogger(ltype)
+ self.logger.setLevel(logging.INFO)
+
+ formatter = logging.Formatter(
+ '%(asctime)s - %(name)s - %(levelname)s - %(message)s')
+
+ allLogHandler = handlers.TimedRotatingFileHandler(
+ os.path.dirname(os.path.abspath(__file__)) + '/../logs/all.log', when='H', interval=1, backupCount=0)
+ allLogHandler.setLevel(logging.INFO)
+ allLogHandler.setFormatter(formatter)
+
+ errorLogHandler = handlers.TimedRotatingFileHandler(
+ os.path.dirname(os.path.abspath(__file__)) + '/../logs/error.log', when='H', interval=1, backupCount=0)
+ errorLogHandler.setLevel(logging.ERROR)
+ errorLogHandler.setFormatter(formatter)
+
+ warningLogHandler = handlers.TimedRotatingFileHandler(
+ os.path.dirname(os.path.abspath(__file__)) + '/../logs/warning.log', when='H', interval=1, backupCount=0)
+ warningLogHandler.setLevel(logging.WARNING)
+ warningLogHandler.setFormatter(formatter)
+
+ consoleHandler = logging.StreamHandler(sys.stdout)
+ consoleHandler.setFormatter(formatter)
+
+ self.logger.addHandler(allLogHandler)
+ self.logger.addHandler(errorLogHandler)
+ self.logger.addHandler(warningLogHandler)
+ self.logger.addHandler(consoleHandler)
+
+ if log is True:
+ self.logger.info("Helpers class initialization complete.")
+
+ def loadConfs(self):
+ """ Load the configuration. """
+
+ with open(os.path.dirname(os.path.abspath(__file__)) + '/../configuration/credentials.json') as credentials:
+ self.credentials = json.loads(credentials.read())
+
+ with open(os.path.dirname(os.path.abspath(__file__)) + '/../configuration/config.json') as confs:
+ self.confs = json.loads(confs.read())
diff --git a/scripts/install.sh b/scripts/install.sh
new file mode 100644
index 0000000..b808f0b
--- /dev/null
+++ b/scripts/install.sh
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+PRN="HIAS Bluetooth IoT Agent"
+FMSG="- $PRN installation terminated"
+
+read -p "? This script will install the $PRN on your device. Are you ready (y/n)? " cmsg
+
+if [ "$cmsg" = "Y" -o "$cmsg" = "y" ]; then
+ echo "- Installing $PRN"
+ pip3 install --user flask
+ pip3 install --user gevent
+ pip3 install --user psutil
+ pip3 install --user requests
+ pip3 install --user web3
+ pip3 install --user gevent
+ echo "- $PRN installed!"
+else
+ echo $FMSG;
+ exit
+fi
\ No newline at end of file
diff --git a/scripts/service.sh b/scripts/service.sh
new file mode 100644
index 0000000..3496e1a
--- /dev/null
+++ b/scripts/service.sh
@@ -0,0 +1,36 @@
+#!/bin/bash
+
+PRN="HIAS Bluetooth IoT Agent"
+PRURL="HIAS Bluetooth IoT Agent"
+PRPYPATH="HIAS/components/agents/hiasbcha/agent.py"
+FMSG="- $PRN service installation terminated"
+
+read -p "? This script will install the $PRN service on your device. Are you ready (y/n)? " cmsg
+
+if [ "$cmsg" = "Y" -o "$cmsg" = "y" ]; then
+ echo "- Installing $PRN service"
+ sudo touch "/lib/systemd/system/$PRURL.service"
+ echo "[Unit]" | sudo tee -a "/lib/systemd/system/$PRURL.service"
+ echo "Description=$PRN service" | sudo tee -a "/lib/systemd/system/$PRURL.service"
+ echo "After=multi-user.target" | sudo tee -a "/lib/systemd/system/$PRURL.service"
+ echo "After=HIASCDI.service" | sudo tee -a "/lib/systemd/system/$PRURL.service"
+ echo "" | sudo tee -a "/lib/systemd/system/$PRURL.service"
+ echo "[Service]" | sudo tee -a "/lib/systemd/system/$PRURL.service"
+ echo "User=$USER" | sudo tee -a "/lib/systemd/system/$PRURL.service"
+ echo "Type=simple" | sudo tee -a "/lib/systemd/system/$PRURL.service"
+ echo "Restart=on-failure" | sudo tee -a "/lib/systemd/system/$PRURL.service"
+ echo "ExecStart=/usr/bin/python3 /home/$USER/$PRPYPATH" | sudo tee -a "/lib/systemd/system/$PRURL.service"
+ echo "" | sudo tee -a "/lib/systemd/system/$PRURL.service"
+ echo "[Install]" | sudo tee -a "/lib/systemd/system/$PRURL.service"
+ echo "WantedBy=multi-user.target" | sudo tee -a "/lib/systemd/system/$PRURL.service"
+ echo "" | sudo tee -a "/lib/systemd/system/$PRURL.service"
+
+ sudo systemctl enable $PRURL.service
+ sudo systemctl start $PRURL.service
+
+ echo "- Installed $PRN service!";
+ exit 0
+else
+ echo $FMSG;
+ exit 1
+fi
\ No newline at end of file