Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alexa control #3

Closed
csph opened this issue Feb 3, 2018 · 17 comments
Closed

Alexa control #3

csph opened this issue Feb 3, 2018 · 17 comments

Comments

@csph
Copy link

csph commented Feb 3, 2018

Hi, I dont know if it is an issue or if I do a mistake.

I just set up my ESP8266 with your basic HTTP OTA updater installing the wled05dev_1801102_RGB_ESP8266.bin, wich was quite easy. Thumbs up!

After this I typed in my wifi data and everything seems to work. (I haven't connected my LED's yet).

But when I search for new devices with my echo dot, it cant find the esp8266.
The option "Emulate Alexa device" is on.
Do I have to activate a skill or so?

@Aircoookie
Copy link
Owner

Hi @Master-P96 ,

thank you for trying out my software! 😄 Awesome you had no troubles with the installation!

The Alexa integration works without a skill. Please check first if the settings field "Alexa Invocation Name" is filled with the device name you want it to have. Please reset the ESP once, because Alexa Emulation will only work after a reboot. Also make sure your router has UPnP enabled or try searching via the Alexa app or multiple times. This may help :)

If that doesn't help, may I ask what ESP8266 board you are using (ESP-01, wemos d1, Nodemcu, ...)? The binaries should work for all ESPs but we could make sure that is not the problem by compiling a binary just for your board.

Hope I'm able to help!
-Aircoookie

@csph
Copy link
Author

csph commented Feb 4, 2018

Thank you for your fast reply :)
I just connected my LED's and it works fantastic! Very nice work.

But back to my issue:
Alexa Invocation Name is filled (I also changed the name several times).
Resetting and multiple times of searching for a device did not solve the problem.
I have a FritzBox 7580 with UPnP enabled.
Does an update with the integrated updatefunction (upload the bin) count as a "fresh" installation?

I use an NodeMCU Lolin V3.

Thanks for your help!

@Aircoookie
Copy link
Owner

I'm so happy you like my work :)

Here is a recent binary compiled for your board: https://drive.google.com/file/d/1Hcw5_LpsTbWiLaXj9gFqo1kOPUwi2ZOS/view
Since everything but Alexa control seems to work fine for you though I don't know if this will solve the issue. I have also turned on serial debug for this build. If you open the Arduino IDE serial monitor and ask Alexa to discover devices, it should normally flood it with debug data like "AlexaApiCall".

When I tried it myself again today, Alexa said she found no new devices, but voice control worked reliably anyways. To be honest, Alexa is a bit weird sometimes. It also occasionally happens that she says: "Device doesn't react. Please check power and network", but the light turns on anyways. One time though, Alexa was unable to control any device (even the ones already discovered) until I power cycled the Echo itself, then it was flawless. Strange stuff.

If that doesn't work, you could also try and use the binary "wled04_1712122_RGB.bin". It is an older version, but it uses a different way to communicate with Alexa (doesn't support dimming, just on and off, but it just might work for you)

A "fresh install" is unlikely to solve anything. Just in case you'd like to try it, the software preserves your settings (Wifi, led, Alexa...) in file system memory, which means it will "survive" software updates. If you use the "ip/update" page to do a .bin update, to reset the settings, you'll also need to scroll way down in the settings page and tick the "Factory Reset" checkbox, then reboot. It will delete all settings, including your WiFi password and everything you had changed.

I really hope for you that we can fix the issue! (since I myself have ~10 ESPs running the software and pretty much only control them via Alexa, since it's so much quicker than opening the browser) Please tell me if any of my suggestions worked :)

By the way, in 1-2 weeks I'll upload a large update that will improve the looks of the web page (themes) and add a couple of new effects and features! Stay tuned for that!

@csph
Copy link
Author

csph commented Feb 4, 2018

The version you send unfortunatly doesn't fix it, also there is no reaction in the Monitor when searching with the echo.

I installed the 0.4 and the echo found the device instantly!
You have an idea what might be the problem?

But I'am happy for now, voice control is so comfortable ;)

Can't wait for the update!

@Aircoookie
Copy link
Owner

Ok, at least the 0.4 version seems to work :)

To be honest I have no idea what the problem may be... :/
Could be WLED, could be the underlying UDP or Philips hue protocol, could even be your echo...
If you want to help me find the state at which the discovery fails, run this Arduino sketch:
https://drive.google.com/open?id=1d01gRgzTIyjCRMyLydFp0IwuMjQU1YuK
It is the minimal code to get Alexa and ESP8266 connected and outputs all relevant debug data to serial.
You'd just need to put your WiFi in the strings at the top of the file, run it and then send me the entire serial output. It will also not delete your WLED settings ;)

