No Publish after Deep Sleep

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
fraeggle
Normal user
Posts: 21
Joined: 20 Nov 2017, 20:12

No Publish after Deep Sleep

#1 Post by fraeggle » 27 Apr 2018, 12:05

Hi i am using a battery powered temperature and pressure unit.
After i tried ESPMega 20180422 up to 20180426.
In all of this version i don't get the new values in my Broker.

OLD Version (which is working):

INIT : Booting version: (custom)
INIT : Rebooted from deepsleep #12
FS : Mounting...
FS : Mount successful, used 75802 bytes of 957314
CRC : No program memory checksum found. Check output of crc2.py
CRC : Settings CRC ...FAIL
CRC : SecuritySettings CRC ...OK
INIT : Free RAM:23632
INIT : I2C
INIT : SPI not enabled
EVENT: System#Wake
WIFI : AP Mode disabled
WIFI : AP Mode ssid will be ESP_TEMP_1-0 with address 192.168.4.1
IP : Static IP :2517280960
WIFI : Connecting XXXXXXXXXXXXXX attempt #0
EVENT: System#Boot
WD : Uptime 0 ConnectFailures 0 FreeMem 20896
ADC : Analog value: 776
EVENT: ESP_1_Volt#Volt=3.32
BMP : Temperature: 23.36
BMP : Barometric Pressure: 1016.23
EVENT: ESP_Temp_1#Temperature=23.36
EVENT: ESP_Temp_1#Pressure=1016.23
IP : Static IP :2517280960
ADC : Analog value: 776
EVENT: ESP_1_Volt#Volt=3.32
BMP : Temperature: 23.35
BMP : Barometric Pressure: 1016.24
EVENT: ESP_Temp_1#Temperature=23.35
EVENT: ESP_Temp_1#Pressure=1016.24
WIFI : Connected! AP: XXXXXXXXXXXXXX (E0:28:6D:87:DE:CA) Ch: 11 Duration: 3064 ms
EVENT: WiFi#ChangedAccesspoint
WIFI : Static IP: 192.168.10.150 (ESP-TEMP-1-0) GW: 192.168.10.254 SN: 255.255.255.0
EVENT: WiFi#Connected
MQTT : Intentional reconnect
MQTT : Connected to broker with client ID: ESPClient_5C:CF:7F:4E:72:1E
Subscribed to: /ESP_TEMP_1/#
EVENT: MQTT#Connected
WD : Uptime 1 ConnectFailures 0 FreeMem 20248
ADC : Analog value: 772
EVENT: ESP_1_Volt#Volt=3.30
BMP : Temperature: 23.33
BMP : Barometric Pressure: 1016.29
EVENT: ESP_Temp_1#Temperature=23.33
EVENT: ESP_Temp_1#Pressure=1016.29
EVENT: System#Sleep
EVENT: System#Sleep
SLEEP: Powering down to deepsleep...

New Versions:
INIT : Booting version: (custom) (ESP82xx Core 2_3_0)
294 : INIT : Rebooted from deepsleep #2
295 : FS : Mounting...
320 : FS : Mount successful, used 75802 bytes of 957314
330 : CRC : No program memory checksum found. Check output of crc2.py
360 : CRC : SecuritySettings CRC ...OK
463 : INIT : Free RAM:24184
463 : INIT : I2C
463 : INIT : SPI not enabled
476 : INFO : Plugins: 10 [Normal] (ESP82xx Core 2_3_0)
476 : EVENT: System#Wake
505 : WIFI : Switch on WiFi
505 : WIFI : Set WiFi to STA
517 : EVENT: System#Boot
550 : WD : Uptime 0 ConnectFailures 0 FreeMem 23376
567 : ADC : Analog value: 771
569 : EVENT: ESP_1_Volt#Volt=3.29
1154 : BMP : Temperature: 23.38
1155 : BMP : Barometric Pressure: 1016.08
1156 : EVENT: ESP_Temp_1#Temperature=23.38
1181 : EVENT: ESP_Temp_1#Pressure=1016.08
2204 : WIFI : Connecting XXXXXXXXXXXXXXXXX attempt #0
2204 : IP : Static IP : 192.168.10.150 GW: 192.168.10.254 SN: 255.255.255.0 DNS: 192.168.10.254
2219 : WIFI : Static IP: 192.168.10.150 (ESP-TEMP-1-0) GW: 192.168.10.254 SN: 255.255.255.0 duration: 2206 ms
2230 : EVENT: WiFi#Connected
2260 : Webserver: start
2262 : MQTT : Intentional reconnect
2288 : MQTT : Failed to connect to broker
2294 : WD : Uptime 1 ConnectFailures 0 FreeMem 21016
2294 : MQTT : Intentional reconnect
2315 : MQTT : Failed to connect to broker
2319 : ADC : Analog value: 772
2321 : EVENT: ESP_1_Volt#Volt=3.30
3271 : BMP : Temperature: 23.40
3271 : BMP : Barometric Pressure: 1015.96
3272 : EVENT: ESP_Temp_1#Temperature=23.40
3300 : EVENT: ESP_Temp_1#Pressure=1015.96
5398 : Current Time Zone: STD time start: 2018-10-28 03:00:00 offset: 60 min
5400 : EVENT: Time#Initialized
5427 : EVENT: Clock#Time=Fri,09:38
5458 : WIFI : Connected! AP: XXXXXXXXXXXXXXXXX (E0:28:6D:87:DE:CA) Ch: 11 Duration: 3066 ms
5459 : EVENT: WiFi#ChangedAccesspoint
5488 : WIFI : Static IP: 192.168.10.150 (ESP-TEMP-1-0) GW: 192.168.10.254 SN: 255.255.255.0 duration: 1 ms
5499 : EVENT: WiFi#Connected
5538 : ADC : Analog value: 776
5540 : EVENT: ESP_1_Volt#Volt=3.32
5636 : BMP : Temperature: 23.38
5636 : BMP : Barometric Pressure: 1015.95
5637 : EVENT: ESP_Temp_1#Temperature=23.38
5662 : EVENT: ESP_Temp_1#Pressure=1015.95
6636 : EVENT: Time#Set
6663 : MQTT : Intentional reconnect
6736 : MQTT : Connected to broker with client ID: ESPClient_5C:CF:7F:4E:72:1E
6749 : Subscribed to: /ESP_TEMP_1/#
6779 : EVENT: MQTT#Connected
6806 : EVENT: System#Sleep
6836 : EVENT: System#Sleep
6865 : SLEEP: Powering down to deepsleep...

