I have a sketch that puts the MKR WiFi 1010 and WiFiNINA module in low power sleep mode until woken up by an external PIR sensor to conserve battery. In order to upload a change to this sketch, it is necessary to double-click the reset switch on the MKR 1010 board to start the bootloader. That works fine. However, my project involves mounting the MKR 1010 and a MKR Proto Shield inside a project box to protect it from weather. It's difficult to remove the screws on the project box lid, remove the MKR 1010 and use a non-conductive tool to double-click the reset switch under the Proto Shield. Instead I installed an external momentary pushbutton switch on the outside of the project box and connected it from GND to the Reset pin on the MKR 1010 through a header on the Proto shield wired to the Reset pin on the MKR 1010. A double-click on the external reset switch will reset the MKR 1010 but will not start the bootloader so I'm wondering how to do that. I haven't been able to find any answers searching the forum or Internet. Attached are my sketch and a photo of the project box configuration.
Here's an overview of the sketch. On startup the MKR WiFi 1010 and WiFiNINA modules are put in low power sleep mode until an external PIR sensor issues an interrupt on pin 8 to wake them up. Then the sketch logs onto my WiFi network and sends a push notification to my iPhone through Pushsafer.com with the time of the interrupt from the onboard real time clock. Code is included in the setup section to set the real time clock from the compile time in case power has been interrupted resetting the real time clock. Once the push notification has been sent, low power mode is set again.
Using low power mode creates a restriction on how to wake up the bootloader. I'm not sure it can be done through the MKR 1010's RESET pin without knowing how the firmware handles it. Any advice would be appreciated.
Update: Discovered that I had a bad external reset switch. The new one works correctly for putting the MKR 1010 into bootloader mode without opening the enclosure. I would delete this post but there doesn't seem to be a way to do that.
ExternalWakeup-ajm1.ino (5.57 KB)