Ah, one last question: what is the language and country you use your Echo in? May make a difference...

Thank you for your help! I hope that I can get the latest version working for you ASAP :)

@csph
Copy link
Author

csph commented Feb 5, 2018

Okay here is the output:

.
WiFi Connected to Air Force 1
IP address: 192.168.178.54
Ask Alexa to discover devices

Connecting UDP
UDP success
HTTP Server started...
Received UDP: 192.168.178.1:60369
:M-SEARCH * HTTP/1.1
HOST: 239.255.255.250:1900
MAN: "ssdp:discover"
MX: 5
ST: urn:schemas-upnp-org:device:avm-aha:1


Received UDP: 192.168.178.30:48667
:M-SEARCH * HTTP/1.1
Host: 239.255.255.250:1900
Man: "ssdp:discover"
ST: ssdp:all
MX: 5


Received UDP: 192.168.178.1:60369
:M-SEARCH * HTTP/1.1
HOST: 239.255.255.250:1900
MAN: "ssdp:discover"
MX: 5
ST: urn:schemas-upnp-org:device:avm-aha:1


Received UDP: 192.168.178.44:34746
:M-SEARCH * HTTP/1.1
HOST: 239.255.255.250:1900
MAN: "ssdp:discover"
MX: 2
ST: ssdp:all


Received UDP: 192.168.178.30:37992
:NOTIFY * HTTP/1.1
HOST:239.255.255.250:1900
CACHE-CONTROL:max-age=1810
LOCATION:http://192.168.178.30:8200/rootDesc.xml
SERVER: 3.4.6-generic Microsoft-Windows/6.1 Windows-Media-Player-DMS/12.0.7601.17514 DLNADOC/1.50 UPnP/1.0 QNAPDLNA/1.0
NT:urn:sch
Received UDP: 192.168.178.30:37992
:NOTIFY * HTTP/1.1
HOST:239.255.255.250:1900
CACHE-CONTROL:max-age=1810
LOCATION:http://192.168.178.30:8200/rootDesc.xml
SERVER: 3.4.6-generic Microsoft-Windows/6.1 Windows-Media-Player-DMS/12.0.7601.17514 DLNADOC/1.50 UPnP/1.0 QNAPDLNA/1.0
NT:urn:mic

While the output was created I made an attempt to find new devices with the echo.
The language is german.

Hope it helps you!

@Aircoookie
Copy link
Owner

Ok, an der Sprache liegt es schonmal nicht :) Danke für die Hilfe!

From what you posted it seems like your Echo doesn't send the required UDP device discovery requests. There are none in the log at least...

I did some more testings and it seems like Echo dot searches for urn:schemas-upnp-org:device:basic:1 devices while the Echo 2/Plus searches for upnp:rootdevice instead. This is very strange, but here is a new binary (which accepts both requests) that may or may not work for you:
https://drive.google.com/open?id=1aN8bO10qiLvRbGyXYBaWixOAP2nyQ46-
Please unplug and restart your Echo once again before trying it out, and don't forget to try it via the app also.

This binary should theoretically work for you if WLED 0.4 does, but at this point I can't guarantee for anything... If it doesn't, I have no idea how to fix it since the echo does not seem to send the discovery requests it is supposed to. I really wish for you that it will work though! :)

@csph
Copy link
Author

csph commented Feb 5, 2018

Well I think you fixed it!
With the new version the echo found the ESP without problems :)

Nice work mate, and thanks for the great support!
I really looking forward to the upcoming development of this project 👍

@Aircoookie
Copy link
Owner

That's perfect news! I was afraid it was not fixable, but it worked out and I'll definiately include the change in the next update :)

@csph csph closed this as completed Feb 6, 2018
@d-works42
Copy link

d-works42 commented Feb 9, 2018

Hi, this is an awesome project idea and I hope I´ll be able to get it working.
I basically have the same problem like Master-P96 while using a Adafruit huzzah and Echo Dot. Sadly i´m to stupid to get your custom binary uploaded so far... Any possibility to provide the customizes ino file?

Thank you so much for all the work you put into this!

@Aircoookie
Copy link
Owner

Hi @wcbuerste ,

I'm very happy that you like my project, really appreciate it :)

Sadly I can't offer the updated ino files yet, because I'm currently working on a big update/restructuring, which means that the sketch does not compile/work at the moment.

