ESPEASY does not send data after waking up.

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
dtj60
Normal user
Posts: 12
Joined: 03 Jan 2023, 13:38

ESPEASY does not send data after waking up.

#1 Post by dtj60 » 03 Jan 2023, 14:04

Hi,
I have 2x thermometer with WeMos D1 Mini ESP8266. It sends values to Domoticz (via HTTP) without any problems. I would like to power it from battery. As soon as I turn on deep sleep, the ESP wakes up (ping to ESP is OK) but does not send data. It also cannot be accessed via the web (when it is live). Tested port 80 with nmap - closed.
Tried different timings, no result. Where else could the problem be?

Code: Select all

Firmware:mega-20221105
Ping:
64 bytes from 192.168.4.103: icmp_seq=2532 ttl=255 time=2.60 ms

Nmap:
nmap -p 80 192.168.4.103
Starting Nmap 7.80 ( https://nmap.org ) at 2023-01-03 13:48 CET
Note: Host seems down. If it is really up, but blocking our ping probes, try -Pn
Nmap done: 1 IP address (0 hosts up) scanned in 3.04 seconds

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

Re: ESPEASY does not send data after waking up.

#2 Post by TD-er » 03 Jan 2023, 14:51

How long is the ESP awake before you put it back to sleep again?
Also what build are you using?

dtj60
Normal user
Posts: 12
Joined: 03 Jan 2023, 13:38

Re: ESPEASY does not send data after waking up.

#3 Post by dtj60 » 03 Jan 2023, 16:44

I have tried different times from 10s to 2 minutes, it has no effect. I ping it all the time when I wake up. So it's connected to WiFi, but it doesn't send data to Domoticz. Once switched off (by jumper) the sleeping, dtata sends exactly at the intervals set by the sensor DS18B20. Firmware:mega-20221105

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

Re: ESPEASY does not send data after waking up.

#4 Post by TD-er » 03 Jan 2023, 16:53

Can you please try the latest 20221224 build?
I did fix some funky issues where the ESP keeps on scanning and reconnecting without actually realizing it was actually connected.

N.B. there still seems to be some issue in this latest build too (reported by a user) where it might still not (re)connect on some nodes when nr. of WiFi scans (tools->advanced page) is set > 0.

dtj60
Normal user
Posts: 12
Joined: 03 Jan 2023, 13:38

Re: ESPEASY does not send data after waking up.

#5 Post by dtj60 » 03 Jan 2023, 17:26

OK, thanks. I'll try it tomorrow and let you know (I'm not at the device).

dtj60
Normal user
Posts: 12
Joined: 03 Jan 2023, 13:38

Re: ESPEASY does not send data after waking up.

#6 Post by dtj60 » 04 Jan 2023, 07:47

I uploaded the firmware ESP_Easy_mega_20221224_normal_ESP8266_4M1M.bin (is it OK?). After setting it up it connects to wifi, gets ip address from dhcp, ping OK but port 80 blocked:

Code: Select all

