ESP82xx_mega-20210503 WiFi problem

Moderators: grovkillen, Stuntteam, TD-er

Message
Author
mackowiakp
Normal user
Posts: 313
Joined: 07 Jun 2018, 06:47
Location: Gdynia/Poland

ESP82xx_mega-20210503 WiFi problem

#1 Post by mackowiakp » 03 May 2021, 19:30

I just compiled ESP82xx_mega-20210503 custom version of FW.
I have two WiFi AP defined, primary and fallback.
WiFiDisconnect command cause reboot of ESP.
The same is true when the first AP disappears (e.g. due to a failure) and the ESP has to switch to the second AP.
I did not have to deal with this in the previous FW version.
Is there is any possible workaround or it is just a bug ?

TD-er
Core team member
Posts: 4932
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: ESP82xx_mega-20210503 WiFi problem

#2 Post by TD-er » 03 May 2021, 19:53

Sounds like a (serious) bug.

Can you give some more info on what is running on the ESP?
How much free memory do you have?
Is "Periodical Scan WiFi" enabled (Tools -> Advanced) ?

mackowiakp
Normal user
Posts: 313
Joined: 07 Jun 2018, 06:47
Location: Gdynia/Poland

Re: ESP82xx_mega-20210503 WiFi problem

#3 Post by mackowiakp » 03 May 2021, 20:11

I am running ESP_Easy_mega_20210503_custom_ESP8266_4M1M.bin. Custom.h. 806,3 kB size.
I removed fallback AP from config because of this issue.

Output from "Main" menu:

Code: Select all

Unit Number:	1
Local Time:	2021-05-03 20:08:14
Uptime:	0 days 0 hours 50 minutes
Load:	14.39% (LC=1691)
CPU Eco Mode:	false
Boot:	Manual reboot (3)
Reset Reason:	Software/System restart
Last Action before Reboot:	15 timer, id: 5
SW WD count:	0
Memory
Free RAM:	17000
Heap Max Free Block:	12080
Heap Fragmentation:	27%
Free Stack:	3664
Network
IP Config:	Static
IP / Subnet:	192.168.0.20 / 255.255.255.0
Gateway:	192.168.0.1
Client IP:	192.168.0.2
DNS:	192.168.0.201 / (IP unset)
Allowed IP Range:	192.168.0.0 - 192.168.0.255
Connected:	50 m 9 s
Number Reconnects:	0
WiFi ❔
Wifi Connection:	802.11n (RSSI -65 dBm)
SSID:	WiFi-Fritz (08:96:D7:F1:DF:1E)
Channel:	12
Encryption Type:	WPA/WPA2/PSK
Last Disconnect Reason:	(1) Unspecified
Configured SSID1:	WiFi-Fritz
Configured SSID2:	
STA MAC:	DC:4F:22:39:15:F6
AP MAC:	DE:4F:22:39:15:F6
WiFi Settings
Force WiFi B/G:	false
Restart WiFi Lost Conn:	true
Force WiFi No Sleep:	true
Periodical send Gratuitous ARP:	false
Connection Failure Threshold:	0
Max WiFi TX Power:	17.50
Current WiFi TX Power:	14.00
WiFi Sensitivity Margin:	3
Send With Max TX Power:	false
Extra WiFi scan loops:	0
Periodical Scan WiFi:	true
Firmware
Build:⋄	20113 - Mega
System Libraries:⋄	ESP82xx Core 2843a5ac, NONOS SDK 2.2.2-dev(38a443e), LWIP: 2.1.2 PUYA support
Git Build:⋄	Skrzypowa: May 3 2021 14:02:07
Plugin Count:⋄	32
Build Origin:	Self built
Build Time:⋄	May 3 2021 14:02:09
Binary Filename:⋄	ESP_Easy_mega_20210503_custom_ESP8266_4M1M
Build Platform:⋄	Linux-5.10.33-desktop-1.mga8-x86_64-with-glibc2.2.5
Git HEAD:⋄	pygit2_not_installed
System Status
Syslog Log Level:	None
Serial Log Level:	None
Web Log Level:	None
Network Services
Network Connected:	✔
NTP Initialized:	✔
ESP Board
ESP Chip ID:	3741174 (0x3915F6)
ESP Chip Frequency:	80 MHz
ESP Chip Model:	ESP8266
ESP Chip Cores:	1
ESP Board Name:	PLATFORMIO_ESP12E
Storage
Flash Chip ID:	Vendor: 0xC2 Device: 0x2516
Flash Chip Real Size:	4096 kB
Flash IDE Size:	4096 kB
Flash IDE Speed:	40 MHz
Flash IDE Mode:	DOUT
Flash Writes:	2 daily / 3 boot
Sketch Size:	806 kB (2264 kB free)
Max. OTA Sketch Size:	1019 kB (1044464 bytes)
OTA possible:	true
OTA 2-step Needed:	false
SPIFFS Size:	934 kB (841 kB free)
Page size:	256
Block size:	8192
Number of blocks:	116
Maximum open files:	5
Maximum path length:	32

"Periodical Scan WiFi" is enabled

TD-er
Core team member
Posts: 4932
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: ESP82xx_mega-20210503 WiFi problem

#4 Post by TD-er » 03 May 2021, 20:27

How is the fallback AP defined?
In a Custom.h or using the settings?
How do you build it? Using Custom.h?

mackowiakp
Normal user
Posts: 313
Joined: 07 Jun 2018, 06:47
Location: Gdynia/Poland

Re: ESP82xx_mega-20210503 WiFi problem

#5 Post by mackowiakp » 03 May 2021, 20:40

