letscontrolit / ESPEasy

Easy MultiSensor device based on ESP8266/ESP32
http://www.espeasy.com
Other
3.24k stars 2.2k forks source link

Problems with the current mega version #1238

Closed micropet closed 1 year ago

micropet commented 6 years ago

Good Morning all. The current mega version is not really working yet. Board Wemos D1 without external hardware compiled with Arduino 1.8.5. I get:

19802 : WIFI : Connected! AP: SMC (C8:0E:14:05:BC:C6) Ch: 11 Duration: 3777 ms 19803 : EVENT: WiFi#ChangedAccesspoint 19824 : WIFI : DHCP IP: 192.168.0.201 (ESP-201-1) GW: 192.168.0.3 SN: 255.255.255.0 duration: 23 ms 19835 : EVENT: WiFi#Connected 19934 : MQTT : Intentional reconnect 24958 : MQTT : Failed to connect to broker 32012 : Current Time Zone: DST time start: 2018-03-25 02:00:00 offset: 120 minSTD time start: 2018-10-28 03:00:00 offset: 60 min 32013 : EVENT: Time#Initialized 32020 : EVENT: Clock#Time=Fri,08:37 32023 : MQTT : Intentional reconnect 37047 : MQTT : Failed to connect to broker 37056 : MQTT : Intentional reconnect 42078 : MQTT : Failed to connect to broker 42085 : MQTT : Intentional reconnect 47109 : MQTT : Failed to connect to broker 47115 : WD : Uptime 1 ConnectFailures 0 FreeMem 12256 47116 : MQTT : Intentional reconnect 52139 : MQTT : Failed to connect to broker 52141 : MQTT : Intentional reconnect 57164 : MQTT : Failed to connect to broker 57170 : MQTT : Intentional reconnect 62195 : MQTT : Failed to connect to broker 62202 : MQTT : Intentional reconnect 67228 : MQTT : Failed to connect to broker 67237 : MQTT : Intentional reconnect 72261 : MQTT : Failed to connect to broker 72269 : MQTT : Intentional reconnect 77292 : MQTT : Failed to connect to broker 77297 : WD : Uptime 1 ConnectFailures 0 FreeMem 12560 77298 : MQTT : Intentional reconnect 82321 : MQTT : Failed to connect to broker 82327 : WIFI : AP Mode Disabled for SSID: ESP-201_1 82328 : WIFI : Set WiFi to STA 82344 : EVENT: WiFi#Disconnected 82347 : WIFI : Disconnected! Reason: 'Assoc leave' Connected for 1 m 2 s 82347 : WIFI : Connecting SMC attempt #0 83546 : WIFI : Connected! AP: SMC (C8:0E:14:05:BC:C6) Ch: 11 Duration: 1198 ms 83565 : WIFI : DHCP IP: 192.168.0.201 (ESP-201-1) GW: 192.168.0.3 SN: 255.255.255.0 duration: 19 ms 83577 : EVENT: WiFi#Connected 83676 : MQTT : Intentional reconnect 83751 : MQTT : Connected to broker with client ID: ESPClient_5C:CF:7F:0B:68:52 83753 : Subscribed to: ESP-201/# 83754 : EVENT: MQTT#Connected 84617 : EVENT: Time#Set done.

ets Jan 8 2013,rst cause:4, boot mode:(1,7)

wdt reset

TD-er commented 6 years ago

There is indeed a problem with the connection stability when using static IP. I've found the bug and fix will be there in a minute. (N.B. also added some extra info on NTP requests failing)

micropet commented 6 years ago

This is how it looks like now:

16587 : WIFI : Connected! AP: SMC (5C:49:79:45:39:ED) Ch: 1 Duration: 3782 ms 16589 : EVENT: WiFi#ChangedAccesspoint 16804 : WIFI : DHCP IP: 192.168.0.201 (ESP-201-1) GW: 192.168.0.3 SN: 255.255.255.0 duration: 217 ms 16816 : EVENT: WiFi#Connected 16915 : MQTT : Intentional reconnect 16972 : MQTT : Connected to broker with client ID: ESPClient_5C:CF:7F:0B:68:52 16975 : Subscribed to: ESP-201/# 16976 : EVENT: MQTT#Connected 17732 : Current Time Zone: DST time start: 2018-03-25 02:00:00 offset: 120 minSTD time start: 2018-10-28 03:00:00 offset: 60 min 17733 : EVENT: Time#Initialized 17755 : EVENT: Clock#Time=Mon,23:15 42566 : EVENT: Clock#Time=Mon,23:16 42893 : WD : Uptime 1 ConnectFailures 0 FreeMem 13256 72893 : WD : Uptime 1 ConnectFailures 0 FreeMem 13336 73586 : DS : Temperature: 19.81 (28-ff-b8-ea-b4-16-3-ed) 73588 : EVENT: DS18b20#Temperature=19.81 73631 : EVENT: Rules#Timer=1 73642 : ACT : Publish ESP-201/IP,192.168.0.201 73660 : ACT : Publish ESP-201/MAC,5C:CF:7F:0B:68:52 73679 : ACT : Publish ESP-201/Time,23:16:31 73696 : ACT : Publish ESP-201/Uptime,1 73711 : ACT : Publish ESP-201/RSSI,-58 73728 : ACT : Publish ESP-201/SSID,SMC 73743 : ACT : Publish ESP-201/BSSID,5C:49:79:45:39:ED 73761 : ACT : Publish ESP-201/CH,1 73778 : ACT : Publish ESP-201/SYSHEAP,11464 73794 : ACT : timerSet,1,60 102566 : EVENT: Clock#Time=Mon,23:17 102893 : WD : Uptime 2 ConnectFailures 0 FreeMem 13336

