![]() When I start it up it takes one measurement, goes to sleep and then wakes up, but nothing happens once it wakes up. Hum_str.toCharArray(humidity, hum_str.length() + 1) Ĭlient.publish("dryer/humidity", humidity) ĬtServer(mqtt_server, mqtt_port) Temp_str.toCharArray(temperature, temp_str.length() + 1) Ĭlient.publish("dryer/temperature", temperature) Compute heat index in Celsius (isFahreheit = false)įloat hic = dht.computeHeatIndex(t, h, false) ![]() Compute heat index in Fahrenheit (the default) Serial.println("Failed to read from DHT sensor!") Check if any reads failed and exit early (to try again). Read temperature as Fahrenheit (isFahrenheit = true) Read temperature as Celsius (the default) ![]() Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor) Reading temperature or humidity takes about 250 milliseconds! as the current DHT reading algorithm adjusts itself to work on faster procs. ![]() tweak the timings for faster processors. Note that older versions of this library took an optional third parameter to #define DHTPIN 2 // what digital pin we're connected toĬonst char* mqtt_server = "mqttserverip" Ĭonst char *mqtt_client_name = "DryerMCU" // Client connections can't have the same connection name I have soldered a wire from GPIO16 to RST. I want to be able to put t into deep sleep to preserve battery life. Due to the long boot time after it wakes, I wish they'd designed the RTC & API for millisecond increments so you could sleep it for a day without jumping through hoops every 67 minutes.I have a temperature/humidity project using an ESP-01 and DHT11. With a theoretical maximum of 2^32-1 microseconds, having the API pass a 64-bit value is ludicrous unless they intended to expand Deep Sleep beyond it's current limit. ~ 67 minutes later it woke, which is well beyond the 35.(something) minutes that 2^31 microseconds works out to. Experimentally I set the Deep Sleep time to 0xFFFFFFFF and sent it to sleep. It doesn't make sense to have Deep Sleep max at 2^31-1 and Deep Sleep Instant max at 2^32-1 in section 3.3.49. I've seen a number of errors in other sections, so it's no surprise. Schufti, I think that's a typographical error in the current API Reference, section 3.3.9 for system_deep_sleep. I'll see if it wakes 67 minutes from now. "Toto, I've a feeling we're not in Kansas any more."Īfter hitting it with 10-12 RESETs, it finally went to sleep. It didn't hit the next line in my other program, a Serial.println(), and it didn't reboot so it's off in some strange place in the code, likely stuck in a blind end in the SDK. It seems to go to sleep but then upon waking it hangs, I have a Node MCU v2 breakout board similar to this. ![]() I'd have to fire up a debugger to see where the CPU went to after that Deep Sleep command. Code: Select all ESP.deepSleep (10000000, WAKERFDEFAULT) // Sleep for 10 seconds. It stopped responding and yet the WiFi connected (stored connection) and it responds to pings if I use the same Deep Sleep command in another program that enables WiFi. It usually doesn't go into Deep Sleep, but I don't know exactly what it DOES do. deepSleep(deepSleepMax, WAKE_RF_DISABLED) So the ~12000s returned by deepSleepMax() should be safe ? Indicates a 32bit timer, then the max sleep time would be 0xFFFFFFFF * periode giving something between 21474.8 to 30064.8 s. The theoretical maximum value of time_in_us can be calculated by formula: For more details about the cali, please see the API: system_rtc_clock_cali_proc (c.f 3.3.50)Ĭali translates to values in the range 5 ![]()
0 Comments
Leave a Reply. |