Both AP primary and fallback are defined from "Config" menu.
In config output I sent You does not have fallback AP defined because of reboot issue (normally is).
Compilation done using Custom.h. In Custom.h I have defined only primary temporary AP, necessary for initial config.
So actually use AP`s are always defined from "Config" menu.

TD-er
Core team member
Posts: 4932
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: ESP82xx_mega-20210503 WiFi problem

#6 Post by TD-er » 03 May 2021, 22:41

Do you have any idea what causes the reboot?
Is it an exception? WD timer reboot?

Can you make sure this define is NOT present:
#define BUILD_NO_DEBUG

Then I would like to know what the sysinfo states under "Last Action before Reboot" after it crashes.

mackowiakp
Normal user
Posts: 313
Joined: 07 Jun 2018, 06:47
Location: Gdynia/Poland

Re: ESP82xx_mega-20210503 WiFi problem

#7 Post by mackowiakp » 04 May 2021, 06:39

Can you make sure this define is NOT present:
#define BUILD_NO_DEBUG
Yes, it was present in Custom.h. So I commented this line and compiled FW again. New FW was right now downloaded to ESP.
So all the rest observations/results are done without BUILD_NO_DEBUG flag.
Then I would like to know what the sysinfo states under "Last Action before Reboot" after it crashes.
This is part of output after "wifidisconnect" command. It caused reboot of ESP as in former ver of FW.
Fallback AP is not defined at this moment.

Code: Select all

Last Action before Reboot:	Const Interval: TIMER_1SEC
Last Disconnect Reason:	(1) Unspecified
And full output:

Code: Select all

Unit Number:	1
Local Time:	2021-05-04 06:15:37
Uptime:	0 days 0 hours 8 minutes
Load:	24.89% (LC=1983)
CPU Eco Mode:	false
Boot:	Manual reboot (2)
Reset Reason:	Exception
Last Action before Reboot:	Const Interval: TIMER_1SEC
SW WD count:	0
Memory
Free RAM:	15200 (10864 - sendContentBlocking)
Heap Max Free Block:	9216
Heap Fragmentation:	36%
Free Stack:	3664 (1216 - sendContentBlocking)
Network
IP Config:	Static
IP / Subnet:	192.168.0.20 / 255.255.255.0
Gateway:	192.168.0.1
Client IP:	192.168.0.2
DNS:	192.168.0.201 / (IP unset)
Allowed IP Range:	192.168.0.0 - 192.168.0.255
Connected:	8 m 1 s
Number Reconnects:	0
WiFi ❔
Wifi Connection:	802.11n (RSSI -65 dBm)
SSID:	WiFi-Fritz (08:96:D7:F1:DF:1E)
Channel:	12
Encryption Type:	
Last Disconnect Reason:	(1) Unspecified
Configured SSID1:	WiFi-Fritz
Configured SSID2:	
STA MAC:	DC:4F:22:39:15:F6
AP MAC:	DE:4F:22:39:15:F6
WiFi Settings
Force WiFi B/G:	false
Restart WiFi Lost Conn:	true
Force WiFi No Sleep:	true
Periodical send Gratuitous ARP:	false
Connection Failure Threshold:	0
Max WiFi TX Power:	17.50
Current WiFi TX Power:	14.00
WiFi Sensitivity Margin:	3
Send With Max TX Power:	false
Extra WiFi scan loops:	0
Periodical Scan WiFi:	true
Firmware
Build:⋄	20113 - Mega
System Libraries:⋄	ESP82xx Core 2843a5ac, NONOS SDK 2.2.2-dev(38a443e), LWIP: 2.1.2 PUYA support
Git Build:⋄	Skrzypowa: May 4 2021 06:00:13
Plugin Count:⋄	32
Build Origin:	Self built
Build Time:⋄	May 4 2021 06:00:11
Binary Filename:⋄	ESP_Easy_mega_20210504_custom_ESP8266_4M1M
Build Platform:⋄	Linux-5.10.33-desktop-1.mga8-x86_64-with-glibc2.2.5
Git HEAD:⋄	pygit2_not_installed
System Status
Syslog Log Level:	None
Serial Log Level:	None
Web Log Level:	None
Network Services
Network Connected:	✔
NTP Initialized:	✔
ESP Board
ESP Chip ID:	3741174 (0x3915F6)
ESP Chip Frequency:	80 MHz
ESP Chip Model:	ESP8266
ESP Chip Cores:	1
ESP Board Name:	PLATFORMIO_ESP12E
Storage
Flash Chip ID:	Vendor: 0xC2 Device: 0x2516
Flash Chip Real Size:	4096 kB
Flash IDE Size:	4096 kB
Flash IDE Speed:	40 MHz
Flash IDE Mode:	DOUT
Flash Writes:	0 daily / 0 boot
Sketch Size:	828 kB (2240 kB free)
Max. OTA Sketch Size:	1019 kB (1044464 bytes)
OTA possible:	true
OTA 2-step Needed:	false
SPIFFS Size:	934 kB (841 kB free)
Page size:	256
Block size:	8192
Number of blocks:	116
Maximum open files:	5
Maximum path length:	32
Do you have any idea what causes the reboot?
Is it an exception? WD timer reboot?
Generally, I have no idea. But maybe my observations will prove helpful.
Reboot of ESP is always done with the command "wifidisconnect".
The first AP is defined as the one seen with a signal level of -60 to -65 dB.
The more distant AP is defined as fallback, seen with a signal level of -75 to -85 dB.
I don't know why, but always after rebooting, the ESP connects to the fallback AP, not the one seen with the better signal level. Therefore, I removed it from the current configuration.
However, if AP fallback is defined, then at such low signal levels, the ESP most likely loses communication and tries to reconnect. This causes - in my opinion - an ESP reboot. However, it never connects to the "better" AP defined first.

TD-er
Core team member
Posts: 4932
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: ESP82xx_mega-20210503 WiFi problem

#8 Post by TD-er » 04 May 2021, 10:37

The "reset reason" is mentioned on the sysinfo page.

With current builds (was already present in the February build) the WiFi credentials are placed in a list and matched against the scan result.
This yields a list of possible candidates which are then sorted by RSSI value.

However, if an AP is not seen by a scan (which happens quite often) then the "best" AP may not appear in this list of candidates.

When a connection is lost, the next candidate is tried.
However, if a connection is considered stable, the candidates list is cleared and only the current one is kept.
So if after a while (5 minutes) the list is cleared, it should try to reconnect to the current AP.
If that fails, the list of candidates is empty and the unit must perform a new scan to get a new list of candidates.

With the new periodical scan, the ESP will perform a scan in the background every N seconds, which does result in a longer list of candidates to choose from.
So there is a greater chance the ESP may then know about the "better" AP.

TD-er
Core team member
Posts: 4932
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: ESP82xx_mega-20210503 WiFi problem

#9 Post by TD-er » 04 May 2021, 10:43

Can you try testing a build with this PR? https://github.com/letscontrolit/ESPEasy/pull/3608

mackowiakp
Normal user
Posts: 313
Joined: 07 Jun 2018, 06:47
Location: Gdynia/Poland

Re: ESP82xx_mega-20210503 WiFi problem

#10 Post by mackowiakp » 04 May 2021, 10:52

And that's why I was doing "wifi disconnect" every hour to make sure the better AP was chosen. But he is still chosen inferior.
I mostly use mega-20191208 because it works very stably and everything I have is enough for what I need.
Also, the WiFi behavior is exactly what I need, including correctly switching from first AP to fallback and back to the better one within an hour. And there is never a reboot of the entire ESP.
However, due to the lack of BME680, I compiled the latest versions. And here's the problem. But well. This is what happens with new software.

TD-er
Core team member
Posts: 4932
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: ESP82xx_mega-20210503 WiFi problem

#11 Post by TD-er » 04 May 2021, 10:55

I have been testing this for a long time myself and I have not seen reboots when disconnecting.
So I wonder what else you may have configured on your node.

For example:
- Send log to syslog server
- What controllers do you use?
- Do you use ESPEasy p2p?
- etc.

mackowiakp
Normal user
Posts: 313
Joined: 07 Jun 2018, 06:47
Location: Gdynia/Poland

Re: ESP82xx_mega-20210503 WiFi problem

#12 Post by mackowiakp » 04 May 2021, 11:05

- Send log to syslog server
No
- What controllers do you use?
Domoticz HTTP
- Do you use ESPEasy p2p?
No
- etc.
I use several SendToHTTP to send value from multi-value sensor (like BME680. PMSx003) as sub-sets of parameters to Domoticz virtual sensors.

mackowiakp
Normal user
Posts: 313
Joined: 07 Jun 2018, 06:47
Location: Gdynia/Poland

Re: ESP82xx_mega-20210503 WiFi problem

#13 Post by mackowiakp » 04 May 2021, 11:07

Can you try testing a build with this PR? https://github.com/letscontrolit/ESPEasy/pull/3608
Sorry, I am not so familiar with GitHub so can not find FW binary in link You mentioned. Can You send me just link to binary?

TD-er
Core team member
Posts: 4932
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: ESP82xx_mega-20210503 WiFi problem

#14 Post by TD-er » 04 May 2021, 11:31

I just started to make a test build, but I am also looking at the code of what may be related.
The wifidisconnect command is handled in the TIMER_1SEC loop, so I guess it really has something to do with only the wifidisconnect.

How do you give that command? Via the button on the web interface (Tools page) ?

mackowiakp
Normal user
Posts: 313
Joined: 07 Jun 2018, 06:47
Location: Gdynia/Poland

Re: ESP82xx_mega-20210503 WiFi problem

#15 Post by mackowiakp » 04 May 2021, 11:45

In all my ESP units, based on mega-20191208 "wifidisconnect" is triggered by rule timer (every 59 min). It works properly with the same AP`s.
In one ESP I use 24/7 and second dedicated for tests, both updated to mega-20210503 reboots accrues triggered in the same situation as above, by entering manually command in "Tools" menu, by clicking "Wifidisconnect" button in the same menu and - probably - when connection is lost.

