Skip to content

Quick Start

Faisal Thaheem edited this page Jun 18, 2019 · 4 revisions

This guide was prepared on Ubuntu 16.04

To quickly setup the system using docker, follow these steps

Setting up message broker, db & node red containers

  1. Install docker Docker for linux
  2. Install docker-compose Docker Compose Installation
  3. Clone the repository Machine Learnt Air Conditioning
  4. Issue the docker-compose up command in docker folder of the repository root
  5. Once docker is done launching all the containers, navigate to http://ip:1880 (where ip is the ip address of the host) and click on the hamburger icon. We are going to import some modules before we can import the actual flows. Goto settings -> palette -> install and search and install the following modules `
  • node-red-contrib-mongodb2
  • node-red-contrib-fsm
  • node-red-contrib-aggregator
  • node-red-node-openweathermap
  • node-red-dashboard `
  1. open "nodered/all-flows.json" using any text editor and copy all the contents to clipboard. Navigate to http://ip:1880 and click on the hamburger icon, then click on import -> clipboard and paste the content here, then click import and wait for all the flows to be imported.
  2. Delete any empty flows by clicking on hamburger -> flows -> delete with having the empty flow selected.
  3. Finally, click deploy.

Setting up application containers

  1. goto ml/docker and chmod +x build.images.sh and run.sh
  2. download and place the wheel at ml/docker/deps from tensorflow 1.4 wheel
  3. execute build.image.sh and wait for the process to complete
  4. issue the following command to launch the learning and inferring process container
docker run -d -p 5000:5000 --name ltrest \
-e mongodbhost=127.0.0.1 \
--restart unless-stopped \
faisalthaheem/lt-rest:1.0

Setting up the mobile app

The mobile app plays a crucial role by learning user preferences about thermostat and power state. The app itself is generic as it utilizes the rest services exposed by the node red flows, but the actual commands which are specific to the make and model of the air conditioner vary and are currently encoded in the flows for Sharp Air conditioner with remote model (sharp-crmc-a863jbez) mobile app

For the sake of demo you can use the built apk which ships as part of this repository or compile your own. The compiled binary is available at https://github.com/faisalthaheem/machine-learnt-air-conditioning/tree/master/ac-sharp-controller/ac-sharp-controller/bin/Android/Debug

Or if you would like to compile the application yourself you can install ionic framework and android sdk to compile.

At this stage all necessary software is up and running, proceed to building the hardware modules and switch them on once ready to let the system start learning

Clone this wiki locally