However, you can easily fix the problem with Alexa yourself 👍 ! Just go to the sketch tab "wled12_alexa.ino" in the top of the Arduino IDE.
Then, in that file, just replace line 37:
This:
if(request.indexOf("upnp:rootdevice") > 0) {
needs to be replaced by:
if(request.indexOf("upnp:rootdevice") > 0 || request.indexOf("device:basic:1") > 0) {

That's all there is to it. Hope this will fix the problem for you like it did for Master-P96!

I will work hard to get the new version including the fix out as soon as possible :)

Have a nice weekend! :)

@d-works42
Copy link

Hi, thank you for the fast reply. This worked like a charm, could instantly connect in the Alexa app! =)
Having some effects with a brightness that gets reseted, but will investigate when I have more time.

@Aircoookie
Copy link
Owner

Hi @Ae3NerdGod , I'm afraid to tell you that WLED's Alexa support (based on Espalexa) doesn't work without a physical Echo device unfortunately. The other devices you can control probably use cloud APIs (as in you have to activate a skill and register with the light manufacturer). WLED uses the local Philips hue API, which is only supported by Echo Speakers at the moment, not by the apps themselves.

I hope that you'll have fun with WLED despite this issue and maybe we can find a solution at some point :)

@Aircoookie
Copy link
Owner

Aircoookie commented Feb 28, 2019

Yes, if you have an Echo, you can also control the devices via the app (even when not home)!
However, I can't promise that Amazon will keep support for the local API forever...

I'd love to add Google home/assistant support, but since that is strictly cloud-only, I don't have the resources for it at the moment (would need cloud user accounts, dedicated servers, secure connections between ESP and said server...).

By the way, I recommend a Dot 3rd gen or Echo 2/3. Older gen dots may have issues with color support, so only dimming is possible in the current version. I'm working on a fix though.

@Aircoookie
Copy link
Owner

As of the latest master, color support is now also functional for previous-gen Dots!

Aircoookie pushed a commit that referenced this issue Apr 8, 2020
huksley referenced this issue in huksley/WLED May 25, 2020
N1nja98 referenced this issue in N1nja98/WLED Nov 27, 2020
profporridge pushed a commit to profporridge/WLED that referenced this issue Jan 21, 2023
softhack007 added a commit that referenced this issue Sep 8, 2023
this is a band-aid fix for random crashes when switching between presets with multiple segments - crossfade disabled.

!! adding type initializers fixed it for me on -S3, however I still see (less frequent) crashes on esp32, due to heap corruption.

It took me hours to get a meaningful stackdump:

assert failed: heap_caps_free heap_caps.c:360 (heap != NULL && "free() target pointer is outside heap areas")

Backtrace: 0x40084ee1:0x3ffb2570 0x4008e341:0x3ffb2590 0x40094709:0x3ffb25b0 0x4008534a:0x3ffb26e0 0x40094739:0x3ffb2700 0x400e9037:0x3ffb2720 0x400e917c:0x3ffb2740 0x400eaeeb:0x3ffb2760 0x40117ec5:0x3ffb27c0 0x401184ea:0x3ffb2800 0x4013509d:0x3ffb2820

  #0  0x40084ee1:0x3ffb2570 in panic_abort at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/esp_system/panic.c:402
  #1  0x4008e341:0x3ffb2590 in esp_system_abort at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/esp_system/esp_system.c:128
  #2  0x40094709:0x3ffb25b0 in __assert_func at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/newlib/assert.c:85
  #3  0x4008534a:0x3ffb26e0 in heap_caps_free at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/heap/heap_caps.c:360
      (inlined by) heap_caps_free at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/heap/heap_caps.c:345
  #4  0x40094739:0x3ffb2700 in free at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/newlib/heap.c:39
  #5  0x400e9037:0x3ffb2720 in Segment::deallocateData() at wled00/FX_fcn.cpp:189
  #6  0x400e917c:0x3ffb2740 in Segment::resetIfRequired() at wled00/FX_fcn.cpp:206
      (inlined by) Segment::resetIfRequired() at wled00/FX_fcn.cpp:203
  #7  0x400eaeeb:0x3ffb2760 in WS2812FX::service() at wled00/FX_fcn.cpp:1216 (discriminator 2)
  #8  0x40117ec5:0x3ffb27c0 in WLED::loop() at wled00/wled.cpp:115 (discriminator 3)
  #9  0x401184ea:0x3ffb2800 in loop() at C:/src/wled00/wled00.ino:20
  #10 0x4013509d:0x3ffb2820 in loopTask(void*) at C:/Users/user/.platformio/packages/framework-arduinoespressif32/cores/esp32/main.cpp:50

ELF file SHA256: 18c20b536f4c6ef4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants
@d-works42 @Aircoookie @csph and others