diff --git a/bin/wled05dev_1712200_CRONIXIE_dont_use_for_regular_strip.bin b/bin/wled05dev_1801092_CRONIXIE_dont_use_for_regular_strip.bin similarity index 51% rename from bin/wled05dev_1712200_CRONIXIE_dont_use_for_regular_strip.bin rename to bin/wled05dev_1801092_CRONIXIE_dont_use_for_regular_strip.bin index acabf7a8..e0be8a3f 100644 Binary files a/bin/wled05dev_1712200_CRONIXIE_dont_use_for_regular_strip.bin and b/bin/wled05dev_1801092_CRONIXIE_dont_use_for_regular_strip.bin differ diff --git a/bin/wled05dev_1712200_RGB.bin b/bin/wled05dev_1801092_RGB.bin similarity index 51% rename from bin/wled05dev_1712200_RGB.bin rename to bin/wled05dev_1801092_RGB.bin index 5ab9ccb7..6dfcd406 100644 Binary files a/bin/wled05dev_1712200_RGB.bin and b/bin/wled05dev_1801092_RGB.bin differ diff --git a/bin/wled05dev_1712200_RGBW.bin b/bin/wled05dev_1801092_RGBW.bin similarity index 51% rename from bin/wled05dev_1712200_RGBW.bin rename to bin/wled05dev_1801092_RGBW.bin index d86b4240..9b28befc 100644 Binary files a/bin/wled05dev_1712200_RGBW.bin and b/bin/wled05dev_1801092_RGBW.bin differ diff --git a/wled00/data/settings.htm b/wled00/data/settings.htm index 3b34cea4..7b551c88 100644 --- a/wled00/data/settings.htm +++ b/wled00/data/settings.htm @@ -97,7 +97,7 @@ Alexa invocation name:
Send Alexa notifications:

Time (experimental!)

- NTP was updated but still causes crashes. Requires reboot.
+ Requires reboot.
Get time from NTP server:
Current local time is unknown

Advanced

@@ -118,8 +118,8 @@ HTTP traffic is not encrypted. An attacker in the same network could intercept form data!

About

- WLED version 0.4p
- (c) 2016-2017 Christian Schwinne
+ WLED version 0.5dev
+ (c) 2016-2018 Christian Schwinne
Licensed under the MIT license

Uses libraries:
ESP8266 Arduino Core
diff --git a/wled00/htmls01.h b/wled00/htmls01.h index bbc2428e..7543e923 100644 --- a/wled00/htmls01.h +++ b/wled00/htmls01.h @@ -96,7 +96,7 @@ Emulate Alexa device:
Alexa invocation name:
Send Alexa notifications:

Time (experimental!)

-NTP was updated but still causes crashes. Requires reboot.
+Requires reboot.
Get time from NTP server:
Current local time is unknown

Advanced

@@ -116,8 +116,8 @@ Factory reset:
All EEPROM content (settings) will be erased.

HTTP traffic is not encrypted. An attacker in the same network could intercept form data!

About

-WLED version 0.4p
-(c) 2016-2017 Christian Schwinne
+WLED version 0.5dev
+(c) 2016-2018 Christian Schwinne
Licensed under the MIT license