There is no Event for Volt, Temperature and Pressure after MQTT connected.
Maybe there is only a little rule needed in the new versions now.

Wiki
Normal user
Posts: 413
Joined: 23 Apr 2018, 17:55
Location: Germany

Re: No Publish after Deep Sleep

#2 Post by Wiki » 28 Apr 2018, 13:13

Hi,

since yersterday I was playing around with deep sleep, same effect. No data are received from my controller.

Wemos D1 mini, 4MB
Git-Version mega-20180413
Controller Domoticz

Last settings:
Deep Sleep setting: sleep awake time 90 sec, sleep delay 1800 sec
Device 1: INA219, delay 15 sec
Device 2: DS18B20, delay 15 sec

The protocol I can't see, because I have no access to the serial port of the Wemos, currently no other device available.

Code: Select all

pi@raspberrypi:~ $ man woman
No manual entry for woman
pi@raspberrypi:~ $

Tuspam
New user
Posts: 1
Joined: 16 May 2018, 17:25

Re: No Publish after Deep Sleep

#3 Post by Tuspam » 16 May 2018, 17:27

Wiki wrote: 28 Apr 2018, 13:13 Hi,

since yersterday I was playing around with deep sleep, same effect. No data are received from my controller.

Wemos D1 mini, 4MB
Git-Version mega-20180413
Controller Domoticz

Last settings:
Deep Sleep setting: sleep awake time 90 sec, sleep delay 1800 sec
Device 1: INA219, delay 15 sec
Device 2: DS18B20, delay 15 sec

The protocol I can't see, because I have no access to the serial port of the Wemos, currently no other device available.
I also have this problem

Wemos D1 mini Pro
ESP_Easy_mega-20180512_dev_ESP8266_4096.bin
Controller Domoticz
Sleep awake time:20
Sleep time:60 (for testing, normal 900)

Last working Release mega-20180403 (mega-20180405 not working)

Wiki
Normal user
Posts: 413
Joined: 23 Apr 2018, 17:55
Location: Germany

Re: No Publish after Deep Sleep

#4 Post by Wiki » 02 Jun 2018, 23:41

Hi,

publishing from deep sleep works for me on a Wemos D1 with git-version mega-2018-05-06 pretty stable.

Only hints: power drain (might be a hardware issue with my step-up) and publishing after wakeup three times.

Code: Select all

pi@raspberrypi:~ $ man woman
No manual entry for woman
pi@raspberrypi:~ $

fraeggle
Normal user
Posts: 21
Joined: 20 Nov 2017, 20:12

Re: No Publish after Deep Sleep

#5 Post by fraeggle » 03 Jun 2018, 10:36

Hi.
OK i will try this version.
Thanks.

User avatar
EDsteve
Normal user
Posts: 61
Joined: 11 May 2018, 21:13

Re: No Publish after Deep Sleep

#6 Post by EDsteve » 06 Sep 2018, 20:10

Hi,

