• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

Interrupts

Q&A Forum › Category: Home Automation › Interrupts
0 Vote Up Vote Down
Jason Wilkins asked 8 years ago

Hi
 
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
 
cheers
Jase
 
ps great site Rui!!

5 Answers
0 Vote Up Vote Down
Jason Wilkins answered 8 years ago

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

0 Vote Up Vote Down
Rui Santos Staff answered 8 years ago

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?)?

0 Vote Up Vote Down
Jason Wilkins answered 8 years ago

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
GPIO15 ??
also
GPIO 6 to 11 – Used for certain access like memory I think?
cheers
 
 

0 Vote Up Vote Down
Rui Santos Staff answered 8 years ago

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.

0 Vote Up Vote Down
Rui Santos Staff answered 8 years ago

Can you tell me what you see in the Arduino IDE serial monitor when your ESP crashes?

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [New Edition] Build ESP32-CAM Projects eBook – 2nd Edition April 16, 2025
  • [eBook Updated] Learn ESP32 with Arduino IDE eBook – Version 3.2 April 16, 2025

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2025 · RandomNerdTutorials.com · All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.