EDIT

Changed name of button !!!!

TD-er
Core team member
Posts: 4932
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: ESP82xx_mega-20210503 WiFi problem

#16 Post by TD-er » 04 May 2021, 12:50


mackowiakp
Normal user
Posts: 313
Joined: 07 Jun 2018, 06:47
Location: Gdynia/Poland

Re: ESP82xx_mega-20210503 WiFi problem

#17 Post by mackowiakp » 04 May 2021, 14:29

OK. Thanks. I'll try it tonight. Now I have to go to town to do some errands.

TD-er
Core team member
Posts: 4932
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: ESP82xx_mega-20210503 WiFi problem

#18 Post by TD-er » 04 May 2021, 16:49

Oh just another question....
This "best" AP, is it one with a hidden SSID?

mackowiakp
Normal user
Posts: 313
Joined: 07 Jun 2018, 06:47
Location: Gdynia/Poland

Re: ESP82xx_mega-20210503 WiFi problem

#19 Post by mackowiakp » 04 May 2021, 17:02

No. Both "best" and fallback AP`s does not have hidden SSID

mackowiakp
Normal user
Posts: 313
Joined: 07 Jun 2018, 06:47
Location: Gdynia/Poland

Re: ESP82xx_mega-20210503 WiFi problem

#20 Post by mackowiakp » 04 May 2021, 18:09

OK. I an back. Just compiled custom FW using sources from Your link. (ESPEasy_ESP82xx_mega-20210503-4-PR_3608)
After entering "wifidisconnect" command in "Tools" menu or after clicking on "Wi-Fi Disconnect", ESP reboots as in previous vers.

Below full output form "Main" menu:

Code: Select all

Unit Number:	1
Local Time:	2021-05-04 18:05:50
Uptime:	0 days 0 hours 20 minutes
Load:	27.02% (LC=1912)
CPU Eco Mode:	false
Boot:	Manual reboot (6)
Reset Reason:	Exception
Last Action before Reboot:	Const Interval: TIMER_1SEC
SW WD count:	0
Memory
Free RAM:	15000 (10968 - sendContentBlocking)
Heap Max Free Block:	9600
Heap Fragmentation:	33%
Free Stack:	3664 (1520 - sendContentBlocking)
Network
IP Config:	Static
IP / Subnet:	192.168.0.20 / 255.255.255.0
Gateway:	192.168.0.1
Client IP:	192.168.0.2
DNS:	192.168.0.201 / (IP unset)
Allowed IP Range:	192.168.0.0 - 192.168.0.255
Connected:	20 m 25 s
Number Reconnects:	0
WiFi ❔
WiFi Connection:	802.11n (RSSI -68 dBm)
SSID:	WiFi-Fritz (08:96:D7:F1:DF:1E)
Channel:	12
Encryption Type:	
Last Disconnect Reason:	(1) Unspecified
Configured SSID1:	WiFi-Fritz
Configured SSID2:	
STA MAC:	DC:4F:22:39:15:F6
AP MAC:	DE:4F:22:39:15:F6
WiFi Settings
Force WiFi B/G:	false
Restart WiFi Lost Conn:	true
Force WiFi No Sleep:	true
Periodical send Gratuitous ARP:	false
Connection Failure Threshold:	0
Max WiFi TX Power:	17.50
Current WiFi TX Power:	14.00
WiFi Sensitivity Margin:	3
Send With Max TX Power:	false
Extra WiFi scan loops:	0
Periodical Scan WiFi:	true
Firmware
Build:⋄	20113 - Mega
System Libraries:⋄	ESP82xx Core 2843a5ac, NONOS SDK 2.2.2-dev(38a443e), LWIP: 2.1.2 PUYA support
Git Build:⋄	Skrzypowa: May 4 2021 16:51:11
Plugin Count:⋄	32
Build Origin:	Self built
Build Time:⋄	May 4 2021 16:51:12
Binary Filename:⋄	ESP_Easy_mega_20210504_custom_ESP8266_4M1M
Build Platform:⋄	Linux-5.10.33-desktop-1.mga8-x86_64-with-glibc2.2.5
Git HEAD:⋄	pygit2_not_installed
System Status
Syslog Log Level:	None
Serial Log Level:	None
Web Log Level:	None
Network Services
Network Connected:	✔
NTP Initialized:	✔
ESP Board
ESP Chip ID:	3741174 (0x3915F6)
ESP Chip Frequency:	80 MHz
ESP Chip Model:	ESP8266
ESP Chip Cores:	1
ESP Board Name:	PLATFORMIO_ESP12E
Storage
Flash Chip ID:	Vendor: 0xC2 Device: 0x2516
Flash Chip Real Size:	4096 kB
Flash IDE Size:	4096 kB
Flash IDE Speed:	40 MHz
Flash IDE Mode:	DOUT
Flash Writes:	0 daily / 0 boot
Sketch Size:	828 kB (2240 kB free)
Max. OTA Sketch Size:	1019 kB (1044464 bytes)
OTA possible:	true
OTA 2-step Needed:	false
SPIFFS Size:	934 kB (841 kB free)
Page size:	256
Block size:	8192
Number of blocks:	116
Maximum open files:	5
Maximum path length:	32
And just in case, my Custom.h file

Code: Select all

#ifndef ESPEASY_CUSTOM_H
#define ESPEASY_CUSTOM_H

/*
    To modify the stock configuration without changing the EspEasy.ino file :

    1) rename this file to "Custom.h" (It is ignored by Git)
    2) define your own settings below
    3) define USE_CUSTOM_H as a build flags. ie : export PLATFORMIO_BUILD_FLAGS="'-DUSE_CUSTOM_H'"
 */


/*

 #######################################################################################################
   Your Own Default Settings
 #######################################################################################################

    You can basically ovveride ALL macro defined in ESPEasy.ino.
    Don't forget to first #undef each existing #define that you add below.
    But since this Custom.h is included before other defines are made, you don't have to undef a lot of defines.

    Here are some examples:
 */

//#define FEATURE_SD
#ifdef BUILD_GIT
# undef BUILD_GIT
#endif // ifdef BUILD_GIT

#define BUILD_GIT           "Skrzypowa: "  __DATE__ " "  __TIME__


#define DEFAULT_NAME        "ESP-Skrzypowa"                        // Enter your device friendly name
#define UNIT                0                                        // Unit Number
#define DEFAULT_DELAY       60                                       // Sleep Delay in seconds

// --- Wifi AP Mode (when your Wifi Network is not reachable) ----------------------------------------
#define DEFAULT_AP_IP       192, 168, 4, 1                           // Enter IP address (comma separated) for AP (config) mode
#define DEFAULT_AP_SUBNET   255, 255, 255, 0                         // Enter IP address (comma separated) for AP (config) mode
#define DEFAULT_AP_KEY      "configesp"                              // Enter network WPA key for AP (config) mode

// --- Wifi Client Mode -----------------------------------------------------------------------------
#define DEFAULT_SSID                         "maciek24"            // Enter your network SSID
#define DEFAULT_KEY                          "lans3lans3" // Enter your network WPA key
#define DEFAULT_USE_STATIC_IP                true                   // (true|false) enabled or disabled static IP
#define DEFAULT_IP                           "192.168.0.150"          // Enter your IP address
#define DEFAULT_DNS                          "192.168.0.201"           // Enter your DNS
#define DEFAULT_GW                           "192.168.0.1"           // Enter your Gateway
#define DEFAULT_SUBNET                       "255.255.255.0"         // Enter your Subnet
#define DEFAULT_IPRANGE_LOW                  "0.0.0.0"               // Allowed IP range to access webserver
#define DEFAULT_IPRANGE_HIGH                 "255.255.255.255"       // Allowed IP range to access webserver
#define DEFAULT_IP_BLOCK_LEVEL               1                       // 0: ALL_ALLOWED  1: LOCAL_SUBNET_ALLOWED  2:
// ONLY_IP_RANGE_ALLOWED
#define DEFAULT_ADMIN_USERNAME               "admin"

#define DEFAULT_WIFI_CONNECTION_TIMEOUT      10000 // minimum timeout in ms for WiFi to be connected.
#define DEFAULT_WIFI_FORCE_BG_MODE           false // when set, only allow to connect in 802.11B or G mode (not N)
#define DEFAULT_WIFI_RESTART_WIFI_CONN_LOST  false // Perform wifi off and on when connection was lost.
#define DEFAULT_ECO_MODE                     false // When set, make idle calls between executing tasks.
#define DEFAULT_WIFI_NONE_SLEEP              false // When set, the wifi will be set to no longer sleep (more power
// used and need reboot to reset mode)
#define DEFAULT_GRATUITOUS_ARP               false // When set, the node will send periodical gratuitous ARP
// packets to announce itself.

// --- Default Controller ------------------------------------------------------------------------------
#define DEFAULT_CONTROLLER   false                                          // true or false enabled or disabled, set 1st controller
                                                                            // defaults
#define DEFAULT_CONTROLLER_ENABLED true                                     // Enable default controller by default

// using a default template, you also need to set a DEFAULT PROTOCOL to a suitable MQTT protocol !
#define DEFAULT_PUB         "sensors/espeasy/%sysname%/%tskname%/%valname%" // Enter your pub
#define DEFAULT_SUB         "sensors/espeasy/%sysname%/#"                   // Enter your sub
#define DEFAULT_SERVER      "192.168.0.25"                                   // Enter your Server IP address
#define DEFAULT_SERVER_HOST ""                                              // Server hostname
#define DEFAULT_SERVER_USEDNS false                                         // true: Use hostname.  false: use IP

#define DEFAULT_PORT        8080                                            // Enter your Server port value

#define DEFAULT_PROTOCOL    1                                               // Protocol used for controller communications
                                                                            //   0 = Stand-alone (no controller set)
                                                                            //   1 = Domoticz HTTP
                                                                            //   2 = Domoticz MQTT
                                                                            //   3 = Nodo Telnet
                                                                            //   4 = ThingSpeak
                                                                            //   5 = Home Assistant (openHAB) MQTT
                                                                            //   6 = PiDome MQTT
                                                                            //   7 = EmonCMS
                                                                            //   8 = Generic HTTP
                                                                            //   9 = FHEM HTTP

#define DEFAULT_PIN_I2C_SDA                     4
#define DEFAULT_PIN_I2C_SCL                     5

#define DEFAULT_PIN_STATUS_LED                  (-1)
#define DEFAULT_PIN_STATUS_LED_INVERSED         true


#define DEFAULT_USE_RULES                       true             // (true|false) Enable Rules?
#define DEFAULT_RULES_OLDENGINE                 true

#define DEFAULT_MQTT_RETAIN                     false             // (true|false) Retain MQTT messages?
#define DEFAULT_MQTT_DELAY                      100               // Time in milliseconds to retain MQTT messages
#define DEFAULT_MQTT_LWT_TOPIC                  ""                // Default lwt topic
#define DEFAULT_MQTT_LWT_CONNECT_MESSAGE        "Connected"       // Default lwt message
#define DEFAULT_MQTT_LWT_DISCONNECT_MESSAGE     "Connection Lost" // Default lwt message
#define DEFAULT_MQTT_USE_UNITNAME_AS_CLIENTID   0

#define DEFAULT_USE_NTP                         true             // (true|false) Use NTP Server
#define DEFAULT_NTP_HOST                        "192.168.0.25"                // NTP Server Hostname
#define DEFAULT_TIME_ZONE                       60                 // Time Offset (in minutes)
#define DEFAULT_USE_DST                         true             // (true|false) Use Daily Time Saving

#define DEFAULT_SYSLOG_IP                       ""                // Syslog IP Address
#define DEFAULT_SYSLOG_LEVEL                    0                 // Syslog Log Level
#define DEFAULT_SERIAL_LOG_LEVEL                LOG_LEVEL_INFO    // Serial Log Level
#define DEFAULT_WEB_LOG_LEVEL                   LOG_LEVEL_INFO    // Web Log Level
#define DEFAULT_SD_LOG_LEVEL                    0                 // SD Card Log Level
#define DEFAULT_USE_SD_LOG                      false             // (true|false) Enable Logging to the SD card

#define DEFAULT_USE_SERIAL                      true              // (true|false) Enable Logging to the Serial Port
#define DEFAULT_SERIAL_BAUD                     115200            // Serial Port Baud Rate
#define DEFAULT_SYSLOG_FACILITY                 0                 // kern

#define DEFAULT_SYNC_UDP_PORT                   0                 // Used for ESPEasy p2p. (IANA registered port: 8266)


// #define BUILD_NO_DEBUG


#define USES_SSDP


// #define USE_SETTINGS_ARCHIVE

/*
 #######################################################################################################
   Special settings  (rendering settings incompatible with other builds)
 #######################################################################################################
 */

// #define USE_NON_STANDARD_24_TASKS

/*
 #######################################################################################################
   Your Own selection of plugins and controllers
 #######################################################################################################
 */

#define CONTROLLER_SET_NONE
#define NOTIFIER_SET_NONE
#define PLUGIN_SET_NONE


/*
 #######################################################################################################
 ###########     Plugins
 #######################################################################################################
 */

// #define USE_SERVO


 #define USES_P001   // Switch
 #define USES_P002   // ADC
 #define USES_P003   // Pulse
 #define USES_P004   // Dallas
 #define USES_P005   // DHT
 #define USES_P006   // BMP085
 #define USES_P007   // PCF8591
// #define USES_P008   // RFID
 #define USES_P009   // MCP

 #define USES_P010   // BH1750
 #define USES_P011   // PME
 #define USES_P012   // LCD
 #define USES_P013   // HCSR04
 #define USES_P014   // SI7021
// #define USES_P015   // TSL2561
// #define USES_P017   // PN532
// #define USES_P018   // Dust
 #define USES_P019   // PCF8574

 #define USES_P020   // Ser2Net
 #define USES_P021   // Level
 #define USES_P022   // PCA9685
// #define USES_P023   // OLED
 #define USES_P024   // MLX90614
 #define USES_P025   // ADS1115
 #define USES_P026   // SysInfo
 #define USES_P027   // INA219
 #define USES_P028   // BME280
 #define USES_P029   // Output

 #define USES_P031   // SHT1X
 #define USES_P032   // MS5611
 #define USES_P033   // Dummy
 #define USES_P034   // DHT12
// #define USES_P036   // FrameOLED
 #define USES_P037   // MQTTImport
// #define USES_P038   // NeoPixel
// #define USES_P039   // Environment - Thermocouple

// #define USES_P040   // RFID - ID12LA/RDM6300
// #define USES_P041   // NeoClock
// #define USES_P042   // Candle
 #define USES_P043   // ClkOutput
// #define USES_P044   // P1WifiGateway
// #define USES_P045   // MPU6050
// #define USES_P046   // VentusW266
// #define USES_P047   // I2C_soil_misture
// #define USES_P048   // Motoshield_v2
// #define USES_P049   // MHZ19

// #define USES_P050   // TCS34725 RGB Color Sensor with IR filter and White LED
// #define USES_P051   // AM2320
// #define USES_P052   // SenseAir
 #define USES_P053   // PMSx003
// #define USES_P054   // DMX512
// #define USES_P055   // Chiming
// #define USES_P056   // SDS011-Dust
// #define USES_P057   // HT16K33_LED
// #define USES_P058   // HT16K33_KeyPad
// #define USES_P059   // Encoder

// #define USES_P060   // MCP3221
// #define USES_P061   // Keypad
// #define USES_P062   // MPR121_KeyPad
// #define USES_P063   // TTP229_KeyPad
// #define USES_P064   // APDS9960 Gesture
// #define USES_P065   // DRF0299
// #define USES_P066   // VEML6040
// #define USES_P067   // HX711_Load_Cell
// #define USES_P068   // SHT3x
// #define USES_P069   // LM75A

// #define USES_P070   // NeoPixel_Clock
// #define USES_P071   // Kamstrup401
// #define USES_P072   // HDC1080
// #define USES_P073   // 7DG
// #define USES_P074   // TSL2561
// #define USES_P075   // Nextion
// #define USES_P076   // HWL8012   in POW r1
// #define USES_P077   // CSE7766   in POW R2
// #define USES_P078   // Eastron Modbus Energy meters
// #define USES_P079   // Wemos Motoshield

// #define USES_P080   // iButton Sensor  DS1990A
// #define USES_P081   // Cron
// #define USES_P082   // GPS
// #define USES_P083   // SGP30
// #define USES_P084   // VEML6070
// #define USES_P085   // AcuDC24x
// #define USES_P086   // Receiving values according Homie convention. Works together with C014 Homie controller
 #define USES_P087   // Serial Proxy
// #define USES_P168   // FM Tuner

// Special plugins needing IR library
// #define USES_P016   // IR
// #define USES_P035   // IRTX
// #define P016_P035_Extended_AC // The following define is needed for extended decoding of A/C Messages and or using standardised 
                                 //common arguments for controlling all deeply supported A/C units
// #define P016_P035_USE_RAW_RAW2 //Use the RAW and RAW2 encodings, disabling it saves 3.7Kb
// #define USES_P088   // Heatpump IR
#define USES_P106     // BME680

/*
 #######################################################################################################
 ###########     Controllers
 #######################################################################################################
 */


 #define USES_C001   // Domoticz HTTP
 #define USES_C002   // Domoticz MQTT
// #define USES_C003   // Nodo telnet
// #define USES_C004   // ThingSpeak
// #define USES_C005   // Home Assistant (openHAB) MQTT
// #define USES_C006   // PiDome MQTT
// #define USES_C007   // Emoncms
 #define USES_C008   // Generic HTTP
// #define USES_C009   // FHEM HTTP
 #define USES_C010   // Generic UDP
 #define USES_C011   // Generic HTTP Advanced
// #define USES_C012   // Blynk HTTP
 #define USES_C013   // ESPEasy P2P network
// #define USES_C014   // homie 3 & 4dev MQTT
// #define USES_C015   // Blynk
 #define USES_C016   // Cache controller
// #define USES_C017   // Zabbix
// #define USES_C018   // TTN/RN2483


/*
 #######################################################################################################
 ###########     Notifiers
 #######################################################################################################
 */


// #define USES_N001   // Email
// #define USES_N002   // Buzzer


#endif // ESPEASY_CUSTOM_H

TD-er
Core team member
Posts: 4932
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: ESP82xx_mega-20210503 WiFi problem

#21 Post by TD-er » 04 May 2021, 18:28

mackowiakp wrote: 04 May 2021, 18:09 OK. I an back. Just compiled custom FW using sources from Your link. (ESPEasy_ESP82xx_mega-20210503-4-PR_3608)
[...]
Ehh, why did I need to compile builds then?

mackowiakp
Normal user
Posts: 313
Joined: 07 Jun 2018, 06:47
Location: Gdynia/Poland

Re: ESP82xx_mega-20210503 WiFi problem

#22 Post by mackowiakp » 04 May 2021, 18:41

To include not included by default devices, remove unnecessary to minimize output file size (to appx. 800kB), include default initial parameters to more close to the kind of FW I need.

TD-er
Core team member
Posts: 4932
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: ESP82xx_mega-20210503 WiFi problem

#23 Post by TD-er » 04 May 2021, 23:21

But then you could just download the sources from the PR I linked?
Or am I missing something here?

See here the PR: https://github.com/letscontrolit/ESPEasy/pull/3608
On the line right below the title:
TD-er wants to merge 3 commits into letscontrolit:mega from TD-er:bugfix/wifi_issues
This last part after "from" is the branch with the code and this is also a link.
Open it: https://github.com/TD-er/ESPEasy/tree/b ... ifi_issues
Then you can press the "Code" button and press "Download ZIP" to have a ZIP file with the exact code base I had for that PR.

mackowiakp
Normal user
Posts: 313
Joined: 07 Jun 2018, 06:47
Location: Gdynia/Poland

Re: ESP82xx_mega-20210503 WiFi problem

#24 Post by mackowiakp » 05 May 2021, 09:11

Ok. I took exactly the sources you indicated. And the situation is - it seems - a bit more complicated.
I loaded this FW into two ESPs. I use the first ESP for testing. It doesn't have any sensors connected, but they are defined in the configuration except they don't send anything to any Domoticz or the like.
In this example, when you type the command "WiFidisconnect", ESP connects to the "better" AP after a while and does not cause ESP to reboot.
The second copy of ESP is a really working device with connected sensors. Below I am attaching the device configuration in the form of a screenshot.
On this device, ESP performs a reboot after issuing the command "WiFidisconnect".
Screenshot_20210505_090902.png
Screenshot_20210505_090902.png (149.42 KiB) Viewed 2933 times

TD-er
Core team member
Posts: 4932
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: ESP82xx_mega-20210503 WiFi problem

#25 Post by TD-er » 05 May 2021, 09:35

So when creating an HTTP call right after the disconnect, the ESP reboots?

Can you show the controller config?
Does the other AP also have a different IP-subnet?
Can you also test with "Send Gratuituous ARP" enabled (Tools -> Advanced, bottom page)?

mackowiakp
Normal user
Posts: 313
Joined: 07 Jun 2018, 06:47
Location: Gdynia/Poland

Re: ESP82xx_mega-20210503 WiFi problem

#26 Post by mackowiakp » 05 May 2021, 09:39

Ok, Please wait because I am on shopping.

TD-er
Core team member
Posts: 4932
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: ESP82xx_mega-20210503 WiFi problem

#27 Post by TD-er » 05 May 2021, 11:19

I think I found your problem.

You probably get lots of WiFi disconnected messages like these: (a few per second)
WIFI : Disconnected! Reason: '(8) Assoc leave' Connected for 48 s

And when processing the disconnect it will then enter a recursion which leads to a stack overflow.

mackowiakp
Normal user
Posts: 313
Joined: 07 Jun 2018, 06:47
Location: Gdynia/Poland

Re: ESP82xx_mega-20210503 WiFi problem

#28 Post by mackowiakp » 05 May 2021, 13:40

So when creating an HTTP call right after the disconnect, the ESP reboots?
No. ESP reboots only when "wifidisconncet" command is run from "Tools" window, from timer rule, by clicking "WiFi Disconnect" in "Tools" menu or when AP is turn off (fallback is not define at this moment)
Can you show the controller config?
Below:
Screenshot_20210505_132921.png
Screenshot_20210505_132921.png (85.44 KiB) Viewed 2901 times
Screenshot_20210505_133113-1.png
Screenshot_20210505_133113-1.png (61.3 KiB) Viewed 2901 times
Does the other AP also have a different IP-subnet?
No. All my home nodes are in the same IP segment, except surveillance system
Can you also test with "Send Gratuituous ARP" enabled (Tools -> Advanced, bottom page)?
It does not changed situation. Reboots accrues in the same situations as previous.

mackowiakp
Normal user
Posts: 313
Joined: 07 Jun 2018, 06:47
Location: Gdynia/Poland

Re: ESP82xx_mega-20210503 WiFi problem

#29 Post by mackowiakp » 05 May 2021, 13:55

You probably get lots of WiFi disconnected messages like these: (a few per second)
WIFI : Disconnected! Reason: '(8) Assoc leave' Connected for 48 s
Perhaps you are right. But why the problem only occurs when sensors are connected and not in an example without sensors?
Why are reboots not present with previously used FW versions?
3 other ESPs and an LCD screen installed in the door of the LG refrigerator work with the same AP as the main one. Moreover, for the 5 other ESPs it is the fallback AP.
And everything worked without any problems (and still works) as long as he has the FW mega-20191208 version installed.
This particular ESP copy also had the mega-20191208 version. The reason why I decided to change the FW to mega-20210503 was because of adding the BME680 to it. This is due to the fact that after about 2 years DTH22 shows the external temperature OK but the humidity is given as a "random" value.
The DTH22 is not dismantled and serves as a "backup" outdoor temperature sensor.

TD-er
Core team member
Posts: 4932
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: ESP82xx_mega-20210503 WiFi problem

#30 Post by TD-er » 05 May 2021, 14:09

Can you fetch the source code of this PR: https://github.com/TD-er/ESPEasy/tree/b ... ollerqueue
This one hopefully also fixes your issues.

Direct link to the sources of that PR: https://github.com/TD-er/ESPEasy/archiv ... rqueue.zip

TD-er
Core team member
Posts: 4932
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: ESP82xx_mega-20210503 WiFi problem

#31 Post by TD-er » 05 May 2021, 14:15

mackowiakp wrote: 05 May 2021, 13:55
You probably get lots of WiFi disconnected messages like these: (a few per second)
WIFI : Disconnected! Reason: '(8) Assoc leave' Connected for 48 s
Perhaps you are right. But why the problem only occurs when sensors are connected and not in an example without sensors?
Why are reboots not present with previously used FW versions?
3 other ESPs and an LCD screen installed in the door of the LG refrigerator work with the same AP as the main one. Moreover, for the 5 other ESPs it is the fallback AP.
And everything worked without any problems (and still works) as long as he has the FW mega-20191208 version installed.
This particular ESP copy also had the mega-20191208 version. The reason why I decided to change the FW to mega-20210503 was because of adding the BME680 to it. This is due to the fact that after about 2 years DTH22 shows the external temperature OK but the humidity is given as a "random" value.
The DTH22 is not dismantled and serves as a "backup" outdoor temperature sensor.
Your previous build was from 2019 and I don't think we had ethernet support back then.
Part of the problems I just fixed in the PR I linked in my previous post is about "switching" between network media and that also introduced a bug where the disconnect was not always processed.
I also have recently changed the way how WiFi credentials are managed and how the unit handles WiFi scans as a scan not always finds all APs in the area.
This could lead to issues like this:
- Try connect to AP "AA" but only finds AP "BB"
- Try to connect to AP "BB" but only finds AP "AA"

Or similar situations where you have several APs with the same SSID.
Then there is no guarantee (and no work-around) to find the strongest one.
Also extending the number of WiFi credentials was really hard in the "old" system.

A way around not finding the strongest AP of interest is to increase the number of WiFi scans as it appends to the list of known APs.

I hope the changes in the linkes PR do fix your issues.

mackowiakp
Normal user
Posts: 313
Joined: 07 Jun 2018, 06:47
Location: Gdynia/Poland

Re: ESP82xx_mega-20210503 WiFi problem

#32 Post by mackowiakp » 05 May 2021, 14:51

Your previous build was from 2019 and I don't think we had ethernet support back then.
Yes. There is not Ethernet support for sure.
Or similar situations where you have several APs with the same SSID.
All my AP`s have different SSID, but the same credentials for ESP connections.

