tzapu / WiFiManager

ESP8266 WiFi Connection manager with web captive portal
http://tzapu.com/esp8266-wifi-connection-manager-library-arduino-ide/
MIT License
6.6k stars 1.98k forks source link

Hard reset required after autoConnect before fauxmoESP/Alexa can discover devices. #1142

Open ddweber456 opened 4 years ago

ddweber456 commented 4 years ago

Question: I thought this issue had been address or did I just miss something?

Hardware

WiFimanager Branch/Release:

Esp8266/Esp32:

Hardware: ESP-12e, esp01, esp25

ESP Core Version: 2.4.0, staging

Description

After successful autoConnect and the saving of the parameters, I have to do a hard reset before the ESP is in the correct configuration Alexa can discover devices with fauxmoESP. I have WiFi.mode(WIFI_STA); in the setup().

Settings in IDE

Module: Wemos D1, v1.4 Higher Bandwidth

Additional libraries:

Sketch


#include <Arduino.h>

void setup() {

}

void loop() {

}

Debug Messages

14:55:47.642 -> SDK:2.2.2-dev(38a443e)/Core:2.7.3-3-g2843a5ac=20703003/lwIP:1.4.0rc2/BearSSL:5c771be
14:55:47.642 -> 
14:55:47.642 -> bcn 0
14:55:47.642 -> del if1
14:55:47.642 -> usl
14:55:47.642 -> mode : sta(98:f4:ab:da:62:f0)
14:55:47.642 -> add if0
14:55:47.689 -> Mounting FS...
14:55:47.689 -> wifi evt: 8
14:55:47.829 -> 
14:55:47.829 -> Mounted LittleFS file system
14:55:47.829 -> *WM: [3] allocating params bytes: 20
14:55:47.829 -> *WM: [2] Added Parameter:
14:55:47.829 -> *WM: [2] Added Parameter:
14:55:47.829 -> *WM: [2] Added Parameter: smart_home_phrase
14:55:47.829 -> *WM: [2] Added Parameter:
14:55:47.829 -> *WM: [2] Added Parameter: double_press
14:55:47.829 -> *WM: [3] Updated _max_params: 10
14:55:47.829 -> *WM: [3] re-allocating params bytes: 40
14:55:47.829 -> *WM: [2] Added Parameter:
14:55:47.829 -> *WM: [1] AutoConnect 
14:55:47.829 -> *WM: [1] No Credentials are Saved, skipping connect 
14:55:47.829 -> *WM: [2] Starting Config Portal 
14:55:47.875 -> *WM: [2] AccessPoint set password is VALID 
14:55:47.875 -> *WM: [1] WIFISwitch 
14:55:47.875 -> *WM: [3] WIFI station disconnect 
14:55:47.875 -> *WM: [3] WiFi station enable 
14:55:47.875 -> del if0
14:55:47.875 -> usl
14:55:47.875 -> mode : null
14:55:47.875 -> *WM: [2] Disabling STA 
14:55:47.875 -> *WM: [2] Enabling AP 
14:55:47.875 -> *WM: [1] StartAP with SSID:  Open Sesame WIFI Switch C02.01
14:55:47.875 -> modewifi evt: 8
14:55:47.875 ->  : softAP(9a:f4:ab:da:62:f0)
14:55:47.875 -> add if1
14:55:47.875 -> dhcp server start:(ip:192.168.4.1,mask:255.255.255.0,gw:192.168.4.1)
14:55:47.875 -> bcn 100
14:55:47.875 -> wifi evt: 8
14:55:48.059 -> wifi evt: 7
14:55:49.274 -> bcn 0
14:55:49.274 -> del if1
14:55:49.274 -> usl
14:55:49.274 -> add if1
14:55:49.274 -> dhcp server start:(ip:192.168.4.1,mask:255.255.255.0,gw:192.168.4.1)
14:55:49.274 -> bcn 100
14:55:49.274 -> *WM: [1] SoftAP Configuration 
14:55:49.274 -> *WM: [1] -------------------- 
14:55:49.274 -> *WM: [1] ssid:             Open Sesame WIFI Switch C02.01
14:55:49.274 -> *WM: [1] password:         WIFISwitch
14:55:49.274 -> *WM: [1] ssid_len:         30
14:55:49.274 -> *WM: [1] channel:          1
14:55:49.274 -> *WM: [1] authmode:         3
14:55:49.274 -> *WM: [1] ssid_hidden:     
14:55:49.274 -> *WM: [1] max_connection:   4
14:55:49.274 -> *WM: [1] country:          CN
14:55:49.274 -> *WM: [1] beacon_interval:  100(ms)
14:55:49.321 -> *WM: [1] -------------------- 
14:55:49.787 -> *WM: [1] AP IP address: 192.168.4.1
14:55:49.787 -> *WM: [3] setupConfigPortal 
14:55:49.787 -> *WM: [1] Starting Web Portal 
14:55:49.787 -> *WM: [3] dns server started with ip:  192.168.4.1
14:55:49.787 -> *WM: [2] HTTP server started 
14:55:49.787 -> mode : sta(98:f4:ab:da:62:f0) + softAP(9a:f4:ab:da:62:f0)
14:55:49.834 -> add if0
14:55:49.834 -> wifi evt: 8
14:55:51.992 -> scandone
14:55:51.992 -> *WM: [2] WiFi Scan completed in 2192 ms
14:55:51.992 -> *WM: [2] Config Portal Running, blocking, waiting for clients... 
14:55:52.271 -> wifi evt: 7
....
14:56:07.855 -> wifi evt: 7
14:56:17.338 -> *WM: [2] Portal Timeout In 90 seconds
14:56:21.016 -> wifi evt: 7
....
14:56:33.631 -> wifi evt: 7
14:56:33.631 -> add 1
14:56:33.631 -> aid 1
14:56:33.631 -> station: 90:73:5a:00:3c:e5 join, AID = 1
14:56:33.631 -> wifi evt: 5
14:56:34.011 -> wifi evt: 9
14:56:34.058 -> wifi evt: 9
14:56:34.198 -> wifi evt: 7
14:56:34.527 -> :urn 32
14:56:34.527 -> :urd 32, 32, 0
14:56:34.527 -> :urch 60, 47
14:56:34.527 -> :urd 47, 47, 0
14:56:34.620 -> WS:ac
14:56:34.620 -> :ref 1
14:56:34.620 -> WS:av status=4 WCav=0
14:56:34.620 -> :ref 2
14:56:34.620 -> :ur 2
14:56:34.620 -> New client
14:56:34.620 -> :ref 2
14:56:34.620 -> :ur 2
14:56:34.620 -> :rn 227
14:56:34.620 -> request: GET /generate_204 HTTP/1.1
14:56:34.620 -> method: GET url: /generate_204 search: 
14:56:34.620 -> headerName: Connection
14:56:34.620 -> headerValue: close
14:56:34.620 -> headerName: User-Agent
14:56:34.620 -> headerValue: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.32 Safari/537.36
14:56:34.620 -> headerName: Host
14:56:34.665 -> headerValue: connectivitycheck.gstatic.com
14:56:34.665 -> headerName: Accept-Encoding
14:56:34.665 -> headerValue: gzip
14:56:34.665 -> :c0 1, 227
14:56:34.665 -> args: 
14:56:34.665 -> args count: 0
14:56:34.665 -> args: 
14:56:34.665 -> args count: 0
14:56:34.665 -> Request: /generate_204
14:56:34.665 -> Arguments: 
14:56:34.665 -> final list of key/value pairs:
14:56:34.665 -> request handler not found
14:56:34.665 -> *WM: [3] -> connectivitycheck.gstatic.com 
14:56:34.665 -> :ref 2
14:56:34.665 -> :ur 2
14:56:34.665 -> *WM: [2] <- Request redirected to captive portal 
14:56:34.665 -> :wr 116 0
14:56:34.665 -> :wrc 116 116 0
14:56:34.665 -> :ref 2
14:56:34.665 -> :ack 116
14:56:34.665 -> :close
14:56:34.665 -> :ur 2
14:56:34.665 -> :ur 1
14:56:34.712 -> :dsrcv 0
14:56:34.712 -> WS:dis
14:56:34.712 -> :del
14:56:35.698 -> wifi evt: 7
14:56:35.698 -> wifi evt: 7
14:56:35.745 -> wifi evt: 7
14:56:35.745 -> wifi evt: 7
14:56:35.745 -> wifi evt: 7
14:56:35.745 -> wifi evt: 7
14:56:35.745 -> wifi evt: 7
14:56:38.421 -> wifi evt: 7
14:56:38.467 -> wifi evt: 7
14:56:38.514 -> wifi evt: 7
14:56:38.561 -> wifi evt: 7
14:56:38.933 -> WS:ac
14:56:38.933 -> :ref 1
14:56:38.933 -> WS:av status=4 WCav=0
14:56:38.933 -> :ref 2
14:56:38.933 -> :ur 2
14:56:38.933 -> New client
14:56:38.933 -> :ref 2
14:56:38.933 -> :ur 2
14:56:38.933 -> :rn 550
14:56:38.933 -> request: GET /generate_204 HTTP/1.1
14:56:38.933 -> method: GET url: /generate_204 search: 
14:56:38.933 -> headerName: Host
14:56:38.979 -> headerValue: connectivitycheck.gstatic.com
14:56:38.979 -> headerName: Connection
14:56:38.979 -> headerValue: keep-alive
14:56:38.979 -> headerName: Upgrade-Insecure-Requests
14:56:38.979 -> headerValue: 1
14:56:38.979 -> headerName: User-Agent
14:56:38.979 -> headerValue: Mozilla/5.0 (Linux; Android 10; moto g(7) power Build/QCOS30.85-18-6; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/86.0.4240.185 Mobile Safari/537.36
14:56:38.979 -> headerName: Accept
14:56:38.979 -> headerValue: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
14:56:38.979 -> headerName: X-Requested-With
14:56:39.025 -> headerValue: com.android.captiveportallogin
14:56:39.025 -> headerName: Accept-Encoding
14:56:39.025 -> headerValue: gzip, deflate
14:56:39.025 -> headerName: Accept-Language
14:56:39.025 -> headerValue: en-US,en;q=0.9
14:56:39.025 -> :c0 1, 550
14:56:39.025 -> args: 
14:56:39.025 -> args count: 0
14:56:39.025 -> args: 
14:56:39.025 -> args count: 0
14:56:39.025 -> Request: /generate_204
14:56:39.025 -> Arguments: 
14:56:39.025 -> final list of key/value pairs:
14:56:39.025 -> request handler not found
14:56:39.025 -> *WM: [3] -> connectivitycheck.gstatic.com 
14:56:39.025 -> :ref 2
14:56:39.025 -> :ur 2
14:56:39.025 -> *WM: [2] <- Request redirected to captive portal 
14:56:39.025 -> :wr 116 0
14:56:39.025 -> :wrc 116 116 0
14:56:39.025 -> :ref 2
14:56:39.072 -> :ack 116
14:56:39.072 -> :rcl pb=0 sz=-1
14:56:39.072 -> :abort
14:56:39.072 -> :ur 2
14:56:39.072 -> :ur 1
14:56:39.072 -> :dsrcv 0
14:56:39.072 -> WS:dis
14:56:39.072 -> :del
14:56:39.072 -> WS:ac
14:56:39.072 -> :ref 1
14:56:39.072 -> WS:av status=4 WCav=0
14:56:39.072 -> :ref 2
14:56:39.072 -> :ur 2
14:56:39.072 -> New client
14:56:39.072 -> :ref 2
14:56:39.072 -> :ur 2
14:56:39.072 -> :rn 520
14:56:39.072 -> request: GET / HTTP/1.1
14:56:39.072 -> method: GET url: / search: 
14:56:39.072 -> headerName: Host
14:56:39.072 -> headerValue: 192.168.4.1
14:56:39.072 -> headerName: Connection
14:56:39.072 -> headerValue: keep-alive
14:56:39.072 -> headerName: Upgrade-Insecure-Requests
14:56:39.072 -> headerValue: 1
14:56:39.119 -> headerName: User-Agent
14:56:39.119 -> headerValue: Mozilla/5.0 (Linux; Android 10; moto g(7) power Build/QCOS30.85-18-6; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/86.0.4240.185 Mobile Safari/537.36
14:56:39.119 -> headerName: Accept
14:56:39.119 -> headerValue: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
14:56:39.119 -> headerName: X-Requested-With
14:56:39.119 -> headerValue: com.android.captiveportallogin
14:56:39.119 -> headerName: Accept-Encoding
14:56:39.119 -> headerValue: gzip, deflate
14:56:39.119 -> headerName: Accept-Language
14:56:39.119 -> headerValue: en-US,en;q=0.9
14:56:39.165 -> :c0 1, 520
14:56:39.165 -> args: 
14:56:39.165 -> args count: 0
14:56:39.165 -> args: 
14:56:39.165 -> args count: 0
14:56:39.165 -> Request: /
14:56:39.165 -> Arguments: 
14:56:39.165 -> final list of key/value pairs:
14:56:39.165 -> *WM: [2] <- HTTP Root 
14:56:39.165 -> *WM: [3] -> 192.168.4.1 
14:56:39.165 -> :ref 2
14:56:39.165 -> :ur 2
14:56:39.165 -> *WM: [3] lastconxresult: WL_IDLE_STATUS
14:56:39.165 -> :wr 107 0
14:56:39.165 -> :wrc 107 107 0
14:56:39.165 -> :wr 3574 0
14:56:39.165 -> :wrc 2813 3574 0
14:56:39.212 -> :ack 107
14:56:39.212 -> :ack 1460
14:56:39.212 -> :wr 761 2813
14:56:39.212 -> :wrc 761 761 0
14:56:39.212 -> :ack 1353
14:56:39.212 -> :ack 761
14:56:39.212 -> :rcl pb=0 sz=-1
14:56:39.212 -> :abort
14:56:39.257 -> WS:ac
14:56:39.257 -> :rn 446
14:56:41.366 -> scandone
14:56:41.366 -> *WM: [2] WiFi Scan completed in 2185 ms
14:56:41.413 -> :ur 1
14:56:41.413 -> :dsrcv 0
14:56:41.413 -> WS:dis
14:56:41.413 -> :del
14:56:41.413 -> :ref 1
14:56:41.413 -> WS:av status=4 WCav=446
14:56:41.413 -> :ref 2
14:56:41.413 -> :ur 2
14:56:41.413 -> New client
14:56:41.413 -> :ref 2
14:56:41.413 -> :ur 2
14:56:41.413 -> request: GET /favicon.ico HTTP/1.1
14:56:41.413 -> method: GET url: /favicon.ico search: 
14:56:41.413 -> headerName: Host
14:56:41.413 -> headerValue: 192.168.4.1
14:56:41.413 -> headerName: Connection
14:56:41.413 -> headerValue: keep-alive
14:56:41.413 -> headerName: User-Agent
14:56:41.413 -> headerValue: Mozilla/5.0 (Linux; Android 10; moto g(7) power Build/QCOS30.85-18-6; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/86.0.4240.185 Mobile Safari/537.36
14:56:41.413 -> headerName: Accept
14:56:41.413 -> headerValue: image/webp,image/apng,image/*,*/*;q=0.8
14:56:41.459 -> headerName: X-Requested-With
14:56:41.459 -> headerValue: com.android.captiveportallogin
14:56:41.459 -> headerName: Referer
14:56:41.459 -> headerValue: http://192.168.4.1/
14:56:41.459 -> headerName: Accept-Encoding
14:56:41.459 -> headerValue: gzip, deflate
14:56:41.459 -> headerName: Accept-Language
14:56:41.459 -> headerValue: en-US,en;q=0.9
14:56:41.459 -> :c0 1, 446
14:56:41.459 -> args: 
14:56:41.459 -> args count: 0
14:56:41.459 -> args: 
14:56:41.459 -> args count: 0
14:56:41.459 -> Request: /favicon.ico
14:56:41.459 -> Arguments: 
14:56:41.459 -> final list of key/value pairs:
14:56:41.459 -> request handler not found
14:56:41.459 -> *WM: [3] -> 192.168.4.1 
14:56:41.459 -> :ref 2
14:56:41.459 -> :ur 2
14:56:41.459 -> :wr 194 0
14:56:41.459 -> :wrc 194 194 0
14:56:41.459 -> :wr 59 0
14:56:41.505 -> :wrc 59 59 0
14:56:41.646 -> wifi evt: 7
14:56:41.693 -> :ack 194
14:56:41.693 -> :ack 59
14:56:41.693 -> :rcl pb=0 sz=-1
14:56:41.693 -> :abort
14:56:41.739 -> :ur 1
14:56:41.739 -> :dsrcv 0
14:56:41.739 -> WS:dis
14:56:41.739 -> :del
14:56:43.377 -> WS:ac
14:56:43.377 -> :ref 1
14:56:43.377 -> WS:ac
14:56:43.377 -> WS:av status=4 WCav=0
14:56:43.377 -> :ref 2
14:56:43.377 -> :ur 2
14:56:43.377 -> :rn 232
14:56:43.377 -> New client
14:56:43.377 -> :ref 2
14:56:43.377 -> :ur 2
14:56:43.377 -> :rn 232
14:56:43.377 -> WS:ac
14:56:43.377 -> request: GET /generate_204 HTTP/1.1
14:56:43.377 -> method: GET url: /generate_204 search: 
14:56:43.377 -> headerName: User-Agent
14:56:43.377 -> headerValue: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.32 Safari/537.36
14:56:43.377 -> headerName: Host
14:56:43.377 -> headerValue: connectivitycheck.gstatic.com
14:56:43.424 -> headerName: Connection
14:56:43.424 -> headerValue: Keep-Alive
14:56:43.424 -> headerName: Accept-Encoding
14:56:43.424 -> headerValue: gzip
14:56:43.424 -> :c0 1, 232
14:56:43.424 -> args: 
14:56:43.424 -> args count: 0
14:56:43.424 -> args: 
14:56:43.424 -> args count: 0
14:56:43.424 -> :rn 555
14:56:43.424 -> Request: /generate_204
14:56:43.424 -> Arguments: 
14:56:43.424 -> final list of key/value pairs:
14:56:43.424 -> request handler not found
14:56:43.424 -> *WM: [3] -> connectivitycheck.gstatic.com 
14:56:43.424 -> :ref 2
14:56:43.424 -> :ur 2
14:56:43.424 -> *WM: [2] <- Request redirected to captive portal 
14:56:43.424 -> :wr 116 0
14:56:43.424 -> :wrc 116 116 0
14:56:43.424 -> :ref 2
14:56:43.519 -> :ack 116
14:56:43.519 -> :rcl pb=0 sz=-1
14:56:43.519 -> :abort
14:56:43.519 -> :ur 2
14:56:43.519 -> :ur 1
14:56:43.519 -> :dsrcv 0
14:56:43.519 -> WS:dis
14:56:43.519 -> :del
14:56:43.519 -> :ref 1
14:56:43.519 -> WS:av status=4 WCav=232
14:56:43.519 -> :ref 2
14:56:43.519 -> :ur 2
14:56:43.519 -> New client
14:56:43.519 -> :ref 2
14:56:43.519 -> :ur 2
14:56:43.519 -> request: GET /generate_204 HTTP/1.1
14:56:43.519 -> method: GET url: /generate_204 search: 
14:56:43.565 -> headerName: User-Agent
14:56:43.565 -> headerValue: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.32 Safari/537.36
14:56:43.565 -> headerName: Host
14:56:43.565 -> headerValue: connectivitycheck.gstatic.com
14:56:43.565 -> headerName: Connection
14:56:43.565 -> headerValue: Keep-Alive
14:56:43.565 -> headerName: Accept-Encoding
14:56:43.565 -> headerValue: gzip
14:56:43.565 -> :c0 1, 232
14:56:43.565 -> args: 
14:56:43.565 -> args count: 0
14:56:43.565 -> args: 
14:56:43.565 -> args count: 0
14:56:43.565 -> Request: /generate_204
14:56:43.565 -> Arguments: 
14:56:43.565 -> final list of key/value pairs:
14:56:43.565 -> request handler not found
14:56:43.565 -> *WM: [3] -> connectivitycheck.gstatic.com 
14:56:43.565 -> :ref 2
14:56:43.565 -> :ur 2
14:56:43.612 -> *WM: [2] <- Request redirected to captive portal 
14:56:43.612 -> :wr 116 0
14:56:43.612 -> :wrc 116 116 0
14:56:43.612 -> :ref 2
14:56:43.612 -> :ack 116
14:56:43.612 -> :close
14:56:43.612 -> :ur 2
14:56:43.612 -> :ur 1
14:56:43.612 -> :dsrcv 0
14:56:43.612 -> WS:dis
14:56:43.612 -> :del
14:56:43.612 -> :ref 1
14:56:43.612 -> WS:av status=4 WCav=555
14:56:43.612 -> :ref 2
14:56:43.612 -> :ur 2
14:56:43.612 -> New client
14:56:43.612 -> :ref 2
14:56:43.612 -> :ur 2
14:56:43.612 -> request: GET /wifi? HTTP/1.1
14:56:43.612 -> method: GET url: /wifi search: 
14:56:43.612 -> headerName: Host
14:56:43.612 -> headerValue: 192.168.4.1
14:56:43.612 -> headerName: Connection
14:56:43.612 -> headerValue: keep-alive
14:56:43.612 -> headerName: Upgrade-Insecure-Requests
14:56:43.659 -> headerValue: 1
14:56:43.659 -> headerName: User-Agent
14:56:43.659 -> headerValue: Mozilla/5.0 (Linux; Android 10; moto g(7) power Build/QCOS30.85-18-6; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/86.0.4240.185 Mobile Safari/537.36
14:56:43.659 -> headerName: Accept
14:56:43.659 -> headerValue: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
14:56:43.659 -> headerName: X-Requested-With
14:56:43.659 -> headerValue: com.android.captiveportallogin
14:56:43.659 -> headerName: Referer
14:56:43.659 -> headerValue: http://192.168.4.1/
14:56:43.659 -> headerName: Accept-Encoding
14:56:43.704 -> headerValue: gzip, deflate
14:56:43.704 -> headerName: Accept-Language
14:56:43.704 -> headerValue: en-US,en;q=0.9
14:56:43.704 -> :c0 1, 555
14:56:43.704 -> args: 
14:56:43.704 -> args count: 0
14:56:43.704 -> args: 
14:56:43.704 -> args count: 0
14:56:43.704 -> Request: /wifi
14:56:43.704 -> Arguments: 
14:56:43.704 -> final list of key/value pairs:
14:56:43.704 -> *WM: [2] <- HTTP Wifi 
14:56:43.704 -> *WM: [2] Scan is cached 2309 ms ago
14:56:43.704 -> *WM: [1] 14 networks found
14:56:43.704 -> *WM: [2] AP:  -43 NachoLINK
14:56:43.704 -> *WM: [2] AP:  -56 iConnect
14:56:43.704 -> *WM: [2] AP:  -57 Dattebayo
14:56:43.704 -> *WM: [2] AP:  -57 iConnect Guest
14:56:43.704 -> *WM: [2] AP:  -59 DIRECT-02MFC-L8610CDW_BRbb03
14:56:43.704 -> *WM: [2] AP:  -77 HOME-CAD2
14:56:43.704 -> *WM: [2] AP:  -79 LGTrueBalanceWasher2
14:56:43.751 -> *WM: [2] AP:  -82 WhyDidThisTakeSoLong
14:56:43.751 -> *WM: [2] AP:  -82 CenturyLink3327
14:56:43.751 -> *WM: [2] AP:  -86 sofiaprincess
14:56:43.751 -> *WM: [2] AP:  -87 Ness2013
14:56:43.751 -> *WM: [2] AP:  -87 Roosevelt
14:56:43.751 -> *WM: [2] AP:  -88 Good_Dog
14:56:43.751 -> *WM: [2] AP:  -93 Rmspevacek
14:56:43.751 -> *WM: [3] lastconxresult: WL_IDLE_STATUS
14:56:43.751 -> :wr 107 0
14:56:43.751 -> :wrc 107 107 0
14:56:43.751 -> :wr 6430 0
14:56:43.751 -> :wrc 2813 6430 0
14:56:43.751 -> :ack 107
14:56:43.751 -> :ack 1460
14:56:43.751 -> :wr 3617 2813
14:56:43.751 -> :wrc 1567 3617 0
14:56:43.797 -> :ack 1353
14:56:43.797 -> :ack 1460
14:56:43.797 -> :wr 2050 4380
14:56:43.797 -> :wrc 2050 2050 0
14:56:43.797 -> *WM: [3] Sent config page 
14:56:43.797 -> :ack 107
14:56:43.797 -> :ack 1460
14:56:43.797 -> :ack 590
14:56:43.797 -> :rcl pb=0 sz=-1
14:56:43.797 -> :abort
14:56:43.797 -> :ur 1
14:56:43.797 -> :dsrcv 0
14:56:43.797 -> WS:dis
14:56:43.797 -> :del
14:56:44.832 -> WS:ac
14:56:44.832 -> :ref 1
14:56:44.832 -> WS:av status=4 WCav=0
14:56:44.832 -> :ref 2
14:56:44.832 -> :ur 2
14:56:44.832 -> :rn 232
14:56:44.832 -> New client
14:56:44.832 -> :ref 2
14:56:44.832 -> :ur 2
14:56:44.832 -> request: GET /generate_204 HTTP/1.1
14:56:44.878 -> method: GET url: /generate_204 search: 
14:56:44.878 -> headerName: User-Agent
14:56:44.878 -> headerValue: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.32 Safari/537.36
14:56:44.878 -> headerName: Host
14:56:44.878 -> headerValue: connectivitycheck.gstatic.com
14:56:44.878 -> headerName: Connection
14:56:44.878 -> headerValue: Keep-Alive
14:56:44.878 -> headerName: Accept-Encoding
14:56:44.878 -> headerValue: gzip
14:56:44.878 -> :c0 1, 232
14:56:44.878 -> args: 
14:56:44.878 -> args count: 0
14:56:44.878 -> args: 
14:56:44.878 -> args count: 0
14:56:44.878 -> Request: /generate_204
14:56:44.878 -> Arguments: 
14:56:44.878 -> final list of key/value pairs:
14:56:44.878 -> request handler not found
14:56:44.924 -> *WM: [3] -> connectivitycheck.gstatic.com 
14:56:44.924 -> :ref 2
14:56:44.924 -> :ur 2
14:56:44.924 -> *WM: [2] <- Request redirected to captive portal 
14:56:44.924 -> :wr 116 0
14:56:44.924 -> :wrc 116 116 0
14:56:44.924 -> :ref 2
14:56:44.924 -> WS:ac
14:56:44.924 -> :rn 232
14:56:44.924 -> :ack 116
14:56:44.924 -> :rcl pb=0 sz=-1
14:56:44.924 -> :abort
14:56:44.924 -> :ur 2
14:56:44.924 -> :ur 1
14:56:44.924 -> :dsrcv 0
14:56:44.924 -> WS:dis
14:56:44.924 -> :del
14:56:44.924 -> :ref 1
14:56:44.924 -> WS:av status=4 WCav=232
14:56:44.924 -> :ref 2
14:56:44.924 -> :ur 2
14:56:44.924 -> New client
14:56:44.924 -> :ref 2
14:56:44.924 -> :ur 2
14:56:44.924 -> request: GET /generate_204 HTTP/1.1
14:56:44.924 -> method: GET url: /generate_204 search: 
14:56:44.924 -> headerName: User-Agent
14:56:44.924 -> headerValue: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.32 Safari/537.36
14:56:44.970 -> headerName: Host
14:56:44.970 -> headerValue: connectivitycheck.gstatic.com
14:56:44.970 -> headerName: Connection
14:56:44.970 -> headerValue: Keep-Alive
14:56:44.970 -> headerName: Accept-Encoding
14:56:44.970 -> headerValue: gzip
14:56:44.970 -> :c0 1, 232
14:56:44.970 -> args: 
14:56:44.970 -> args count: 0
14:56:44.970 -> args: 
14:56:44.970 -> args count: 0
14:56:44.970 -> Request: /generate_204
14:56:44.970 -> Arguments: 
14:56:44.970 -> final list of key/value pairs:
14:56:44.970 -> request handler not found
14:56:44.970 -> *WM: [3] -> connectivitycheck.gstatic.com 
14:56:44.970 -> :ref 2
14:56:44.970 -> :ur 2
14:56:44.970 -> *WM: [2] <- Request redirected to captive portal 
14:56:44.970 -> :wr 116 0
14:56:45.018 -> :wrc 116 116 0
14:56:45.018 -> :ref 2
14:56:45.018 -> :ack 116
14:56:45.018 -> :rcl pb=0 sz=-1
14:56:45.018 -> :abort
14:56:45.018 -> :ur 2
14:56:45.018 -> :ur 1
14:56:45.018 -> :dsrcv 0
14:56:45.018 -> WS:dis
14:56:45.018 -> :del
14:56:45.956 -> wifi evt: 7
14:56:46.003 -> wifi evt: 7
14:56:46.940 -> WS:ac
14:56:46.940 -> :ref 1
14:56:46.940 -> :rn 232
14:56:46.940 -> WS:av status=4 WCav=0
14:56:46.940 -> :ref 2
14:56:46.940 -> :ur 2
14:56:46.940 -> New client
14:56:46.940 -> :ref 2
14:56:46.940 -> :ur 2
14:56:46.940 -> request: GET /generate_204 HTTP/1.1
14:56:46.940 -> method: GET url: /generate_204 search: 
14:56:46.940 -> headerName: User-Agent
14:56:46.940 -> headerValue: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.32 Safari/537.36
14:56:46.940 -> headerName: Host
14:56:46.940 -> headerValue: connectivitycheck.gstatic.com
14:56:46.940 -> headerName: Connection
14:56:46.940 -> headerValue: Keep-Alive
14:56:46.940 -> headerName: Accept-Encoding
14:56:46.987 -> headerValue: gzip
14:56:46.987 -> :c0 1, 232
14:56:46.987 -> args: 
14:56:46.987 -> args count: 0
14:56:46.987 -> args: 
14:56:46.987 -> args count: 0
14:56:46.987 -> Request: /generate_204
14:56:46.987 -> Arguments: 
14:56:46.987 -> final list of key/value pairs:
14:56:46.987 -> request handler not found
14:56:46.987 -> *WM: [3] -> connectivitycheck.gstatic.com 
14:56:46.987 -> :ref 2
14:56:46.987 -> :ur 2
14:56:46.987 -> *WM: [2] <- Request redirected to captive portal 
14:56:46.987 -> :wr 116 0
14:56:46.987 -> :wrc 116 116 0
14:56:46.987 -> :ref 2
14:56:46.987 -> :ack 116
14:56:46.987 -> :close
14:56:46.987 -> :ur 2
14:56:46.987 -> :ur 1
14:56:46.987 -> :dsrcv 0
14:56:46.987 -> WS:dis
14:56:46.987 -> :del
14:56:47.359 -> *WM: [2] Portal Timeout In 116 seconds
14:56:47.359 -> wifi evt: 7
....
14:57:17.193 -> wifi evt: 7
14:57:17.334 -> *WM: [2] Portal Timeout In 86 seconds
14:57:19.393 -> WS:ac
14:57:19.393 -> :ref 1
14:57:19.393 -> :rn 758
14:57:19.393 -> WS:av status=4 WCav=0
14:57:19.393 -> :ref 2
14:57:19.393 -> :ur 2
14:57:19.393 -> New client
14:57:19.393 -> :ref 2
14:57:19.393 -> :ur 2
14:57:19.393 -> request: POST /wifisave HTTP/1.1
14:57:19.393 -> method: POST url: /wifisave search: 
14:57:19.393 -> headerName: Host
14:57:19.393 -> headerValue: 192.168.4.1
14:57:19.440 -> headerName: Connection
14:57:19.440 -> headerValue: keep-alive
14:57:19.440 -> headerName: Content-Length
14:57:19.440 -> headerValue: 71
14:57:19.440 -> headerName: Cache-Control
14:57:19.440 -> headerValue: max-age=0
14:57:19.440 -> headerName: Upgrade-Insecure-Requests
14:57:19.440 -> headerValue: 1
14:57:19.440 -> headerName: Origin
14:57:19.440 -> headerValue: http://192.168.4.1
14:57:19.440 -> headerName: Content-Type
14:57:19.440 -> headerValue: application/x-www-form-urlencoded
14:57:19.440 -> headerName: User-Agent
14:57:19.440 -> headerValue: Mozilla/5.0 (Linux; Android 10; moto g(7) power Build/QCOS30.85-18-6; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/86.0.4240.185 Mobile Safari/537.36
14:57:19.486 -> headerName: Accept
14:57:19.486 -> headerValue: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
14:57:19.486 -> headerName: X-Requested-With
14:57:19.486 -> headerValue: com.android.captiveportallogin
14:57:19.486 -> headerName: Referer
14:57:19.486 -> headerValue: http://192.168.4.1/wifi?
14:57:19.486 -> headerName: Accept-Encoding
14:57:19.486 -> headerValue: gzip, deflate
14:57:19.486 -> headerName: Accept-Language
14:57:19.486 -> headerValue: en-US,en;q=0.9
14:57:19.486 -> :c0 1, 758
14:57:19.486 -> args: s=NachoLINK&p=xxxxx&smart_home_phrase=Paper&double_press=Crayon+
14:57:19.486 -> args count: 4
14:57:19.532 -> args: s=NachoLINK&p=xxxxx&smart_home_phrase=Paper&double_press=Crayon+
14:57:19.532 -> args count: 4
14:57:19.532 -> Request: /wifisave
14:57:19.532 -> Arguments: s=NachoLINK&p=xxxxx&smart_home_phrase=Paper&double_press=Crayon+
14:57:19.532 -> final list of key/value pairs:
14:57:19.532 ->   key:'s' value:'NachoLINK'
14:57:19.532 ->   key:'p' value:'xxxxx'
14:57:19.532 ->   key:'smart_home_phrase' value:'Paper'
14:57:19.532 ->   key:'double_press' value:'Crayon '
14:57:19.532 ->   key:'plain' value:'s=NachoLINK&p=xxxxx&smart_home_phrase=Paper&double_press=Crayon+'
14:57:19.532 -> *WM: [2] <- HTTP WiFi save  
14:57:19.532 -> *WM: [3] Method: POST
14:57:19.532 -> *WM: [2] Parameters 
14:57:19.579 -> *WM: [2] -------------------- 
14:57:19.579 -> *WM: [2] : 
14:57:19.579 -> *WM: [2] : 
14:57:19.579 -> *WM: [2] smart_home_phrase: Paper
14:57:19.579 -> *WM: [2] : 
14:57:19.579 -> *WM: [2] double_press: Crayon 
14:57:19.579 -> *WM: [2] : 
14:57:19.579 -> *WM: [2] -------------------- 
14:57:19.579 -> :wr 139 0
14:57:19.579 -> :wrc 139 139 0
14:57:19.579 -> :wr 3395 0
14:57:19.579 -> :wrc 2781 3395 0
14:57:19.579 -> :ack 139
14:57:19.579 -> :ack 1460
14:57:19.579 -> :wr 614 2781
14:57:19.579 -> :wrc 614 614 0
14:57:19.579 -> *WM: [3] Sent wifi save page 
14:57:19.579 -> *WM: [2] processing save 
14:57:19.579 -> :ack 1321
14:57:19.579 -> :ack 614
14:57:19.579 -> :rcl pb=0 sz=-1
14:57:19.579 -> :abort
14:57:20.279 -> wifi evt: 7
14:57:20.653 -> WS:ac
14:57:20.653 -> :rn 232
14:57:20.653 -> WS:ac
14:57:20.653 -> :rn 232
14:57:21.594 -> *WM: [2] Connecting as wifi client... 
14:57:21.594 -> *WM: [3] STA static IP:
14:57:21.594 -> *WM: [2] setSTAConfig static ip not set, skipping 
14:57:21.594 -> *WM: [1] CONNECTED:
14:57:21.594 -> *WM: [1] Connecting to NEW AP: NachoLINK
14:57:21.594 -> *WM: [3] Using Password: xxxxx
14:57:21.594 -> *WM: [3] WiFi station enable 
14:57:21.594 -> *WM: [3] enableSTA PERSISTENT ON 
14:57:21.734 -> *WM: [1] connectTimeout not set, ESP waitForConnectResult... 
14:57:21.734 -> wifi evt: 8
14:57:22.439 -> wifi evt: 2
14:57:23.892 -> scandone
14:57:23.892 -> wifi evt: 7
14:57:23.939 -> wifi evt: 7
14:57:24.316 -> switch to channel 9
14:57:25.260 -> state: 0 -> 2 (b0)
14:57:25.260 -> state: 2 -> 3 (0)
14:57:25.260 -> state: 3 -> 5 (10)
14:57:25.260 -> add 0
14:57:25.260 -> aid 1
14:57:25.260 -> cnt 
14:57:25.260 -> 
14:57:25.260 -> connected with NachoLINK, channel 9
14:57:25.306 -> dhcp client start...
14:57:25.306 -> wifi evt: 0
14:57:27.187 -> ip:192.168.0.118,mask:255.255.255.0,gw:192.168.0.1
14:57:27.187 -> wifi evt: 3
14:57:27.187 -> *WM: [2] Connection result: WL_CONNECTED
14:57:27.187 -> *WM: [3] lastconxresult: WL_CONNECTED
14:57:27.187 -> *WM: [1] Connect to new AP [SUCCESS] 
14:57:27.187 -> *WM: [1] Got IP Address: 
14:57:27.187 -> *WM: [1] 192.168.0.118 
14:57:27.187 -> Should save config
14:57:27.187 -> :ur 1
14:57:27.187 -> :dsrcv 0
14:57:27.187 -> WS:dis
14:57:27.187 -> :del
14:57:27.187 -> :ur 1
14:57:27.234 -> *WM: [2] disconnect configportal 
14:57:27.234 -> station: 90:73:5a:00:3c:e5 leave, AID = 1
14:57:27.234 -> rm 1
14:57:27.234 -> bcn 0
14:57:27.234 -> del if1
14:57:27.234 -> pm open,type:2 0
14:57:27.234 -> add if1
14:57:27.234 -> pm close 7
14:57:27.234 -> dhcp server start:(ip:192.1wifi evt: 6
14:57:27.234 -> 68.4.1,mask:255.255.255.0,gw:192.168.4.1)
14:57:27.234 -> bcn 100
14:57:28.217 -> *WM: [2] restoring usermode STA
14:57:28.217 -> bcn 0
14:57:28.217 -> del if1
14:57:28.217 -> pm open,type:2 0
14:57:28.217 -> mode : sta(98:f4:ab:da:62:f0)
14:57:28.217 -> *WM: [2] wifi status: WL_CONNECTED
14:57:28.217 -> *WM: [2] wifi mode: STA
14:57:28.217 -> *WM: [1] config portal exiting 
14:57:28.217 -> WiFi Connected.  yepee!!
14:57:28.217 -> 
14:57:28.217 -> Saving JSON Config
14:57:28.264 -> wifi evt: 8
14:57:28.264 -> please start sntp first !
14:57:28.264 -> Here is the SAVED JSON File:
14:57:28.264 -> {"smart_home_phrase":"Paper","double_press":"Crayon "}lfs_file_close: fd=0x3fff0a6c
14:57:28.264 -> please start sntp first !
14:57:28.264 -> 
14:57:28.264 -> Smart Home Phrases: 
14:57:28.264 -> Paper  Crayon 
14:57:40.599 -> :urn 265
14:57:40.599 -> :urd 265, 265, 0
14:57:40.694 -> :urn 274
tablatronix commented 3 years ago

Make sure your esp is still in sta mode after wm exits. Not sure what else it could be

ddweber456 commented 3 years ago

What am I missing. At the very end of the degug it looks to me like it's in STA mode.

14:57:28.217 -> bcn 0
14:57:28.217 -> del if1
14:57:28.217 -> pm open,type:2 0
14:57:28.217 -> mode : sta(98:f4:ab:da:62:f0)
14:57:28.217 -> *WM: [2] wifi status: WL_CONNECTED
14:57:28.217 -> *WM: [2] wifi mode: STA
14:57:28.217 -> *WM: [1] config portal exiting 
14:57:28.217 -> WiFi Connected.  yepee!!

Where do I put the WiFi.mode(WIFI_STA); if not at the beginning of setup() ?

tablatronix commented 3 years ago

Yeah that should be good,

where in this log is the problem? How are you checking that your connectivity is working etc

ddweber456 commented 3 years ago

I really appreciate your help and time on this, Thanks.

OK I'm back on 0.15.0, I had this problem from the very start, so it's not anything new with the alpha release. I added a couple of WiFi.printDiag(Serial); commands after the autoConnect to check the status. Is there something else I should do?

Here are the serial print logs from the autoConnect and then from the hard reset.

autoConnect:

22:37:29.519 -> *WM: AP IP address: 
22:37:29.519 -> *WM: 192.168.4.1
22:37:29.519 -> *WM: HTTP server started
22:38:32.462 -> *WM: Request redirected to captive portal
22:38:35.367 -> *WM: Request redirected to captive portal
22:38:35.367 -> *WM: Handle root
22:38:36.446 -> *WM: Request redirected to captive portal
22:38:36.493 -> *WM: Request redirected to captive portal
22:38:40.571 -> *WM: Scan done
22:38:40.571 -> *WM: DUP AP: Roosevelt
22:38:40.571 -> *WM: NachoLINK
22:38:40.571 -> *WM: -43
22:38:40.571 -> *WM: iConnect
22:38:40.571 -> *WM: -63
22:38:40.571 -> *WM: iConnect Guest
22:38:40.571 -> *WM: -63
22:38:40.571 -> *WM: DIRECT-02MFC-L8610CDW_BRbb03
22:38:40.571 -> *WM: -64
22:38:40.571 -> *WM: Dattebayo
22:38:40.571 -> *WM: -64
22:38:40.571 -> *WM: HOME-CAD2
22:38:40.618 -> *WM: -76
22:38:40.849 -> *WM: Sent config page
22:38:41.926 -> *WM: Request redirected to captive portal
22:38:41.973 -> *WM: Request redirected to captive portal
22:38:45.026 -> *WM: Request redirected to captive portal
22:39:20.201 -> *WM: WiFi save
22:39:20.201 -> *WM: Parameter
22:39:20.201 -> *WM: 
22:39:20.201 -> *WM: 
22:39:20.201 -> *WM: Parameter
22:39:20.201 -> *WM: 
22:39:20.201 -> *WM: 
22:39:20.201 -> *WM: Parameter
22:39:20.201 -> *WM: smart_home_phrase
22:39:20.201 -> *WM: Silver 
22:39:20.201 -> *WM: Parameter
22:39:20.201 -> *WM: 
22:39:20.201 -> *WM: 
22:39:20.201 -> *WM: Parameter
22:39:20.201 -> *WM: double_press
22:39:20.201 -> *WM: Gold 
22:39:20.201 -> *WM: Parameter
22:39:20.201 -> *WM: 
22:39:20.201 -> *WM: 
22:39:20.201 -> *WM: Sent wifi save page
22:39:21.186 -> *WM: Connecting to new AP
22:39:21.186 -> *WM: Connecting as wifi client...
22:39:21.233 -> *WM: Status:
22:39:21.233 -> *WM: 0
22:39:21.279 -> *WM: [ERROR] WiFi.begin res:
22:39:21.279 -> *WM: 6
22:39:36.979 -> *WM: Connection result: 
22:39:36.979 -> *WM: 4
22:39:38.995 -> *WM: Failed to connect.
22:39:38.995 -> *WM: Request redirected to captive portal
22:39:38.995 -> *WM: Request redirected to captive portal
22:39:48.801 -> *WM: Request redirected to captive portal
22:39:48.801 -> *WM: Request redirected to captive portal
22:40:02.969 -> *WM: WiFi save
22:40:02.969 -> *WM: Parameter
22:40:02.969 -> *WM: 
22:40:02.969 -> *WM: 
22:40:02.969 -> *WM: Parameter
22:40:02.969 -> *WM: 
22:40:02.969 -> *WM: 
22:40:02.969 -> *WM: Parameter
22:40:02.969 -> *WM: smart_home_phrase
22:40:02.969 -> *WM: Silver 
22:40:02.969 -> *WM: Parameter
22:40:02.969 -> *WM: 
22:40:02.969 -> *WM: 
22:40:02.969 -> *WM: Parameter
22:40:02.969 -> *WM: double_press
22:40:02.969 -> *WM: Gold 
22:40:02.969 -> *WM: Parameter
22:40:02.969 -> *WM: 
22:40:02.969 -> *WM: 
22:40:02.969 -> *WM: Sent wifi save page
22:40:03.989 -> *WM: Connecting to new AP
22:40:03.989 -> *WM: Connecting as wifi client...
22:40:03.989 -> *WM: Status:
22:40:03.989 -> *WM: 6
22:40:04.036 -> *WM: [ERROR] WiFi.begin res:
22:40:04.036 -> *WM: 6
22:40:10.181 -> *WM: Connection result: 
22:40:10.181 -> *WM: 3
22:40:10.272 -> Should save config
22:40:10.272 -> 
22:40:10.272 -> After autoConnect and before Fauxmo.createServer
22:40:10.272 -> 
22:40:10.272 -> Mode: STA
22:40:10.272 -> PHY mode: N
22:40:10.272 -> Channel: 9
22:40:10.272 -> AP id: 0
22:40:10.272 -> Status: 5
22:40:10.272 -> Auto connect: 1
22:40:10.272 -> SSID (9): NachoLINK
22:40:10.272 -> Passphrase (12): xxxxx
22:40:10.272 -> BSSID set: 0
22:40:10.272 -> 
22:40:10.272 -> 
22:40:10.272 -> After Fauxmo.createServer
22:40:10.272 -> 
22:40:10.272 -> Mode: STA
22:40:10.272 -> PHY mode: N
22:40:10.272 -> Channel: 9
22:40:10.272 -> AP id: 0
22:40:10.272 -> Status: 5
22:40:10.272 -> Auto connect: 1
22:40:10.272 -> SSID (9): NachoLINK
22:40:10.272 -> Passphrase (12): xxxxx
22:40:10.272 -> BSSID set: 0
22:40:10.272 -> 
22:40:10.272 -> WiFi Connected.  yepee!!
22:40:10.272 -> 
22:40:10.272 -> Saving JSON Config
22:40:10.272 -> Here is the SAVED JSON File:
22:40:10.272 -> {"smart_home_phrase":"Silver ","double_press":"Gold "}
22:40:10.319 -> Smart Home Phrases: 
22:40:10.319 -> Silver   Gold 

And here is the serial log with the hard reset:

22:47:58.913 -> Mounted LittleFS file system
22:47:58.913 -> Reading config file
22:47:58.913 -> Opened config file
22:47:58.913 -> {"smart_home_phrase":"Silver ","double_press":"Gold "}
22:47:58.913 -> parsed json
22:47:58.913 -> *WM: Adding parameter
22:47:58.913 -> *WM: 
22:47:58.913 -> *WM: Adding parameter
22:47:58.913 -> *WM: 
22:47:58.913 -> *WM: Adding parameter
22:47:58.959 -> *WM: smart_home_phrase
22:47:58.959 -> *WM: Adding parameter
22:47:58.959 -> *WM: 
22:47:58.959 -> *WM: Adding parameter
22:47:58.959 -> *WM: double_press
22:47:58.959 -> *WM: Adding parameter
22:47:58.959 -> *WM: 
22:47:58.959 -> *WM: 
22:47:58.959 -> *WM: AutoConnect
22:47:58.959 -> *WM: Connecting as wifi client...
22:47:58.959 -> *WM: Status:
22:47:58.959 -> *WM: 6
22:47:58.959 -> *WM: Using last saved values, should be faster
22:48:03.413 -> *WM: Connection result: 
22:48:03.413 -> *WM: 3
22:48:03.413 -> *WM: IP Address:
22:48:03.413 -> *WM: 192.168.0.119
22:48:03.413 -> 
22:48:03.413 -> After autoConnect and before Fauxmo.createServer
22:48:03.413 -> 
22:48:03.413 -> Mode: STA
22:48:03.413 -> PHY mode: N
22:48:03.413 -> Channel: 9
22:48:03.413 -> AP id: 0
22:48:03.413 -> Status: 5
22:48:03.413 -> Auto connect: 1
22:48:03.413 -> SSID (9): NachoLINK
22:48:03.413 -> Passphrase (12): xxxxx
22:48:03.413 -> BSSID set: 0
22:48:03.413 -> 
22:48:03.413 -> 
22:48:03.413 -> After Fauxmo.createServer
22:48:03.413 -> 
22:48:03.413 -> Mode: STA
22:48:03.413 -> PHY mode: N
22:48:03.413 -> Channel: 9
22:48:03.413 -> AP id: 0
22:48:03.413 -> Status: 5
22:48:03.413 -> Auto connect: 1
22:48:03.413 -> SSID (9): NachoLINK
22:48:03.413 -> Passphrase (12):  xxxxx
22:48:03.413 -> 
22:48:03.413 -> WiFi Connected.  yepee!!
22:48:03.413 -> 
22:48:03.413 -> Smart Home Phrases: 
22:48:03.413 -> Silver   Gold 

In the autoConnect serial print log I'm getting " 22:40:04.036 -> *WM: [ERROR] WiFi.begin res: " Let me know what you think.

tablatronix commented 3 years ago

Thats odd, the first log says it connected, this one says it doesnt.

I wonder why, definitely a connection issue, which esp lib version are you using ?

ddweber456 commented 3 years ago

ESP 2.5.0 ESP8266 board mgr 2.7.4

tablatronix commented 3 years ago

Not a fritzbox router is it ?

ddweber456 commented 3 years ago

Tp-Link. Actually just install a new Tp-Link. Haven't done anything with ESP yet.

tablatronix commented 3 years ago

Try a full flash erase yet?

ddweber456 commented 3 years ago

I have. The reset is needed on all the devices. About 30 or 40 8266 so far. It's become standard operating procedure to do a hard reset, but I know that's not right.

tablatronix commented 3 years ago

It must have something to do with fauxmo, maybe mdns interferes with the udp ?

Have you tried a basic ping example ? Or some other network check ? is it pingable ?

tablatronix commented 3 years ago

Which fauxmo library are you using ?

ddweber456 commented 3 years ago

I'm using the current 3.1.1

Let me see if I can Ping it after the autoConnect.....

No I can not ping it, before or after the reset

tablatronix commented 3 years ago

I mean which one, there seems to be a bunch xoseperez/fauxmoESP ?

ddweber456 commented 3 years ago

I'm sorry. Support for the fauxmoESP and been transferred to Paul, @pvint https://github.com/vintlabs/fauxmoESP

tablatronix commented 3 years ago

ok they should fix that in platform io

I will see if I can install it

ddweber456 commented 3 years ago

Agreed. Maybe someone with the expertise could assist @pvint in making the platform io happen.

pvint commented 3 years ago

Agreed. Maybe someone with the expertise could assist @pvint in making the platform io happen.

I hadn't thought of the lib in platformio, thanks for mentioning it. I took a look and I see how it works now. I'll try to get it and Arduino updated later today.

tablatronix commented 3 years ago

I think the old one would have to be removed first to avoid confusion, unless the name changes. i assume you are maintaining a fork, and the source is abandoned?

pvint commented 3 years ago

Xose, the original author, has handed it over to me to maintain. I've updated the library.json file on the original repo, which I believe should update it.

pvint commented 3 years ago

I've looked at this a bit more and took some packet captures when it fails and when it works. For some reason the ESP8266 is sending a RST, ACK packet back to the Amazon echo . Everything seems the same up until that packet, and in the "good" scenario, it sens a SYN ACK and everything continues.

I have a bit more info here: https://github.com/vintlabs/fauxmoESP/issues/123#issuecomment-731847618

ddweber456 commented 3 years ago

Just curious if anyone has had a chance to investigate the findings that Paul, FauxmoESP, was able to see with the packet capture. I'm still having the issue of the required hard reset and would really like to get that resolved if possible. Let me know if there is anything I can do to help.

tablatronix commented 3 years ago

you would have to eliminate WM and see if it can be reproduced with just esp examples, and then reach out to espressif, does sound like sdk issue.

What happens if you just do a esp.reset() ? or wdt reset ?

ddweber456 commented 3 years ago

It seems like I would have to do the esp.reset() as part of the autoConnect? Unless I can conditionally esp.reset() coming out of autoConnect. Ideas?

tablatronix commented 3 years ago

You only have this issue when saving new wifi ? You can use the saveconfig callback to flag a reset maybe?

The only time I have seen reset issues with wifi saving is when the flash is corrupt and a full erase via esptool/arduino fixes it

ddweber456 commented 3 years ago

Yes, the only time I see the issue is when saving new WiFi credentials.

Several months back, I did see the comments regarding the corrupt flash, I was hopeful, but that didn't help.

tablatronix commented 3 years ago

It hardly ever does anything but maybe try adding a WiFi.reconnect() after ?

ddweber456 commented 3 years ago

The WiFi.reconnect() did not do the trick. I think we maybe lookin in the wrong place.

Shawn, I'm not the most experienced coder, but it look like to me that autoConnect() call to connectWiFi() when saving credentials it does not return to the calling function cleanly. Otherwise, I think I should be seeing the *WM: IP Address ... in the first serial print log below:

*WM: Connection result: 
*WM: 3
*WM: IP Address:
*WM: 192.168.0.102
 WiFi Connected.  yepee!!

Serial print log when saving wifi credentials via autoConnect():

17:31:33.854 -> *WM: Sent wifi save page
17:31:34.839 -> *WM: Connecting to new AP
17:31:34.839 -> *WM: Connecting as wifi client...
17:31:34.839 -> *WM: Status:
17:31:34.884 -> *WM: 0
17:31:34.931 -> *WM: [ERROR] WiFi.begin res:
17:31:34.931 -> *WM: 6
17:31:39.284 -> *WM: Connection result: 
17:31:39.284 -> *WM: 3
17:31:39.331 -> Should save config
17:31:42.271 -> WiFi Connected.  yepee!!
17:31:42.271 -> 
17:31:42.271 -> Saving JSON Config
17:31:42.271 -> Here is the SAVED JSON File:
17:31:42.271 -> {"smart_home_phrase":"Black","double_press":"White "}
17:31:42.271 -> Smart Home Phrases: 
17:31:42.271 -> Black  White

Serial print log after doing the hard reset:

17:33:51.497 -> *WM: AutoConnect
17:33:51.543 -> *WM: Connecting as wifi client...
17:33:51.543 -> *WM: Status:
17:33:51.543 -> *WM: 6
17:33:51.543 -> *WM: Using last saved values, should be faster
17:33:55.091 -> *WM: Connection result: 
17:33:55.091 -> *WM: 3
17:33:55.091 -> *WM: IP Address:
17:33:55.091 -> *WM: 192.168.0.102
17:33:58.695 -> WiFi Connected.  yepee!!
17:33:58.695 -> 
17:33:58.695 -> Smart Home Phrases: 
17:33:58.695 -> Black  White 
tablatronix commented 3 years ago

Yes your saves are failing, your code is checking the return true? Not sure what is failing or if begin is failing, not sure why, have you tried a different esp a different lib version?

ddweber456 commented 3 years ago

I have only tried this on the 8266. But on many 8266s. All have the same issue and want a hard reset before they will communicate with Alexa. After that they are very, very stable. Multiple power re-boots, power outages, wifi going away for period of time. No Issues.

What lib version would you recommend?

I don't know if it makes a difference but FauxmoESP runs as a UDP.

ddweber456 commented 3 years ago

I just modified the example AutoConnect sketch from the 0.15.0 WiFiManager lib. Modified it just enough to blink the on-board LED and I'm getting the same serial print log as before:

Serial print log from autoConnect() saving wifi credentials:

21:50:11.333 -> *WM: WiFi save
21:50:11.333 -> *WM: Sent wifi save page
21:50:12.359 -> *WM: Connecting to new AP
21:50:12.359 -> *WM: Connecting as wifi client...
21:50:12.359 -> *WM: Status:
21:50:12.359 -> *WM: 0
21:50:12.405 -> *WM: [ERROR] WiFi.begin res:
21:50:12.405 -> *WM: 6
21:50:16.704 -> *WM: Connection result: 
21:50:16.704 -> *WM: 3
21:50:16.752 -> connected...yeey :)
21:50:16.752 -> IP Address: 192.168.0.102
21:50:16.752 -> *WM: freeing allocated params!

After ESP8266 hard reset:

21:55:19.368 -> *WM: AutoConnect
21:55:19.368 -> *WM: Connecting as wifi client...
21:55:19.368 -> *WM: Status:
21:55:19.368 -> *WM: 6
21:55:19.368 -> *WM: Using last saved values, should be faster
21:55:22.958 -> *WM: Connection result: 
21:55:22.958 -> *WM: 3
21:55:22.958 -> *WM: IP Address:
21:55:22.958 -> *WM: 192.168.0.102
21:55:23.004 -> connected...yeey :)
21:55:23.004 -> IP Address: 192.168.0.102
21:55:23.004 -> *WM: freeing allocated params!

Here is the code:

#include <ESP8266WiFi.h>          //https://github.com/esp8266/Arduino

//needed for library
#include <DNSServer.h>
#include <ESP8266WebServer.h>
#include <WiFiManager.h>         //https://github.com/tzapu/WiFiManager

unsigned long lastLEDMillis = 0;      // will store the last time the LED was updated
unsigned long interval = 3000;        // place holder, will be updated in the LED blink

int ledState=HIGH;
int blinkTime =             1;       // blink on duration

void setup() {
    // put your setup code here, to run once:

    // LEDs and PINs used for logic
    pinMode(2, OUTPUT);                // on-board LED
    digitalWrite(2, LOW);              // LOW = LED on

    Serial.begin(115200);

IPAddress(255,255,255,0));

    wifiManager.autoConnect("AutoConnectAP", "gaslights");

    //if you get here you have connected to the WiFi
    Serial.println("connected...yeey :)");
    Serial.print("IP Address: ");
    Serial.println(WiFi.localIP());
}

void loop() {
    // put your main code here, to run repeatedly:

    unsigned long currentMillis = millis();

    // >>>  Simple code to flash the on-board LED every 3 seconds, no delay
    if (currentMillis - lastLEDMillis > interval) {

    lastLEDMillis = currentMillis;
    ledState = !ledState;

    // if the LED is off, turn it on and vice-versa:
    if (ledState == HIGH)
    {
      digitalWrite(2, LOW);
      interval = blinkTime;
    }
    else
    {
      digitalWrite(2, HIGH);
      interval = 3000;
    }
  }

}

The {ERROR} *WM : WiFi.begin res: that we're seeing in the first Serial print log is un-expected, I'm starting to think this is NOT the problem. If everyone else is able to use the 8266 as a STA right after the autoConnect() without doing a hard reset, then something else is going on. I'm going to share this with @pvint - vintlabs/FauxmoESP. See if he can shed his intelligence on the subject. Thanks Paul for your help.

David

tablatronix commented 3 years ago

Ok so I am going to say use the dev/alpha version, there was some fixes for this kind of stuff added and better logging. I cannot say for sure but there was some clean connect stuff I worked out to fix odd issues like this

tablatronix commented 3 years ago

There is a clean connect, let me find it

These are new might only be in the github version, development branch

// set wifi connect retries // wm.setConnectRetries(2);

// This is sometimes necessary, it is still unknown when and why this is needed but it may solve some race condition or bug in esp SDK/lib // wm.setCleanConnect(true); // disconnect before connect, clean connect

Some other things you can try, set proper country set channel, shrug

// set country // setting wifi country seems to improve OSX soft ap connectivity, // may help others as well, default is CN which has different channels wm.setCountry("US");

Finally, make sure you are using a good power supply!

pvint commented 3 years ago

I just tested with the development branch, both with and without .setCleanConnect(true) and the issue remains. I'll try to look a bit more later on.

ddweber456 commented 3 years ago

@pvint were you able to do any additional testing? Could this be because FauxmoESP is using UDP?

Even though we are seeing an ERROR from WM: connectWiFi() returning to the calling WM: autoConnect() (see comment of 5 days ago https://github.com/tzapu/WiFiManager/issues/1142#issuecomment-733396464 ) it appears most everyone else is able use the ESP as a STA without doing a hard reset. It not just my code that is producing this WM: ERROR, it is also happening in the example sketches WM 0.15.0. https://github.com/tzapu/WiFiManager/issues/1142#issuecomment-733456344

tablatronix commented 3 years ago

It could be router specific. I will test this on some of my boards when I have time.

If you have a bin? I can try that too. Otherwise I will use latest stable of all and wm /dev latest

ddweber456 commented 3 years ago

It could be router specific. I will test this on some of my boards when I have time.

I've taken the unit to 8 to 10 client locations, there's no difference. I've always had to do a hard reset.

Any progress in finding a fix? Is there anything I can help you with? david

ddweber456 commented 3 years ago

@tablatronix Hey, just checking in to see if you had made any progress. I hope the silence is not an indication of bad news.

tablatronix commented 3 years ago

Sorry I will try to test here tomorrow

pvint commented 3 years ago

It would be interesting to try to reproduce the issue in a simpler manner - get rid of all the fauxmo stuff and just insert a sendUDPPacket(data, dst, port) sort of thing and see if we can narrow it down. (I made up that function name...)

I'll try to have a look in the morning (in 12 hours or so)

tablatronix commented 3 years ago

I am not sure what to expect here, it seems to work, not sure how I test it, alexa needs wemo skill ? My homeassistant isnt finding a new device but I do have these [FAUXMO] Responding to M-SEARCH request and

[FAUXMO] Handling devicetype request
[FAUXMO] Client #0 disconnected
[FAUXMO] Client #0 connected
[FAUXMO] Handling list request
[FAUXMO] Sending device info for "yellow lamp", uniqueID = "1a6083b4d603"
[FAUXMO] Sending device info for "green lamp", uniqueID = "ea4c8bf1b2e4"
tablatronix commented 3 years ago

fauxmo runs a webserver, I would suspect that before anything, make sure wm is destroyed before starting the fauxmo one

ddweber456 commented 3 years ago

That sounds good...sooo how do you stop a server?

tablatronix commented 3 years ago

I have seen issues with running another webserver even though wm stops it Maybe since we are using a shared pointer for the webserver now, or maybe stop() is not enough, I have not really had a look at it

bool WiFiManager::shutdownConfigPortal(){
  if(webPortalActive) return false;

  //DNS handler
  dnsServer->processNextRequest();
  //HTTP handler
  server->handleClient();

  // @todo what is the proper way to shutdown and free the server up
  server->stop();
  server.reset();
  dnsServer->stop(); //  free heap ?
  dnsServer.reset();
ddweber456 commented 3 years ago

What if I did all the WiFiManager stuff, including the WiFiManager MW; in it own function, called from Setup(). When focus is lost, that should destroy WM and the Server. Right?

tablatronix commented 3 years ago

It should, if you take it out of global scope.

ddweber456 commented 3 years ago

The ESP SDK is very persistent in keeping the server, once established, connected and running. Moving the creation of the server out of global scope in its own separate function did not work. Server remained regardless of scope.

ddweber456 commented 3 years ago

@tablatronix Could it be that somehow WM is effecting Port 80, blocking FauxmoESP from being able to use 80 to receive UDP messages?

tablatronix commented 3 years ago

Yes, that is what I think, if you use an alt port to test it will be evident. I meant to say that the other day, using 2 web servers on the same port seems to be impossible, not sure how to properly destruct the webserver

// set port of webserver, 80
void          setHttpPort(uint16_t port);
ddweber456 commented 3 years ago

Can you be a little more specific how and where to implement is for testing? thanks