Post topics, source code that relate to the Arduino Platform

User avatar
By Lucas neill
#62909
martinayotte wrote:
– got back to sleep

If you wish the ESP to stay alive, you need to remove the hibernate() calls.


Instead I soldered rst pin to gpio16 and now successfully resets but now the problem is sometimes the blue led gets stuck on client side and it won't reset

Secondly someone adviced me to do like below because relay doesn't behave properly sometimes it gets stuck in "ON STATE" SOMETIMES OFF even when it is below the temperature I entered and that guy adviced me :

In the AP code you need to store the received temperature in a global variable called lets say LAST_TEMP, then in the VOID LOOP() function you need to check this variable if its higher than 20 then you close the relay. You can do a function like this and call it in LOOP:

// call this function in the LOOP
void validateRelayState(){
// assign LAST_TEMP when you do the first check above
if(LAST_TEMP > 20){
digitalWrite(2, LOW); // Turn OFF Relay on GPIO2
}
}

Would this work? Shall I change the code like this? And how and where can I store last temp? What is the code for it?
User avatar
By gdsports
#62984 The LAST_TEMP suggestion makes no sense to me so I would ignore it. The code Martin suggested should work.

ESP-DHT not waking up.

Option 1: Stop using deep sleep to see if this is the cause of the problem. Comment out the "hibernate(sleepInterval)" line. Then add "delay(5000)". This will result in the ESP-DHT sending temp every 5 seconds.

Option 2: Try a 470 resistor between RST and GPIO16. This might help with waking up from deep sleep.
User avatar
By Lucas neill
#63006
gdsports wrote:The LAST_TEMP suggestion makes no sense to me so I would ignore it. The code Martin suggested should work.

ESP-DHT not waking up.

Option 1: Stop using deep sleep to see if this is the cause of the problem. Comment out the "hibernate(sleepInterval)" line. Then add "delay(5000)". This will result in the ESP-DHT sending temp every 5 seconds.

Option 2: Try a 470 resistor between RST and GPIO16. This might help with waking up from deep sleep.


Firstly , thanks a lot for trying to help because i feel bad since i m disturbing you all here but there is something wrong that i dont understand ?? i took a video showing what happens when i use this sketch with the changes i made recently depending on your advices. can you check it? in the second video below i wrote a simple code to check if my gpio pins working but i see that there is no problem. what do you think is the problem here? by the way deepsleep works because as i said i soldered rst pin to GPIO16 on client side code. but i then uncommented that hibernate calls as you adviced.

https://www.youtube.com/watch?v=v4Ky7tACLJ4
https://www.youtube.com/watch?v=3rBf0ewYXmQ
User avatar
By Lucas neill
#63069
gdsports wrote:

Option 2: Try a 470 resistor between RST and GPIO16. This might help with waking up from deep sleep.

This is for server side or client side? If server, I already soldered a wire to there and there is no problem, but the problem is the thing on YouTube videos I posted has anybody checked?