i am new here and just starting my journey with the IoT
i have worked through the examples and now creating my own solution.
my project is to monitor and control my garage doors.
I want to have open and closed reed sensors on the doors and detect the door status.
i assume it is a bad idea to keep checking the status in the loop() section? As it will keep processing continually using power.
as such I thought to use an interrupt on the goop ports
so I set the Gould to INPUT_PULLUP and then connected the reed to ground.
this worked , however now and then the device seems to crash and reboot.
it seems interrupts are not stable? Or am I doing something wrong?
other people seem to have the problem if I search google
others have said they polled the gpio instead.
If interrupts are unreliable what does polling involve? Do I just put a time delay in the loop?
appreciate any help
ps great site Rui!!
Sorry not sure how to edit my post
Gould means GPIO , I am using my iPhone and autocorrect kicked in, sorry
also so I am working with the ESP8266 forgot to say which device
Sometimes the interrupts can crash the WiFi connection and cause your ESP8266 to crash. Which ESP8266 GPIO are you using? How did you set the GPIO to be triggered (rising mode?)?
Hi, I tried GPIO 4 and GPIO5 and set to RISING and also tried CHANGE
it keeps crashing and rebooting intermittently.
also as I am only new to this I am trying to figure out which are the best GPIO’s to use ?
I have read in different places it is best not to use
GPIO0, GPIO2 , – used to decide how ESP boots
GPIO 6 to 11 – Used for certain access like memory I think?
GPIO 4 and GPIO 5 should be fine. GPIO 0 and GPIO 15 should not be used, because they have specific states that they should have in boot mode that can cause problems when you use them.