April Brother soil moisture crahes on ESP.deepSleep function

Bought April Brother soil moisture sensor. The default ino at github https://github.com/AprilBrother/esp-soil-moisture-sensor/tree/master/src/esp-soil-moisture-sensor-v2.1 crashes at the ESP.deepSleep(SLEEP_TIME, WAKE_RF_DEFAULT); function. Anybody has found a workaround for this? :smiley:
15:40:11.675 -> …
15:40:16.679 -> Connected
15:40:16.679 ->
15:40:16.818 -> Requesting Temperature…
15:40:17.422 -> 747.00
15:40:17.422 -> 747.00
15:40:17.422 -> 747.00
15:40:17.422 -> Soil Humidity:747.00
15:40:17.422 -> Temperature:22.00
15:40:18.027 -> WiFi Client connected
15:40:30.792 -> rl crashhhhhhhh

please wire the jumper for GPIO16. It’s designed for deepsleep. The jumper wires GPIO16 to reset pin

No that is not the problem the jumper is fixed, after deepsleep the program just starts at the beginning. You can tell from the monitor and the serial printed variable sent stays to 0.
10:37:21.712 -> Connected
10:37:21.712 ->
10:37:21.802 -> Requesting Temperature…
10:37:22.435 -> 894.00
10:37:22.435 -> 893.00
10:37:22.435 -> 893.00
10:37:22.435 -> Soil Humidity:893.33
10:37:22.435 -> Temperature:22.19
10:37:22.435 -> 0 (serial print variable sent)
10:37:34.746 -> rl crash…
0:37:36.364 -> Connected
10:37:36.364 ->
10:37:36.501 -> Requesting Temperature…
10:37:37.106 -> 894.00
10:37:37.106 -> 893.00
10:37:37.106 -> 893.00
10:37:37.106 -> Soil Humidity:893.33
10:37:37.106 -> Temperature:22.19
10:37:37.106 -> 0 (serial print variable sent)
10:37:49.419 -> rl crash…

Please April Brother run the program once yourself

It works when we created the repo. But the Arduino core for ESP8266 should be changed recently. We’ll look into this

Fine when you would look in to it. All the different deep sleep source code I did use crashes all when coming out of the deep sleep state. So it’s not just this example code. Testing both the connections to the gpio 16 and rst to the esp12f are ok.

We tested with latest Arduino core for ESP8266 today. It works fine when deepsleep. Do you still wire the whole ESP flasher after firmware is flashed? I think the RST pin may be pull up by ESP flasher so the deepsleep can’t work well.

Requesting Temperature...
879.00
879.00
879.00
Soil Humidity:879.00
Temperature:25.63
WiFi Client connected 
rl␀l��|␀�l�|␂␌␌␌�␌l�␌b|��␂�␒�r�b�␌b��nn�lnn���␌b␜p��lrlrlp�n�␐␂␌␌�␌l␌��␌␌␌b␌n�|␂�l�␌�b��nn�␀l��l`␂�␒␒nn␌l`␂␎␂nr���n␌␌b␂l`␂␎r��n␌␌b␂l`␂�b␌␌�␜␂�lr�`␂��n�␂OST /update HTTP/1.1
......
Connected

Requesting Temperature...
879.00
879.00
879.00
Soil Humidity:879.00
Temperature:25.50
WiFi Client connected 
rl␀l��|␀�l�|␂␌␌␌�␌l�␌b|��␂�␒�r�b�␌b��nn�lnn���␌b␜p��lrlrlp�n�␐␂␌␌�␌l␌��␌␌␌b␌n�|␂�l�␌�b��nn�␀l��l`␂�␒␒nn␌l`␂␎␂nr���n␌␌b␂l`␂␎r��n␌␌b␂l`␂�b␌␌�␜␂�lr�`␂��n�␂OST /update HTTP/1.1
..
Connected

Requesting Temperature...
879.00
878.00
878.00
Soil Humidity:878.33
Temperature:25.44
WiFi Client connected

I changed the SLEEP_TIME to 12 seconds. So it request remote server per 12 seconds.

BTW. we also modified the code so it supports platformi. Here’s my platformio core version

pio --version
PlatformIO, version 5.0.1
CONFIGURATION: https://docs.platformio.org/page/boards/espressif8266/nodemcuv2.html
PLATFORM: Espressif 8266 (2.6.2) > NodeMCU 1.0 (ESP-12E Module)
HARDWARE: ESP8266 80MHz, 80KB RAM, 4MB Flash
PACKAGES: 
 - framework-arduinoespressif8266 3.20704.0 (2.7.4) 
 - tool-esptool 1.413.0 (4.13) 
 - tool-esptoolpy 1.20800.0 (2.8.0) 
 - tool-mklittlefs 1.203.200522 (2.3) 
 - tool-mkspiffs 1.200.0 (2.0) 
 - toolchain-xtensa 2.40802.200502 (4.8.2)

Thanks for the fast reply, I manage to get it working. Find your link to the new platformio core version at github.

I made code, an arduino ino, for native MQTT messages, to calibrate the device. It supports updating Domoticz with, temp, hum, battery and RSSI.

Thanks for update. Could you please share your code?

Thanks for your code. It’s very helpful for other user of soil sensor!