Skip to content

Commit

Permalink
Merged latest features from 'sidoh/v1.7.0' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
bombcheck committed Mar 11, 2018
2 parents 8e421aa + dd74c22 commit 40eb7d5
Show file tree
Hide file tree
Showing 24 changed files with 521 additions and 1,676 deletions.
23 changes: 17 additions & 6 deletions .build_web.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from shutil import copyfile
from subprocess import check_output
from subprocess import check_output, CalledProcessError
import sys
import os
import platform
Expand All @@ -20,14 +20,25 @@ def build_web():
os.chdir("web")
print("Attempting to build webpage...")
try:
print check_output(["npm", "install"])
print check_output(["node_modules/.bin/gulp"])
if platform.system() == "Windows":
print check_output(["npm.cmd", "install", "--only=dev"])
print check_output(["node_modules\\.bin\\gulp.cmd"])
else:
print check_output(["npm", "install"])
print check_output(["node_modules/.bin/gulp"])
copyfile("build/index.html.gz.h", "../dist/index.html.gz.h")

except OSError as e:
print "Encountered error OSError building webpage:", e
if e.filename:
print "Filename is", e.filename
print "WARNING: Failed to build web package. Using pre-built page."
except CalledProcessError as e:
print e.output
print "Encountered error CalledProcessError building webpage:", e
print "WARNING: Failed to build web package. Using pre-built page."
except Exception as e:
print "Encountered error building webpage: ", e
print "Encountered error", type(e).__name__, "building webpage:", e
print "WARNING: Failed to build web package. Using pre-built page."
pass
finally:
os.chdir("..");

Expand Down
20 changes: 19 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ You can find pre-compiled firmware images on the [releases](https://github.com/b

This project uses [WiFiManager](https://github.com/tzapu/WiFiManager) to avoid the need to hardcode AP credentials in the firmware.

When the ESP powers on, you should be able to see a network named "ESPXXXXX", with XXXXX being an identifier for your ESP. Connect to this AP and a window should pop up prompting you to enter WiFi credentials.
When the ESP powers on, you should be able to see a network named "ESPXXXXX", with XXXXX being an identifier for your ESP. Connect to this AP and a window should pop up prompting you to enter WiFi credentials. If your board has a built-in LED (or you wire up an LED), it will [flash to indicate the status](#led-status).

The network password is "**milightHub**".

Expand All @@ -89,6 +89,19 @@ The HTTP endpoints (shown below) will be fully functional at this point. You sho

![Web UI](http://imgur.com/XNNigvL.png)

## LED Status

Some ESP boards have a built-in LED, on pin #2. This LED will flash to indicate the current status of the hub:

* Fast flash (on/off once per second) means the Wifi is not configured. See [Configure Wifi](#configure-wifi) to configure the hub.
* Occasional blips of light (a flicker of light every 1.5 seconds) means the hub is on wifi and ready to operate.
* Rapid blips of light for brief periods (three rapid flashes) means packets are either detected from a device or are being sent to a device.
* Solid light means the Wifi waited to be configured and gave up, or something went wrong with wifi configuration.

You can configure the LED pin from the web console. Note that pin means the GPIO number, not the D number ... for example, D2 is actually GPIO4 and therefore its pin 4. If you specify the pin as a negative number, it will reverse the LED (the built-in LED on pin 2 is reversed, so the default is -2).

If you want to wire up your own LED on a pin, such as on D2/GPIO4, put a wire from D2 to one side of a 220 ohm resister. On the other side, connect it to the positive side (the longer wire) of a 3.3V LED. Then connect the negative side of the LED (the shorter wire) to ground. If you use a different voltage LED, or a high current LED, you will need to add a driver circuit.

## REST endpoints

1. `GET /`. Opens web UI.
Expand Down Expand Up @@ -234,3 +247,8 @@ You can select between versions 5 and 6 of the UDP protocol (documented [here](h
## Acknowledgements

* @WoodsterDK added support for LT8900 radios.



[info-license]: https://github.com/sidoh/esp8266_milight_hub/blob/master/LICENSE
[shield-license]: https://img.shields.io/badge/license-MIT-blue.svg
4 changes: 2 additions & 2 deletions dist/index.html.gz.h

Large diffs are not rendered by default.

36 changes: 0 additions & 36 deletions lib/ESP8266WebServer/keywords.txt

This file was deleted.

9 changes: 0 additions & 9 deletions lib/ESP8266WebServer/library.properties

This file was deleted.

Loading

0 comments on commit 40eb7d5

Please sign in to comment.