after i updated my weather station from ESPEasy_mega-20180522 to ESPEasy_mega-20180826 i experienced the same issue:

System info data is sent after wake up (just for testing i added Voltage info in Devices). But the BME280 sensor data is not sent after wake up from deep sleep.
Sleep awake time: 15
Sleep time: 120
Wemos D1 mini

Code: Select all

219 : INIT : Rebooted from deepsleep #14 - Restart Reason: Deep-Sleep Wake
226 : FS   : Mounting...
250 : FS   : Mount successful, used 75802 bytes of 957314
552 : CRC  : program checksum       ...OK
581 : CRC  : SecuritySettings CRC   ...OK 
686 : INIT : Free RAM:27632
687 : INIT : I2C
687 : INIT : SPI not enabled
704 : INFO : Plugins: 46 [Normal] (ESP82xx Core 00000000, NONOS SDK 2.2.1(cfd48f3), LWIP: 2.0.3)
705 : WIFI : Set WiFi to STA
736 : WIFI : Connecting FritzDax attempt #0
751 : SYS  : -1.00
1516 : BMx280 : Detected BME280
2071 : WD   : Uptime 0 ConnectFailures 0 FreeMem 25920
4475 : BME280: dew point 13.26C
4492 : BME280 : Address: 0x76
4492 : BME280 : Temperature: 23.57
4492 : BME280 : Humidity: 52.50
4493 : BME280 : Barometric Pressure: 1019.02
4531 : WIFI : Connected! AP: FritzDax (5C:49:79:CE:DD:E4) Ch: 6 Duration: 3793 ms
10298 : WIFI : DHCP IP: 192.168.168.92 (ESP-Easy-219) GW: 192.168.168.1 SN: 255.255.255.0   duration: 5766 ms
10302 : Webserver: start
10399 : MQTT : Intentional reconnect
10460 : MQTT : Connected to broker with client ID: ESPClient_5C:CF:7F:AB:8F:12
10461 : Subscribed to: domoticz/out
10472 : WD   : Uptime 1 ConnectFailures 0 FreeMem 21136
10488 : SYS  : -1.00
10508 :  Domoticz: Sensortype: 1 idx: 161 values: -1.00
25463 : EVENT: System#Sleep
25490 : SLEEP: Powering down to deepsleep...
Is there a workaround? Or should i downgrade?

Cheeers
ED

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

Re: No Publish after Deep Sleep

#7 Post by TD-er » 06 Sep 2018, 20:14

EDsteve wrote: 06 Sep 2018, 20:10 [...]
I see a lot of reports about deepsleep and Core 2.4.x, not only at ESPeasy, but also on other projects.
Can you test this testbuild? https://github.com/letscontrolit/ESPEas ... -418520967
It introduces a queue to the controllers, which may help these issues. DeepSleep issues may still cause other issues though.

User avatar
EDsteve
Normal user
Posts: 61
Joined: 11 May 2018, 21:13

Re: No Publish after Deep Sleep

#8 Post by EDsteve » 06 Sep 2018, 20:57

You are awesome. Thanks for the link.
I uploaded your test-build and it works without issues for now.

BTW: Is there a donate-button somewhere?

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: No Publish after Deep Sleep

#9 Post by grovkillen » 06 Sep 2018, 21:25

EDsteve wrote: 06 Sep 2018, 20:57 BTW: Is there a donate-button somewhere?
We're working on a Patreon page, stay tuned. It'll be announced very soon.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

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

Re: No Publish after Deep Sleep

#10 Post by TD-er » 06 Sep 2018, 21:33

Thanks and very good to know it is working. :)
Like Grovkillen said, we are working on a Patreon page.

As a sneak-peek, you could look at these links. The texts are still beta, but the donation option should work :)
https://www.patreon.com/GrovkillenTDer

If you prefer to "just" give us a coffee you can add your support here: http://ko-fi.com/grovkillentder

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: No Publish after Deep Sleep

#11 Post by grovkillen » 06 Sep 2018, 21:40

TD-er wrote: 06 Sep 2018, 21:33 Thanks and very good to know it is working. :)
Like Grovkillen said, we are working on a Patreon page.

As a sneak-peek, you could look at these links. The texts are still beta, but the donation option should work :)
https://www.patreon.com/GrovkillenTDer

If you prefer to "just" give us a coffee you can add your support here: http://ko-fi.com/grovkillentder
You're that kid who told your friend what the gift was when you handed over the birthday present, right!? ;)
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

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

Re: No Publish after Deep Sleep

#12 Post by TD-er » 06 Sep 2018, 21:42

Nope, I am the one to let people test the good stuff as soon as possible :)

User avatar
EDsteve
Normal user
Posts: 61
Joined: 11 May 2018, 21:13

Re: No Publish after Deep Sleep

#13 Post by EDsteve » 07 Sep 2018, 13:59