nmap -p 80 192.168.6.75
Starting Nmap 7.80 ( https://nmap.org ) at 2023-01-04 07:40 CET
Nmap scan report for 192.168.6.75
Host is up (0.0029s latency).

PORT   STATE    SERVICE
80/tcp filtered http
MAC Address: 68:C6:3A:F3:C9:10 (Espressif)

Nmap done: 1 IP address (1 host up) scanned in 0.35 seconds

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

Re: ESPEASY does not send data after waking up.

#7 Post by Ath » 04 Jan 2023, 08:46

Do you have a separate VLAN/IP-range for the ESP devices? Might want to allow access to ESPEasy for all networks, from the Config page:
Screenshot - 4-01-2023 , 08_43_51.png
Screenshot - 4-01-2023 , 08_43_51.png (8.01 KiB) Viewed 1876 times
Select the Allow All option
/Ton (PayPal.me)

dtj60
Normal user
Posts: 12
Joined: 03 Jan 2023, 13:38

Re: ESPEASY does not send data after waking up.

#8 Post by dtj60 » 04 Jan 2023, 09:45

Client IP block level: Allow All. I set up a fixed IP, GW, mask, etc. After reboot PING OK, port 80 filtered.

Code: Select all

nmap -p 80 192.168.4.103
Starting Nmap 7.80 ( https://nmap.org ) at 2023-01-04 09:32 CET
Nmap scan report for 192.168.4.103
Host is up (0.035s latency).

PORT   STATE    SERVICE
80/tcp filtered http
MAC Address: 68:C6:3A:F3:C9:10 (Espressif)
After about 5 minutes port 80 open.

Code: Select all

nmap -p 80 192.168.4.103
Starting Nmap 7.80 ( https://nmap.org ) at 2023-01-04 09:33 CET
Nmap scan report for 192.168.4.103
Host is up (0.0036s latency).

PORT   STATE SERVICE
80/tcp open  http
MAC Address: 68:C6:3A:F3:C9:10 (Espressif)
After reboot everything repeats.

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

Re: ESPEASY does not send data after waking up.

#9 Post by TD-er » 04 Jan 2023, 10:01

Is it possible for you to collect the logs via serial? The same port you used to flash the node.
And please try to power-cycle the node.

Did this ESP unit have any previous firmware on it, like Tasmota or some other firmware?

If so, then please try to erase the entire flash and flash the firmware again.
Sometimes there is some left-over data where the SDK stores its WiFi calibration data.

dtj60
Normal user
Posts: 12
Joined: 03 Jan 2023, 13:38

Re: ESPEASY does not send data after waking up.

#10 Post by dtj60 » 04 Jan 2023, 12:54

Is it possible for you to collect the logs via serial? The same port you used to flash the node.
And please try to power-cycle the node.
After rebooting on /dev/USB0 it prints nonsense characters and then nothing.
Did this ESP unit have any previous firmware on it, like Tasmota or some other firmware?
Only previous versions of Espeay. Before flash firmware I uploaded the blank_4MB.bin and then the firmware ESPEasy_ESP82xx_mega-20221224.zip
Now I tried the new module and it behaves the same. I use these https://www.aliexpress.com/item/3265174 ... 1802CyIfW6
Maybe I'm doing something wrong, but I don't know what. Should I try uploading a different firmware?

dtj60
Normal user
Posts: 12
Joined: 03 Jan 2023, 13:38

Re: ESPEASY does not send data after waking up.

#11 Post by dtj60 » 04 Jan 2023, 12:58

Sorry, firmware is ESP_Easy_mega_20221224_normal_ESP8266_4M1M.bin :)

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

Re: ESPEASY does not send data after waking up.

#12 Post by TD-er » 04 Jan 2023, 13:08

Which one of those "Wemos D1 mini" do you have?
The one with a metallic cover over the ESP? Or the one with ESP chip soldered at 45 degree angle on the PCB and a PCB trace antenna or the one with ceramic antenna and IPEX antenna connector?
Or the "D1 mini v4.0.0" ?

Also it is very strange you don't see anything on the serial port.
Have you set it to 115200 baud? Using the correct com port?

dtj60
Normal user
Posts: 12
Joined: 03 Jan 2023, 13:38

Re: ESPEASY does not send data after waking up.

#13 Post by dtj60 » 04 Jan 2023, 13:45

Oh, I'm stupid - bad speed, now the output is ok, here is:

Code: Select all

�c��ng�l'o���c8��dsdsdp�'��$Ĝco�<�d��c��ng�l��l`�gl`gs�ۓocl`{ۓob Set WiFi to OFF
5173 : Info   _Easy_mega_20221224_normal_ESP82ctions) mega-20221224_35f2ff8 (ESP82xx Core 2843a5ac, NONOS SDK 2.2.2-dev(38a443e), LWIP: 2.1.2 PUYA support)
5173 : Info   : INIT : Free RAM:27128
5175 : Info   : INIT : Manual Reboot #1 Last Action before Reboot: Background Task Last systime: 400 - Restart Reason: External System
5176 : Info   :   : FS   : Mount successful, used 75802 bytes of 957314
5221 :: SecuritySettings CRC   ...OK
5227 : Info   : INIT : I2C
5229 : Info   : INIT : SPI not enabled
5232 : I: #Hidden# 22:E8:29:AA:F7:CC Ch:o   : WIFI : Set WiFi to STA
5440 : Info   : WiFi : Start network scan all channels
7627 : Info   : WiFi : Scan finished, found: 8
7630 : e: #Hidden# 1E:E8:29:AA:F7:CC Ch:11 (-59dBm) WPA2/PSK
7631 : Info   : WiFi : WifiDisconnect()
7732 : Info   : WIFI : Disconnected! Reason: '(1) Unspecified'
7733 : Inf: WL_IDLE_STATUS 0 ESPeasy internal wifi status: DISCONNECTED
7834 : Info   : Reset WiFi.
7836 : Info   : WiFi : Start network scan all channels
10020 : Info   : WiFi : Scan finished, found: 5
10023 : Info   : WiFi : Best AP candidate: #Hidden# TATUS 0 ESPeasy internal wifi status: DISCONNECTED
10124 : Info   : WIFI : Set WiFi to OFF
10238 : Info   : INIT : Free RAM:25416
10316 : Info   : INFO : Plugins: 47 [Normal] (ESP82xx Core 2843a5ac, NONOS SDK 2.2.2-dev(38a443e), LWIP: 2.1.2 PUYA support)
10421 : Info   : WIFI : Set WiFi to STA
10524 : Info   : WiFi : Start network scan all channels
12711 : Info   : WiFi : Best AP candidate: #Hidden# 1E:E8:29:AA:F7:CC Ch:11 (-59dBm) WPA2/PSK
12712 : Info   : WiFi : Scan finished, found: 2
12713 : Info   : WiFi : Best AP candidate: #HiddeBm) WPA2/PSK
12815 : Info   : WIFI : Set WiFi to AP+STA
13807 : Info   : WIFI : AP Mode ssid will be ESP-Easy with address 192.168.4.1
13810 : Info   : WIFI : Connecting ESP#Hidden# 1E:E8:29:AA:F7:CC Ch:11 (-59dBm) WPA2/PSK attempt #0
13815 : Info   : WIFI : Arduino wifi status: WL_DISCONNECTED 6 ESPeasy internal wifi status: DISCONNECTED
13818 : Info   : Webserver: start
15184 : Info   : WD   : Uptime 0 ConnectFailures 0 FreeMem 18336 WiFiStatus WL_DISCONNECTED 6 ESPeasy internal wifi status: DISC 192.168.7.87 (ESP-Easy) GW: 192.168.4.2 SN: 255.255.252.0   duration: 2118 ms
19083 : Info   : WIFI : Arduino wifi status: WL_CONNECTED 3 ESPeasy internal wifi status: IP
19084 : Info   : UDP : Start listening on port 8266
19085 : Info   : firstLoopConnectionsEstablished
19090 : Info   : WIFI : Connected! AP: ESP (1E:E8:29:AA:F7:CC) Ch: 11 Duration: 3134 ms
sy internal wifi status: Conn. I105153 : Info   : WD   : Uptime asy internal wifi status: Conn. IP Init
135153 : Info   : WD   : Uptime 2 ConnectFailures 0 FreeMem 1744asy internal wifi status: Conn. IP Init
3 ConnectFailures 0 FreeMem 17440 WiFiStatus WL_CONNECTED 3 ESPeasy internal wifi status: Conn. IP Init
285153 : Info   : WD   : Uptime 5 ConnectFailures 0 FreeMem 15544 WiFiStatus WL_CONNECTED 3 ESPeasy internal wifi status: Conn. IP Init
Here open port 80

Code: Select all

314015 : Info   : WIFI : Disconnected! Reason: '(8) Assoc leave' Connected for 4 m 56 s
314016 : Info   : WIFI : Arduino wifi status: WL_IDi status: Conn. IP Init
314117 : Info   : WiFi : WifiDisconnect()
314218 : Info   : WIFI : Disconnected! Reason: '(1) Unspecified'
314318 : Info   : Reset WiFi.
314320 : Info   : WiFi : Start network scan all channels
316504 : Info   : WiFi : Scan finished, found: 6
316506 : Inf (-62dBm) WPA2/PSK
316507 : Info   : WiFi : WifiDisconnect()
316608 : Info   : WIFI : Disconnected! Reason: '(1) Unspecified'
316609 : Info   : WIFI : Arduino wifi status: WL_IDL status: DISCONNECTED
316709 : Info   : Reset WiFi.
316711 : Info   : WiFi : Start network scan all channels
318894 : Info   : WiFi : Scan finished, found: 6
318897 : Info   : WiFi : Best AP candidate: #Hidden# 1E:E8:29:AA:F7:CC Ch:11 (-62dBm) WPA2/PSK
318998 : Info   : WIFI : Arduino wifi status: WL_IDLE_STATUS 0 ESPeasy internal wifi status: DISCONNECTED
318999 : Info   : WIFI : Set WiFi to OFF
319315 : Info   : WIFI : Set WiFi to STA
319419 : Info   : WIFI : Connecting ESP#Hidden# 1E:E8:29:AA:F7:CC Ch:11 (-62dBm) WPA2/PSK attempt #1
319555 : Info   : WD   : Uptime 5 ConnectFailures 0 FreeMem 20464 WiFiStatus WL_DISCONNECTED 6 ESPeasy internal wifi status: DISCONNECL_CONNECTED 3 ESPeasy internal wifi status: IP 
324088 : Info   : WIFI : Connected! AP: ESP (1E:E8:29:AA:F7:CC) Ch: 11 Duration: 3130 ms
345153 : Info   : WD   : Uptime 6 ConnectFailures 0 FreeMem 1957
I use this module: https://photos.app.goo.gl/aBddQVG4Zjh6n7bn6

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

Re: ESPEASY does not send data after waking up.

#14 Post by TD-er » 04 Jan 2023, 13:50

Are you trying to connect to a hidden SSID?

dtj60
Normal user
Posts: 12
Joined: 03 Jan 2023, 13:38

Re: ESPEASY does not send data after waking up.

#15 Post by dtj60 » 04 Jan 2023, 13:55

Yes.

dtj60
Normal user
Posts: 12
Joined: 03 Jan 2023, 13:38

Re: ESPEASY does not send data after waking up.

#16 Post by dtj60 » 04 Jan 2023, 14:16

New finding: If I turn on SSID broadcast on the network there is no problem with the port, it opens right away. I'll try sending it after waking up from a deep sleep. But I'd rather have the SSID hidden.

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

Re: ESPEASY does not send data after waking up.

#17 Post by TD-er » 04 Jan 2023, 14:27

The problem with hidden SSID is that you need to try them all.
The only way to really speed up the connection time is when we keep the BSSID and channel.

On the tools->Advanced page at the bottom, there is this option: Use Last Connected AP from RTC
Can you enable it and check to see if it makes the reconnect after deep sleep a lot faster?

dtj60
Normal user
Posts: 12
Joined: 03 Jan 2023, 13:38

Re: ESPEASY does not send data after waking up.

#18 Post by dtj60 » 04 Jan 2023, 16:19

Currently tested that with open SSID it sends data to Domoticz without problems after waking up from deep sleep. Tomorrow I will test the option (Use Last Connected AP from RTC). If it doesn't work, I'll leave the SSID open, it's not a major issue.. Thank you very much for your help.

dtj60
Normal user
Posts: 12
Joined: 03 Jan 2023, 13:38

Re: ESPEASY does not send data after waking up.

#19 Post by dtj60 » 05 Jan 2023, 12:23

So that's the last observation, and that concludes the problem. The Last Connected AP from RTC option has almost no effect on WiFi connection speed. When using deep sleep, do not use hidden SSIDs on the network. Then everything works normally. Thanks again for your help.

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

Re: ESPEASY does not send data after waking up.

#20 Post by TD-er » 05 Jan 2023, 14:54

OK, thanks for the update.
When I look into the WiFi code again, I will also look into the hidden SSID support.

However I am a bit surprised this RTC option didn't improve connection time. Does the (hidden SSID) switch channels?

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot] and 97 guests