vintlabs / fauxmoESP

Add voice control of your ESP32 and ESP8266 devices using Amazon Alexa
MIT License
383 stars 69 forks source link

Connecting and immediately resets or disconnects #95

Closed pvint closed 3 years ago

pvint commented 5 years ago

Original report by Nicholas Carroll (Bitbucket: njhcarroll, GitHub: njhcarroll).


Trying to setup fauxmo with a NODMCU v1.0. Running 2.5.1 ESP8266 and 3.1.0 Fauxmo. I’m testing with the Fauxmo example sketch with just one device (Yellow) being added. I have Alexa running on Sonos One speakers and Philips Hue and Tado heating on the network. I’ve had no success connecting.

Having read comments in the issues reports I have done the following

I’ve added the following change to line 83 in the Fauxmo code

    if (request.indexOf("M-SEARCH") >= 0) {
        if ((request.indexOf("ssdp:discover") > 0) || (request.indexOf("upnp:rootdevice") > 0) || (request.indexOf("device:basic:1") > 0)) {
            _sendUDPResponse();

Have tried starting with Hue and Tado switched off. Made no difference. This evening I’ve run (with Hue and Tado on and off) with debug and get the following. I get a connected message “Client #0 connected” and then get one of two behaviours. Either it appears to reset and rerun the wifi connection or it reports handling /description.xml and then client #0 disconnected. Some debug output below. Any ideas? Thanks

Example 1: Apparently resets on connecting

20:04:15.444 -> connected with XXXX, channel 4

20:04:15.444 -> dhcp client start...

20:04:15.480 -> .........................ip:10.0.0.33,mask:255.255.255.0,gw:10.0.0.1

20:04:17.973 ->

20:04:17.973 -> [WIFI] STATION Mode, SSID: XXXX, IP address: 10.0.0.33

20:04:17.973 -> [FAUXMO] Enabled

20:04:17.973 -> [FAUXMO] UDP server started

20:04:18.006 -> [FAUXMO] Device 'yellow lamp' added as #0

20:04:19.518 -> [FAUXMO] Responding to M-SEARCH request

20:04:19.942 -> [FAUXMO] Client #0 connected

20:04:27.865 ->

20:04:27.865 -> ets Jan 8 2013,rst cause:4, boot mode:(3,6)

20:04:27.865 ->

20:04:27.865 -> wdt reset

20:04:27.865 -> load 0x4010f000, len 1384, room 16

20:04:27.899 -> tail 8

20:04:27.899 -> chksum 0x2d

20:04:27.899 -> csum 0x2d

20:04:27.899 -> vac02aff5

20:04:27.899 -> ~ld

20:04:27.932 ->

20:04:27.932 -> SDK:2.2.1(cfd48f3)/Core:2.5.1=20501000/lwIP:STABLE-2_1_2_RELEASE/glue:1.1-7-g82abda3/BearSSL:a143020

20:04:27.967 ->

20:04:27.967 ->

20:04:27.967 -> [WIFI] Connecting to XXXX scandone

20:04:27.967 -> ..scandone

20:04:28.072 -> state: 0 -> 2 (b0)

20:04:28.072 -> state: 2 -> 3 (0)

20:04:28.107 -> state: 3 -> 5 (10)

20:04:28.107 -> add 0

20:04:28.107 -> aid 2

20:04:28.107 -> cnt

Example 2: Runs xml and then disconnects

21:12:40.161 -> [FAUXMO] Responding to M-SEARCH request
21:12:40.228 -> [FAUXMO] Responding to M-SEARCH request
21:12:40.438 -> [FAUXMO] Client #0 connected
21:12:40.438 -> [FAUXMO] Handling /description.xml request
21:12:40.578 -> [FAUXMO] Client #0 disconnected
21:12:41.166 -> [FAUXMO] Responding to M-SEARCH request
21:12:41.200 -> [FAUXMO] Responding to M-SEARCH request
21:12:43.206 -> [FAUXMO] Client #0 connected
21:12:43.206 -> [FAUXMO] Handling /description.xml request
21:12:43.206 -> [FAUXMO] Client #0 disconnected
21:12:43.931 -> [MAIN] Free heap: 49232 bytes

pvint commented 4 years ago

Original comment by Ganesh Rao (Bitbucket: [Ganesh Rao](https://bitbucket.org/Ganesh Rao), ).


similar issue , able to see debug after enabling FAUXMO (v3.1), below the details from serial monitor..( able to connect without discovering devices( on upload code to nodemcu, but is no device seen in alexa app , but when discovering devices,

reboots 3-4 times and show as connected in the debug messages but not discovered by echo dot 3 gen ..

onnected with ACT101172022433, channel 6
dhcp client start...
.....ip:192.168.0.103,mask:255.255.255.0,gw:192.168.0.1

[WIFI] STATION Mode, SSID: ACT101172022433, IP address: 192.168.0.103
[FAUXMO] Enabled
[FAUXMO] UDP server started
[FAUXMO] Device 'yellow lamp' added as #0
[FAUXMO] Client #0 connected

ets Jan 8 2013,rst cause:4, boot mode:(3,6)

wdt reset
load 0x4010f000, len 1384, room 16
tail 8
chksum 0x2d
csum 0x2d
v8b899c12
~ld

SDK:2.2.1(cfd48f3)/Core:2.5.2=20502000/lwIP:STABLE-2_1_2_RELEASE/glue:1.1-7-g82abda3/BearSSL:a143020

[WIFI] Connecting to ACT101172022433 scandone
..scandone
state: 0 -> 2 (b0)
.state: 2 -> 0 (2)
reconnect
.scandone
state: 0 -> 2 (b0)
state: 2 -> 3 (0)
state: 3 -> 5 (10)
add 0
aid 1
cnt
.
connected with ACT101172022433, channel 6
dhcp client start...
......ip:192.168.0.103,mask:255.255.255.0,gw:192.168.0.1

[WIFI] STATION Mode, SSID: ACT101172022433, IP address: 192.168.0.103
[FAUXMO] Enabled
[FAUXMO] UDP server started
[FAUXMO] Device 'yellow lamp' added as #0
[MAIN] Free heap: 46872 bytes
pm open,type:2 0
[MAIN] Free heap: 46352 bytes
[MAIN] Free heap: 46352 bytes
[MAIN] Free heap: 46352 bytes
[MAIN] Free heap: 46352 bytes