At the moment my situation is stable if:
- I will define only one AP, without fallback.
- I do not do "wifidisconnect" with timer rule every 59 minutes to force ESP switch to "better" AP if in the meantime it was unavailable for some reason and there was a fallback switch
Just in case, I reboot every ESP once every 24 hours, using the rule.
With the configuration described above, it ensures stable operation but without WiFi fallback protection.
Also extending the number of WiFi credentials was really hard in the "old" system.
I do not use extended credential
I hope the changes in the linkes PR do fix your issues.
As far as I know You, its for sure ! Well. "No bugs, no software" ;-)

User avatar
Ath
Normal user
Posts: 891
Joined: 10 Jun 2018, 12:06
Location: NL

Re: ESP82xx_mega-20210503 WiFi problem

#33 Post by Ath » 05 May 2021, 15:05

mackowiakp wrote: 05 May 2021, 14:51 At the moment my situation is stable if:
...
- I do not do "wifidisconnect" with timer rule every 59 minutes to force ESP switch to "better" AP if in the meantime it was unavailable for some reason and there was a fallback switch
Why would you do that, are your AP's turned off and on during the day in random sequences? If your WiFi was stable this wouldn't be needed, AFAICS.
/Ton

mackowiakp
Normal user
Posts: 313
Joined: 07 Jun 2018, 06:47
Location: Gdynia/Poland