TD-er commented 6 years ago

Looks good to me, or am I missing something?

micropet commented 6 years ago

You are the expert :) For me, It looks good.

micropet commented 6 years ago

I hope it stays fine too. Lately, almost every change has shown new mistakes.

Did you already get your PMS?

TD-er commented 6 years ago

I guess you mean the PowerPlant sensors? ;) (lookup "PMS" in the dictionary ;) ) Yes I have got them, one uart version and one with I2C and some other sensors from them.

But I've been too busy getting things stable again.

The thing is, I really didn't want to do the event based wifi yet, although it's an idea I have already for a while. But when I kept receiving issue reports and the strangest error reports I could not explain after changing wifi to be async, I went for it and it took way more time than I hoped for. A lot of issues manifested themselves due to bugs in core 2.3.0 and also because event based wifi connection is so much faster. But I guess it does seem to work now. So let's hope I do not have to touch it in a while.... although I have seen some pretty nice features we really could use :)

For now, lets fix a bunch of small issues and continue to add sensors and improve on them.

micropet commented 6 years ago

That sounds good.

The last two weeks have been quite messy. If it stays stable now (and it looks very good) then you can focus on the essentials.

Many thanks for your effort.

micropet commented 6 years ago

Hi,

I have a new problem:

The ESP-206 device does not read the MH-Z19 sensor after a short time. The ESP-207 loses the MQTT Connect.

Both devices ran smoothly in recent months. I have not changed anything on the hardware.

I know, that is very little information.

On ESP-206 13779739 : ACT : Publish ESP-206/CH,1 13779755 : ACT : Publish ESP-206/SYSHEAP,9952 13779769 : ACT : timerSet,1,60 13791637 : MHZ19: Error, timeout while trying to read 13791637 : MHZ19: Unknown response: 0 0 0 0 0 0 0 0 0 13791851 : WD : Uptime 227 ConnectFailures 0 FreeMem 9952 13797025 : SW : Switch state 1 Output value 1 13797029 : EVENT: Motion#Pir=1.00 13802526 : SW : Switch state

On ESP-207 46321709 : EVENT: MH-Z19#PPM=440.00 46321741 : ACT : event gruen 46321751 : EVENT: gruen 46321819 : EVENT: MH-Z19#MHZ19Temp=22.50 46321846 : EVENT: MH-Z19#U=0.00 46321901 : EVENT: Rules#Timer=1 46321913 : ACT : Publish ESP-207/IP,192.168.0.207 46321926 : ACT : Publish ESP-207/MAC,5C:CF:7F:0B:60:E9 46321939 : ACT : Publish ESP-207/Time,22:47:16 46321951 : ACT : Publish ESP-207/Uptime,753 46321964 : ACT : Publish ESP-207/RSSI,-47 46321977 : ACT : Publish ESP-207/SSID,SMC 46321989 : ACT : Publish ESP-207/BSSID,5C:49:79:45:39:ED 46322002 : ACT : Publish ESP-207/CH,1 46322016 : ACT : Publish ESP-207/SYSHEAP,12072 46322026 : ACT : timerSet,1,60 46327072 : MQTT : Failed to connect to broker 46332393 : MQTT : Failed to connect to broker 46337433 : MQTT : Failed to connect to broker 46342775 : MQTT : Failed to connect to broker

TD-er commented 6 years ago

Do these nodes have static IP or use DHCP?

micropet commented 6 years ago

All nodes use DHCP. Only the address of the MQTT server is statically entered as IP address.

TD-er commented 6 years ago

That should not be a problem. What version do these run?

micropet commented 6 years ago

As always, the latest mega, that of yesterday

TD-er commented 6 years ago

Well, I think it is best if I go to sleep now, since I'm too tired. So for a change, tomorrow you can claim it's a 2-days-old version ;) (no commits/merges yet today ;) )

micropet commented 6 years ago

Yes, that's good. Good night Gijs, see you tomorrow.

M0ebiu5 commented 6 years ago

@micropet: i would suggest:

wdonker commented 6 years ago

Just FYI: my NodeMCU is running mega-20180417 stable for almost 24 hours now, no WIFI or MQTT disconnects anymore. I do not use any PUBLISH command, only sending DHT22 to Domoticz through MQTT and receiving switch commands through MQTT.