Hardware Timer Interrupt

Hi @Madhukesh
I think it’s better to move the discussion here. Below is your original post

I’m sorry I’ve tried many ways, yet couldn’t duplicate that problem.
I’ve tried that exact sketch (including pins D1 for Relay and D3 for Button) with these following conditions while pressing the button continuously without any crash:

  1. Router powered OFF before board boots up. Board tries to connect without success.
  2. Then turn router ON, waiting for board connecting to WiFi, then board connected to Blynk successfully.
  3. While board connected to Blynk, the Ethernet cable to router removed to simulate Internet loss
  4. Put the Ethernet cable back in for reconnection
  5. Turn OFF the router, then back ON, and the board reconnects successfully.

Could you please try these following, one by one:

  1. Use brand new v1.0.2 of ESP8266TimerInterrupt
  2. Remove all other devices, but Relay + Button, connected to other pins.
  3. Use the same pin as in original sketch (pins D1 for Relay and D3 for Button)
  4. Try with another board.

I tested with both Arduino IDE 1.8.9 and 1.8.10 with ESP8266 core 2.5.2 and 2.6.1.

If you still have crash problem, you can post the exact copy of your sketch, as well as the stack dump so that I can debug and find out what the real issue is. Currently, I have no idea what’s going on.

Update Nov 28th 2019:

The crash was caused by the buggy WiFiManager. Removing it solved the crash issue.
One more example dealing with 2 SWs has been added to examples. Thanks to @Madhukesh.

1 Like