Re: ESP82xx_mega-20210503 WiFi problem

#34 Post by mackowiakp » 05 May 2021, 15:36

Oh, the situation is complicated and sometimes funny.
My house is located in the forest.
Problematic ESP is located in garage, 20 m from the house. I don't know why, but the garage is powered by a different transformer station than the house.
I have constant problems with the power supply to the garage and I have power outages lasting even the whole day. The UPS is enough to support all the electronics there for 12 hours. Then the blackout and even the gate I have to open manually, not with the remote control.
They are supposed to fix it, but since I built this house 18 years ago, I can't ask the energy engineers to improve the situation.
In the house itself, there are also short breaks (several minutes) in the supply of energy. But a UPS for the home (powered by solar cells) lasts for about 2 hours. This is sufficient in most cases, but sometimes not.
Such situations occur in strong winds and in winter, when ice hangs on energetic lines or a tree breaks into them (this is quite common).
Not to mention that once a tree was cut by beavers living in a nearby lake and it broke the power line.
So ESP software even has to be "beaver-proof". ;-)

mackowiakp
Normal user
Posts: 313
Joined: 07 Jun 2018, 06:47
Location: Gdynia/Poland

Re: ESP82xx_mega-20210503 WiFi problem

#35 Post by mackowiakp » 05 May 2021, 17:00