Very cool options. Thx for the links. Click and pay is what i was looking for so Ko-fi it is :)

Coming back to topic:
After let it run for a while i realized that it only works 60% of the time.
I observe the MQTT broker and the MQTT messages from my deep-sleep-node are only send randomly. Couldn't find a logic behind it.
When i read the MQTT messages on my broker and the serial output from the sensor i get the impression that it sends data BEFORE it connects to the MQTT broker.

So when the sensor wakes up it should connect first to the MQTT broker and send data after. That's my understanding :)

A working example on my broker looks like this:

Code: Select all

domoticz/out/LWT Connected
domoticz/in {"idx":28,"RSSI":10,"nvalue":0,"svalue":"20.52;65.15;3;1022.83;0"}
domoticz/out {
   "Battery" : 255,
   "RSSI" : 10,
   "description" : "",
   "dtype" : "Temp + Humidity + Baro",
   "id" : "257",
   "idx" : 28,
   "name" : "Weather Station",
   "nvalue" : 0,
   "stype" : "Weather Station",
   "svalue1" : "20.5",
   "svalue2" : "65.15",
   "svalue3" : "3",
   "svalue4" : "1022.8",
   "svalue5" : "0",
   "unit" : 1
}
domoticz/out/LWT Connection Lost
And this is how it looks when no data is received on the MQTT broker:

Code: Select all

domoticz/out/LWT Connected
domoticz/out/LWT Connection Lost
Here is the serial output after wake up (it connects to the broker AFTER it sends data?):

Code: Select all

INIT : Booting version:  (ESP82xx Core 2_4_2, NONOS SDK 2.2.1(cfd48f3), LWIP: 2.0.3)
220 : INIT : Rebooted from deepsleep #121 - Restart Reason: Deep-Sleep Wake
226 : FS   : Mounting...
250 : FS   : Mount successful, used 75802 bytes of 957314
559 : CRC  : program checksum       ...OK
591 : CRC  : SecuritySettings CRC   ...OK 
694 : INIT : Free RAM:28536
695 : INIT : I2C
695 : INIT : SPI not enabled
731 : INFO : Plugins: 46 [Normal] (ESP82xx Core 2_4_2, NONOS SDK 2.2.1(cfd48f3), LWIP: 2.0.3)
731 : WIFI : Set WiFi to STA
763 : WIFI : Connecting JWD-LAN2 attempt #0
1543 : BMx280 : Detected BME280
2098 : WD   : Uptime 0 ConnectFailures 0 FreeMem 26064
4131 : BME280: dew point 13.67C
4132 : WIFI : Connected! AP: JWD-LAN2 (00:25:9C:4B:1E:D5) Ch: 11 Duration: 2864 ms
4147 : BME280 : Address: 0x76
4147 : BME280 : Temperature: 20.32
4147 : BME280 : Humidity: 65.78
4147 : BME280 : Barometric Pressure: 1022.83
4168 :  Domoticz: Sensortype: 4 idx: 28 values: 20.32;65.78;3;1022.83;0
5534 : WIFI : DHCP IP: 192.168.168.92 (Weather-Station-220) GW: 192.168.168.1 SN: 255.255.255.0   duration: 1906 ms
5538 : Webserver: start
5639 : MQTT : Intentional reconnect
5669 : MQTT : Connected to broker with client ID: ESPClient_5C:CF:7F:AB:8F:12
5670 : Subscribed to: domoticz/out
5681 : WD   : Uptime 1 ConnectFailures 0 FreeMem 21936
20672 : EVENT: System#Sleep
20701 : SLEEP: Powering down to deepsleep...
Not sure if the problem is on domoticz side. But maybe it's worth to play with the queue timings?
Cheers
ED
Last edited by EDsteve on 07 Sep 2018, 17:56, edited 1 time in total.

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: No Publish after Deep Sleep

#14 Post by grovkillen » 07 Sep 2018, 16:51

Thanks for the ko-fi! 8-) You got our first post as well (see ko-fi page).
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

User avatar
EDsteve
Normal user
Posts: 61
Joined: 11 May 2018, 21:13

Re: No Publish after Deep Sleep

#15 Post by EDsteve » 07 Sep 2018, 17:54

Coool :) I didn't realize it's public though :)
But i like your thinking. Change to a open source job. First step to our new society :)
Between 10.000 and 100.000 people searching for ESPeasy every month. Should be just enough to make you quit your jobs. Well... depends on how high your status is :D

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

Re: No Publish after Deep Sleep

#16 Post by TD-er » 07 Sep 2018, 23:06

Well at this moment we are thinking about 1 - 2 days a week would be great.
I think it will still cost us money, but we'll see how far we can get.
Grovkillen just posted the announcement also on this forum.

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 29 guests