From 4ccc1976c4b445f0b035f9af2d1cf73937e19381 Mon Sep 17 00:00:00 2001 From: Hendrik Langer Date: Thu, 4 Jul 2019 11:20:07 +0200 Subject: [PATCH] set max sleep time --- src/main.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 252f76b..2b39052 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -147,8 +147,8 @@ void inline lightsleep() { PIN_FUNC_SELECT(PERIPHS_IO_MUX_MTCK_U,FUNC_GPIO13); // PIN_FUNC_SELECT(PERIPHS_IO_MUX_MTDI_U,FUNC_GPIO13); gpio_pin_wakeup_enable(GPIO_ID_PIN(GEIGER_PIN), GPIO_PIN_INTR_LOLEVEL); wifi_fpm_set_wakeup_cb(fpm_wakup_cb_func1); - wifi_fpm_do_sleep(0xFFFFFFF); // Sleep for longest possible time - //delay(1); + wifi_fpm_do_sleep((uint32_t)postingInterval*1000); // 0xFFFFFFF: Sleep for longest possible time + //delay(500); } void ICACHE_FLASH_ATTR getValuesJSON(char* buffer, const size_t buf_len, int format) { @@ -373,7 +373,6 @@ void ICACHE_FLASH_ATTR sendValues() { net.setInsecure(); mqttclient.begin(mqttserver, 8883, net); - int tries = 0; constexpr unsigned int retry_delay = 500; for (int tries=0; tries<5 && !mqttclient.connect(mqttusername, mqttusername, mqttpassword); tries++ ) { DEBUG_MSG(".");