TD-er wrote: 05 May 2021, 14:09 Can you fetch the source code of this PR: https://github.com/TD-er/ESPEasy/tree/b ... ollerqueue
This one hopefully also fixes your issues.

Direct link to the sources of that PR: https://github.com/TD-er/ESPEasy/archiv ... rqueue.zip
After successful compilation, I downloaded FW from the sources linked above to the test unit.
No connection to ESP, blue LED WiFi activity blinks once per second or so.
Fortunately, I didn't load this FW into a running device. First, I wanted to try it on a test unit.

TD-er
Core team member
Posts: 4932
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: ESP82xx_mega-20210503 WiFi problem

#36 Post by TD-er » 05 May 2021, 19:02

I did mainly test it (during development) on an ESP32, with LAN.
I will test it also on ESP8266 to see whether that may make a difference.

mackowiakp
Normal user
Posts: 313
Joined: 07 Jun 2018, 06:47
Location: Gdynia/Poland

Re: ESP82xx_mega-20210503 WiFi problem

#37 Post by mackowiakp » 05 May 2021, 19:06

Nice !

TD-er
Core team member
Posts: 4932
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: ESP82xx_mega-20210503 WiFi problem

#38 Post by TD-er » 05 May 2021, 22:36

Can you tyry this build, I made using your Custom.h
https://www.dropbox.com/s/7ttwtvxqophlq ... M.bin?dl=0