Uses libraries:
ESP8266 Arduino Core
diff --git a/wled00/wled00.ino b/wled00/wled00.ino index 3aa0a80c..943b4c23 100644 --- a/wled00/wled00.ino +++ b/wled00/wled00.ino @@ -22,7 +22,7 @@ #include "WS2812FX.h" //version in format yymmddb (b = daily build) -#define VERSION 1801091 +#define VERSION 1801092 //AP and OTA default passwords (change them!) String appass = "wled1234"; @@ -40,7 +40,7 @@ String otapass = "wledota"; //#define USEFS //to toggle usb serial debug (un)comment following line -#define DEBUG +//#define DEBUG //Hardware-settings (only changeble via code) #define LEDCOUNT 255 //maximum, exact count set-able via settings diff --git a/wled00/wled05_init.ino b/wled00/wled05_init.ino index 43b10ab5..42275dd3 100644 --- a/wled00/wled05_init.ino +++ b/wled00/wled05_init.ino @@ -164,14 +164,13 @@ void wledInit() server.send(404, "text/plain", "FileNotFound"); } }); - alexaInit(); + //init Alexa hue emulation + if (alexaEnabled) alexaInit(); server.begin(); DEBUG_PRINTLN("HTTP server started"); // Add service to MDNS MDNS.addService("http", "tcp", 80); - //Init alexa service - alexaInit(); // Initialize NeoPixel Strip strip.init(); diff --git a/wled00/wled12_alexa.ino b/wled00/wled12_alexa.ino index b104b628..6ba52add 100644 --- a/wled00/wled12_alexa.ino +++ b/wled00/wled12_alexa.ino @@ -1,6 +1,10 @@ -void alexaOn(); -void alexaOff(); -void alexaDim(); +/* + * Alexa Voice On/Off/Brightness Control. Emulates a Philips Hue bridge to Alexa. + * + * This was put together from these two excellent projects: + * https://github.com/kakopappa/arduino-esp8266-alexa-wemo-switch + * https://github.com/probonopd/ESP8266HueEmulator + */ void alexaInit() { @@ -31,7 +35,7 @@ void handleAlexa() if(request.indexOf("M-SEARCH") >= 0) { if(request.indexOf("upnp:rootdevice") > 0) { - Serial.println("Responding search req..."); + DEBUG_PRINTLN("Responding search req..."); respondToSearch(); } } @@ -54,8 +58,8 @@ void alexaOn() server.send(200, "text/xml", body.c_str()); - Serial.print("Sending :"); - Serial.println(body); + DEBUG_PRINT("Sending :"); + DEBUG_PRINTLN(body); } void alexaOff() @@ -72,8 +76,8 @@ void alexaOff() server.send(200, "application/json", body.c_str()); - Serial.print("Sending:"); - Serial.println(body); + DEBUG_PRINT("Sending:"); + DEBUG_PRINTLN(body); } void alexaDim(uint8_t briL) @@ -94,11 +98,11 @@ void prepareIds() { } void respondToSearch() { - Serial.println(""); - Serial.print("Send resp to "); - Serial.println(UDP.remoteIP()); - Serial.print("Port : "); - Serial.println(UDP.remotePort()); + DEBUG_PRINTLN(""); + DEBUG_PRINT("Send resp to "); + DEBUG_PRINTLN(UDP.remoteIP()); + DEBUG_PRINT("Port : "); + DEBUG_PRINTLN(UDP.remotePort()); IPAddress localIP = WiFi.localIP(); char s[16]; @@ -119,13 +123,13 @@ void respondToSearch() { UDP.write(response.c_str()); UDP.endPacket(); - Serial.println("Response sent!"); + DEBUG_PRINTLN("Response sent!"); } void alexaInitPages() { server.on("/description.xml", HTTP_GET, [](){ - Serial.println(" # Responding to description.xml ... #\n"); + DEBUG_PRINTLN(" # Responding to description.xml ... #\n"); IPAddress localIP = WiFi.localIP(); char s[16]; @@ -168,25 +172,25 @@ void alexaInitPages() { server.send(200, "text/xml", setup_xml.c_str()); - Serial.print("Sending :"); - Serial.println(setup_xml); + DEBUG_PRINT("Sending :"); + DEBUG_PRINTLN(setup_xml); }); // openHAB support server.on("/on.html", HTTP_GET, [](){ - Serial.println("on req"); + DEBUG_PRINTLN("on req"); server.send(200, "text/plain", "turned on"); alexaOn(); }); server.on("/off.html", HTTP_GET, [](){ - Serial.println("off req"); + DEBUG_PRINTLN("off req"); server.send(200, "text/plain", "turned off"); alexaOff(); }); server.on("/status.html", HTTP_GET, [](){ - Serial.println("Got status request"); + DEBUG_PRINTLN("Got status request"); String statrespone = "0"; if (bri > 0) { @@ -236,17 +240,17 @@ boolean handleAlexaApiCall(String req, String body) //basic implementation of Ph return true; } - if (req.indexOf("lights/2") > 0) //client wants pointless light info + /*if (req.indexOf("lights/2") > 0) //client wants pointless light info { DEBUG_PRINTLN("l2"); server.send(200, "application/json", "{\"manufacturername\":\"OpenSource\",\"modelid\":\"LST001\",\"name\":\""+ alexaInvocationName +"\",\"state\":{\"on\":"+ boolString(bri) +",\"hue\":0,\"bri\":"+ briForHue(bri) +",\"sat\":0,\"xy\":[0.00000,0.00000],\"ct\":500,\"alert\":\"none\",\"effect\":\"none\",\"colormode\":\"hs\",\"reachable\":true},\"swversion\":\"0.1\",\"type\":\"Extended color light\",\"uniqueid\":\"3\"}"); return true; - } + }*/ if (req.indexOf("lights") > 0) //client wants all lights { DEBUG_PRINTLN("lAll"); - server.send(200, "application/json", "{\"1\":{\"type\":\"Extended color light\",\"manufacturername\":\"OpenSource\",\"swversion\":\"0.1\",\"name\":\""+ alexaInvocationName +"\",\"uniqueid\":\""+ WiFi.macAddress() +"-1\",\"modelid\":\"LST001\",\"state\":{\"on\":"+ boolString(bri) +",\"bri\":"+ briForHue(bri) +",\"xy\":[0.00000,0.00000],\"colormode\":\"hs\",\"effect\":\"none\",\"ct\":500,\"hue\":0,\"sat\":0,\"alert\":\"none\",\"reachable\":true}},\"1\":{\"type\":\"Extended color light\",\"manufacturername\":\"OpenSource\",\"swversion\":\"0.1\",\"name\":\""+ alexaInvocationName +"\",\"uniqueid\":\""+ WiFi.macAddress() +"-2\",\"modelid\":\"LST001\",\"state\":{\"on\":"+ boolString(bri) +",\"bri\":"+ briForHue(bri) +",\"xy\":[0.00000,0.00000],\"colormode\":\"hs\",\"effect\":\"none\",\"ct\":500,\"hue\":0,\"sat\":0,\"alert\":\"none\",\"reachable\":true}}}"); + server.send(200, "application/json", "{\"1\":{\"type\":\"Extended color light\",\"manufacturername\":\"OpenSource\",\"swversion\":\"0.1\",\"name\":\""+ alexaInvocationName +"\",\"uniqueid\":\""+ WiFi.macAddress() +"-2\",\"modelid\":\"LST001\",\"state\":{\"on\":"+ boolString(bri) +",\"bri\":"+ briForHue(bri) +",\"xy\":[0.00000,0.00000],\"colormode\":\"hs\",\"effect\":\"none\",\"ct\":500,\"hue\":0,\"sat\":0,\"alert\":\"none\",\"reachable\":true}}}"); //,\"1\":{\"type\":\"Extended color light\",\"manufacturername\":\"OpenSource\",\"swversion\":\"0.1\",\"name\":\""+ alexaInvocationName +"\",\"uniqueid\":\""+ WiFi.macAddress() +"-2\",\"modelid\":\"LST001\",\"state\":{\"on\":"+ boolString(bri) +",\"bri\":"+ briForHue(bri) +",\"xy\":[0.00000,0.00000],\"colormode\":\"hs\",\"effect\":\"none\",\"ct\":500,\"hue\":0,\"sat\":0,\"alert\":\"none\",\"reachable\":true}}}"); return true; } @@ -259,15 +263,15 @@ boolean handleAlexaApiCall(String req, String body) //basic implementation of Ph boolean connectUDP(){ boolean state = false; - Serial.println(""); - Serial.println("Con UDP"); + DEBUG_PRINTLN(""); + DEBUG_PRINTLN("Con UDP"); if(UDP.beginMulticast(WiFi.localIP(), ipMulti, portMulti)) { - Serial.println("Con success"); + DEBUG_PRINTLN("Con success"); state = true; } else{ - Serial.println("Con failed"); + DEBUG_PRINTLN("Con failed"); } return state;