Home - GhostBusters-APM/GhostHouse GitHub Wiki

Welcome to the GhostHouse wiki!

Description

This project attempts to create an Android app to control Iot stuff using augmented reality, the main features are the following:

  1. Identify a home device when focusing with the camera and displaying information on top of it
  2. Control the device with augmented reality
  3. Record de device data on the internet and see it on the phone

High Level Architecture

Architecture

Members and Roles

  • Alfonso Landin Piñeiro - Device Comunication
  • Javier Osa Pérez - Social Media & API
  • Alejandro Peral Taboada - CEO
  • César Miguel Santiago Nuñez - Sensors & Hardware
  • Raúl Santoveña Gómez - Augmented Reality UX
  • Brais Rey Souto - Standar UX

State of art


Functionalities

Screens

Mockup

Login Screen

  • Google Auth

Home Screen

  • Device List
  • Show if direct conection
  • Add new Device

Device Details Screen

  • Show device details
  • Edit / Remove
  • Device Control buttons

New Device Screen

  • Insert device params

User Screen

  • Logout
  • Profile

Historic Screen

  • Energy consumption chart

AR Screen

  • Detect device
  • Control Device

Devices Tablet Screen

  • Home Screen + Device Details Screen

Screens and services

Interactions

The three main services are:

  • Service Discovery - allows the app to detect the different iot devices inside a network
  • Service Controller - allows the app to interact with a device in the same network or through the Internet
  • Service Cloud - allows the app to get data from the cloud server

Data Storage

The fact that the IoT devices can generate data when the phone is not in reach raises the need to store said data in the cloud. In the backend information about the devices of the different user as well as the data these devices generate is stored. This has the side effect of allowing the user to use different phones to control her devices, providing a better experience for the user. This storage requirements are met with the following solution:

  • Data is stored in the cloud using a RDB and the main entities are the devices and their power draw across time.
  • In the phone there is a copy of the user's data. As the data is already stored in a relational database it was decided to use the same structure to store this copy, using a Room Database. This also allows us to meet the requirements of the AR library, that need the data in a permanent storage, which implies the option of caching the data in main memory once retrieved from the backend was a non go from the beginning.

Media

The application doesn't need any other media resources rather than the back camera

  • The AR library needs access to the camera but it does not save any capture

Cloud

Cloud

IoT

This project use a Sonoff POW to control the diferent devices an get a consumption measurement.

Libraries used

  • TimeLib
  • ESP8266
  • ESP8266WiFi
  • WiFiUdp
  • NTPClient
  • ArduinoJson
  • PubSubClient
  • Time
  • Timezone
  • MQTT
  • uMQTTBroker
  • ESP8266HTTPClient
  • HLW8012

Preparation to compile and load the code

In this case we use the Arduino IDE to code and compile, and a FTDI to load it in the Sonoff POW, conecting it as in the images:

FTDI

Sonoff