If that works, then I will try to put in a few other features and fixed to cover up the big "oopsie" bug I will deny ever happened :)

JimBobK27
Normal user
Posts: 9
Joined: 06 May 2021, 04:31

Re: ESP82xx_mega-20210503 WiFi problem

#39 Post by JimBobK27 » 06 May 2021, 05:10

Hello all, NEW comer to ESP Easy..... My problem is WHAT THE F__K is the fallback password for the fallback SSID of ESP-Easy....
I flashed OK, reset was spitting out logging messages, but trying to connect to ESP-Easy requires a PWA2 password..
WHICH I HAVE NO IDEA WHAT IT IS !!!!!! tried blank, NG tried configuresp NG tried ESP-Easy NG... running out of guesses...
Documentation is NO where to be found!!!!! What Gives??? README docs are useless.....

The bin file I used was : "ESP_Easy_mega_20210503_custom_alt_wifi_ESP8266_4M1M.bin" -- using ESPTool.py for flashing....

Please help me here a little, looks like just what I need to develop my own IoT....

:?: :?: :?: :?: :?: :?: :?: :?: :?: :?:

mackowiakp
Normal user
Posts: 313
Joined: 07 Jun 2018, 06:47
Location: Gdynia/Poland

Re: ESP82xx_mega-20210503 WiFi problem

#40 Post by mackowiakp » 06 May 2021, 05:27

My problem is WHAT THE F__K is the fallback password for the fallback SSID of ESP-Easy....
By default there is no fallback AP defined at all. Both SSID and pass.

mackowiakp
Normal user
Posts: 313
Joined: 07 Jun 2018, 06:47
Location: Gdynia/Poland

Re: ESP82xx_mega-20210503 WiFi problem

#41 Post by mackowiakp » 06 May 2021, 06:49

Can you tyry this build, I made using your Custom.h
https://www.dropbox.com/s/7ttwtvxqophlq ... M.bin?dl=0
Just flashed this FW to 24/7 working device. So far looks as big step ahead.
No reboots after entering "wifidisconnect" in "Tools" field or by clicking on "WiFi disconnect" option.
The problem that I notice is - as I wrote - I want to use a backup AP that is 15 to 20 dB worse than the primary one.
After each WiFi disconnect it always connect to the worse one not to the better.
Nevertheless, I enable the WiFi disconnect function every 59 minutes (from the timer rule).
So I can say something about stability after min 24 hours.
Everything is fine so far. But this always connecting to the "worse" AP is a bit "not cool".

