Aircoookie/Espalexa

Alexa - Device is not responding

Closed this issue · 1 comments

I am using ESP32 PICO and your sketch EspAlexaFullyFeatured, I changed the device names to LampOne, LampTwo, LampThree - all devices are discovered with Alexa and the status from the internal web server looks ok

#define ESPALEXA_DEBUG
#define ESPALEXA_MAXDEVICES 3

void loop()
{
espalexa.loop();
if(WiFi.status() != WL_CONNECTED){
Serial.println("Lost WiFi connection");
connectWifi();
}
delay(1);
}

Hello from Espalexa!

Value of device 1 (LampOne): 0 (Dimmable light)
Value of device 2 (LampTwo): 0 (Dimmable light)
Value of device 3 (LampThree): 0 (Dimmable light)

Free Heap: 260524
Uptime: 68098

Espalexa library v2.4.7 by Christian Schwinne 2020

Serial Output
15:57:29.233 -> Connecting to WiFi
15:57:29.233 -> Connecting..............
15:57:34.806 -> Connected to XXXXX
15:57:34.806 -> IP address: 192.168.1.95
15:57:34.806 -> Constructing device 1
15:57:34.806 -> Adding device 1
15:57:34.806 -> Constructing device 2
15:57:34.806 -> Adding device 2
15:57:34.806 -> Constructing device 3
15:57:34.806 -> Adding device 3
15:57:34.806 -> Espalexa Begin...
15:57:34.806 -> MAXDEVICES 3
15:57:34.806 -> Done
15:57:38.594 -> Got UDP!

The issue is that I have to ask Alexa twice to turn any of the lamps on. And after approx 30mins
I'm back to square one again

The first time I get
16:03:07.993 -> Got UDP!
16:03:07.993 -> M-SEARCH * HTTP/1.1
16:03:07.993 -> HOST: 239.255.255.250:1900
16:03:07.993 -> ST: ssdp:all
16:03:07.993 -> MAN: "ssdp:discover"
16:03:07.993 -> MX: 3
16:03:07.993 ->
16:03:07.993 ->
16:03:07.993 -> Responding search req...
16:03:07.993 -> Got UDP!
16:03:07.993 -> M-SEARCH * HTTP/1.1
16:03:07.993 -> HOST: 239.255.255.250:1900
16:03:07.993 -> ST: upnp:rootdevice
16:03:07.993 -> MAN: "ssdp:discover"
16:03:07.993 -> MX: 3
16:03:07.993 ->
16:03:07.993 ->
16:03:07.993 -> Responding search req...
16:03:07.993 -> Got UDP!
16:03:07.993 -> M-SEARCH * HTTP/1.1
16:03:07.993 -> HOST: 239.255.255.250:1900
16:03:07.993 -> ST: ssdp:all
16:03:07.993 -> MAN: "ssdp:discover"
16:03:07.993 -> MX: 3
16:03:07.993 ->
16:03:07.993 ->
16:03:07.993 -> Responding search req...
16:03:07.993 -> Got UDP!
16:03:07.993 -> M-SEARCH * HTTP/1.1
16:03:07.993 -> HOST: 239.255.255.250:1900
16:03:07.993 -> ST: upnp:rootdevice
16:03:07.993 -> MAN: "ssdp:discover"
16:03:07.993 -> MX: 3
16:03:07.993 ->
16:03:07.993 ->
16:03:07.993 -> Responding search req...
16:03:07.993 -> Got UDP!
16:03:07.993 -> M-SEARCH * HTTP/1.1
16:03:07.993 -> HOST: 239.255.255.250:1900
16:03:07.993 -> ST: ssdp:all
16:03:07.993 -> MAN: "ssdp:discover"
16:03:07.993 -> MX: 3
16:03:07.993 ->
16:03:07.993 ->
16:03:07.993 -> Responding search req...
16:03:07.993 -> Got UDP!
16:03:07.993 -> M-SEARCH * HTTP/1.1
16:03:07.993 -> HOST: 239.255.255.250:1900
16:03:07.993 -> ST: upnp:rootdevice
16:03:07.993 -> MAN: "ssdp:discover"
16:03:07.993 -> MX: 3
16:03:07.993 ->
16:03:07.993 ->
16:03:07.993 -> Responding search req...
16:03:07.993 -> Got UDP!
16:03:07.993 -> Got UDP!
16:03:08.204 -> Got UDP!

the second attempt is successful
16:06:03.091 -> Got UDP!
16:06:05.773 -> Not-Found HTTP call:
16:06:05.773 -> URI: /api/2WLEDHardQrI3WHYTHoMcXHgEspsM8ZZRpSKtBQr/lights/67347779/state
16:06:05.773 -> Body: {"on":true}
16:06:05.773 -> AlexaApiCall
16:06:05.773 -> ok
16:06:05.773 -> ls67347779
16:06:05.773 -> 3
16:06:05.773 -> Three changed to ON
16:06:05.810 -> Not-Found HTTP call:
16:06:05.810 -> URI: /api/2WLEDHardQrI3WHYTHoMcXHgEspsM8ZZRpSKtBQr/lights/67347779
16:06:05.810 -> Body:
16:06:05.810 -> AlexaApiCall
16:06:05.810 -> ok
16:06:05.810 -> l67347779
16:06:05.810 -> 3
16:06:07.606 -> Got UDP!

Seems this version is very cpu cycle dependant!, fixed this issue by removing the delay(1) function in the example sketch and by adding multiple espalexa.loop() in my sketch run loops.
Alan