Skip to content

Chrizey91/LightControl

Repository files navigation

LightControl

An easy to use smart light bundle with an Android app and Arduino firmware

Hardware

For the Android app you need an Android device with enabled developer mode. To find out how to do that search for developer mode <your phone name> in Google (this won't be neccessary in the future).

For the WiFi chip the ESP-01 was used in our case. But in theory any WiFi chip that is compatible with the ESP8266 Arduino Core should work.

Installation

First things first: Clone the repository:

git clone https://github.com/Chrizey91/LightControl.git

As this project consists of two parts (the Android app and the ESP firmware) there are two things you need to install if you want to get the full experience.

ESP firmware

To install the ESP firmware, you need to have the Arduino IDE installed.

So first, download and install the latest supported version of the Arduino IDE for the ESP from the official Ardiono website here. The latest supported version for ESP can be seen here. This thing is like Eclipse or IntelliJ. You will code your firmware in here.

Then, add and install the ESP8266 Arduino core (at least version 2.5.2). Install instructions can be found here. This is a conglomerate of libraries specifically designed for the ESP8266 chip of which we will take heavy use of.

Careful if using PUYA-flash memory on the ESP

Begin PUYA-fix

Go into the folder you installed the ESP-library to. The default is at C:\Users\<User>\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2. Here, create a file and name it platform.local.txt. Then, add the following two lines into that file:

compiler.c.extra_flags=-DPUYA_SUPPORT=1
compiler.cpp.extra_flags={compiler.c.extra_flags}

PUYA-fix end

(Re)start your Arduino IDE and choose Generic ESP8266 Module under Tools->Board and load the firmware called ESP_Firmware.ino, which you will find at ESP_Firmware\ESP_Firmware.ino.

Adjust the settings of your Arduino IDE as depicted in the following image:

ArduinoSettings

To find out which Port to use, go into your Device-Manager and expand the COM & LPT section. Then plug in your ESP device and see which COM Port ist assigned to it. In the following gif you see that my ESP got assigned the COM Port 4, so I chose COM4 in my Arduino IDE settings.

COM-Port

Now simply put your ESP into flashing-mode and upload your sketch to it.

Android app

In the future you will be able to download and install the apk directly as well as downloading it from the Google Play store.

Download and install Android Studio. Apparently, downloading the project into a Dropbox-folder causes problems with Arduino Studio. So try to avoid that.

Connect your android device with active developer mode to you PC.

Open up Android Studio and open this project (select the main folder to open).

You might nicht to clean/rebuild (Build->Clean Project, Build->Rebuild Project) the project or make (Build->Make Project) before running (Green arrow in the upper right) it.

Documentation

For the documentation please consider looking at the Wiki

Contributing

I am happy to accept any help in any form. The best way to contribute right now is to look at the issues or maybe even write to me dirictly. It is just a small project, so I will probably answer. :)

ESP firmware

My knowledge about firmware programming is very limited (yet). So any help here is appreciated.

Especially the SSL-stuff and app-to-firmware communication can be improved a lot, I guess.

Android app

There are two parts of the app. The first one is the communication, which is a bunch of classes that handle the communication between the ESP-firmware and the app. The second one is the actual app itselfe.

The communication part could need some professional eyes looked upon in regards to safety and robustness. I worke myself into it a while ago but I am far of an expert to grade the current concept. Especially concerning the SSL stuff.

The app itselfe needs a lot of graphics (like images for the buttons and icons etc). I am not a graphic designer and in general very bad at it. So I am happy to get any pull requests regarding designs. Also checking the Android app conventions would be a big help. I tried to abide to them.

General

Beside programming, there is the Wiki, commenting of the code and giving suggestions on what to do next. So if you aren't a programmer, you can still contribute. Especially when you are able to create nice graphics. If you look at the graphics in the Wiki, you will immediately see that there is some improvement to make.

License and credits

Arduino IDE is developed and maintained by the Arduino team. The IDE is licensed under GPL.

The firmware and android app in this git are licensed under the MIT License.

About

An easy to use smart light bundle with an Android app and Arduino firmware

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published