TD-er
Core team member
Posts: 4932
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: ESP82xx_mega-20210503 WiFi problem

#42 Post by TD-er » 06 May 2021, 10:53

JimBobK27 wrote: 06 May 2021, 05:10 Hello all, NEW comer to ESP Easy..... My problem is WHAT THE F__K is the fallback password for the fallback SSID of ESP-Easy....
I flashed OK, reset was spitting out logging messages, but trying to connect to ESP-Easy requires a PWA2 password..
WHICH I HAVE NO IDEA WHAT IT IS !!!!!! tried blank, NG tried configuresp NG tried ESP-Easy NG... running out of guesses...
Documentation is NO where to be found!!!!! What Gives??? README docs are useless.....

The bin file I used was : "ESP_Easy_mega_20210503_custom_alt_wifi_ESP8266_4M1M.bin" -- using ESPTool.py for flashing....

Please help me here a little, looks like just what I need to develop my own IoT....

:?: :?: :?: :?: :?: :?: :?: :?: :?: :?:
If you used a 'nightly build' from the releases page of Github, then it is "configesp".
If it is the custom build I made for mackowiakp and linked above, then it is using the Custom.h he included.

You can also connect to the ESP over serial and change the WiFi credentials so the unit will connect to your WiFi.
Use the commands:

Code: Select all

wifissid,MyOwnWiFiSSID
wifikey,MyTopSecretPasswor
save
Please note you cannot correct typos, so better copy/paste it from a notepad.

TD-er
Core team member
Posts: 4932
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: ESP82xx_mega-20210503 WiFi problem

#43 Post by TD-er » 06 May 2021, 10:56

mackowiakp wrote: 06 May 2021, 06:49
Can you tyry this build, I made using your Custom.h
https://www.dropbox.com/s/7ttwtvxqophlq ... M.bin?dl=0
Just flashed this FW to 24/7 working device. So far looks as big step ahead.
No reboots after entering "wifidisconnect" in "Tools" field or by clicking on "WiFi disconnect" option.
The problem that I notice is - as I wrote - I want to use a backup AP that is 15 to 20 dB worse than the primary one.
After each WiFi disconnect it always connect to the worse one not to the better.
Nevertheless, I enable the WiFi disconnect function every 59 minutes (from the timer rule).
So I can say something about stability after min 24 hours.
Everything is fine so far. But this always connecting to the "worse" AP is a bit "not cool".
If you enter the wifidisconnect twice within 5 minutes, it will connect to the 'next' one.
Like I said, if it considered the connection stable (connected > 5 minutes), it will clear the list of potential candidates and only keep the current one.
So that's the one it will try next on lost connection.
The last active one is also stored in RTC, and re-used after a reboot.

mackowiakp
Normal user
Posts: 313
Joined: 07 Jun 2018, 06:47
Location: Gdynia/Poland

Re: ESP82xx_mega-20210503 WiFi problem

#44 Post by mackowiakp » 06 May 2021, 12:35

If you enter the wifidisconnect twice within 5 minutes, it will connect to the 'next' one.
OK. I will setup fallback AP again and will observe what happens.

mackowiakp
Normal user
Posts: 313
Joined: 07 Jun 2018, 06:47
Location: Gdynia/Poland

Re: ESP82xx_mega-20210503 WiFi problem

#45 Post by mackowiakp » 06 May 2021, 12:49

The last active one is also stored in RTC, and re-used after a reboot.
You mean "reboot ESP" or "reboot WiFi" ?

TD-er
Core team member
Posts: 4932
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: ESP82xx_mega-20210503 WiFi problem

#46 Post by TD-er » 06 May 2021, 17:11

reboot without power loss.
Either intended reboot, or crash :)

mackowiakp
Normal user
Posts: 313
Joined: 07 Jun 2018, 06:47
Location: Gdynia/Poland

Re: ESP82xx_mega-20210503 WiFi problem

#47 Post by mackowiakp » 06 May 2021, 17:50

No crash so far.... :D

But let's consider a situation like mine. So frequent power losses of either one or the other AP.
I set "WiFidisconnect" every 59 minutes, so that in the event of losing power to one of the APs, ESP would switch to the "better" AP after no more than 1 hour.
Of course, I am not the author of the software and what I am writing is just my suggestion. But maybe it should be next to the "wifidisconnect" command, for example, the "clear_wifi" command will clear the current AP table, create it from scratch and switch to the "best" AP.
It would help a lot in solving situations like mine.
In any case, the FW version you uploaded works as described without problems. Hopefully it will continue to do so. And I think it will be so.
Thank You very much !!!

TD-er
Core team member
Posts: 4932
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: ESP82xx_mega-20210503 WiFi problem

#48 Post by TD-er » 06 May 2021, 21:20

Why would you want to force it?
If the ESP looses connection, it will try to reconnect and if that fails, it will perform a scan and try to connect to whatever AP is available and matching the configured credentials.

JimBobK27
Normal user
Posts: 9
Joined: 06 May 2021, 04:31

Re: ESP82xx_mega-20210503 WiFi problem

#49 Post by JimBobK27 » 06 May 2021, 23:36

You can also connect to the ESP over serial and change the WiFi credentials so the unit will connect to your WiFi.
Use the commands:

wifissid,MyOwnWiFiSSID
wifikey,MyTopSecretPasswor
save

Please note you cannot correct typos, so better copy/paste it from a notepad.
---------------------------------------------------------------------------------------------------------------------
Thanks, that got me cooking... Should be better document somewhere for newbies like me..

mackowiakp
Normal user
Posts: 313
Joined: 07 Jun 2018, 06:47
Location: Gdynia/Poland

Re: ESP82xx_mega-20210503 WiFi problem

#50 Post by mackowiakp » 07 May 2021, 03:29

Why would you want to force it?
All the time I refer to the situation that occurs with me (and maybe not only with me), i.e. frequent power cuts.
As I understand, it works at this moment like this. If the first AP ("better") "disappears", the ESP will switch to the second. fallback ("worse").
If the connectivity is stable for 5 minutes, then in the case of "wifidisconnect" or intendent "soft reboot" the ESP will reconnect with the fallback AP, that is the "worse" one.
After some time, the first AP ("better") will start working again. In the current software design, there will be no automatic switch to the "better" AP, even after "wifidisconnect" or intendent reboot.
However - this is how my practice shows - working with "worse AP" often means losing some of the data transferred to Domoticz, for example. And certainly much slower work of the connection.
To avoid this - this is just my suggestion - it would be good to have the option of doing "wifidisconnect" that will clear the saved AP table, build it from scratch, and allow automatic connection to the "better" AP.
I imagine it as a separate command, adding an option to an existing "wifidisconnect" command or adding an option in the WiFi configuration menu.
These are my thoughts resulting from the daily 24/7 operation of 14 ESP devices.

Post Reply

Who is online

Users browsing this forum: No registered users and 27 guests