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(".");