@philomellia : You mentioned spinning up the fan of the PM sensor. What do you mean by that? In my custom code, I had logic in there to sleep the PM sensor, wake up every 5 minutes, wait 30 seconds, and read for 30 seconds, and then go back to sleep. I’ve disabled that for now in my current tests.
Update:
I captured a lot more exceptions and it became less and less conclusive. Almost like there is no pattern. I tried my more customized code that adds in support for SGP41 and a few other niceties and it crashed really often (within 20 minutes typically). I move to VSCode + PlatformIO to try to debug, but it turns out debug is not supported on ESP, only on Uno and Nano. I just can’t believe there is no way to debug. How would anyone be able to deploy an ESP-based solution??
ESP Exception Decoder is exactly what I need so, I finally gave up and looked into installing the older Arduino IDE V1.8x. My concern was having both the new 2.x and old 1.8x versions installed side-by-side. It seems like people with 1.8x could install 2.x side-by-side, but going the other way is obviously slightly different, but I took a chance anyway and it seemed to work okay…? It was able to see the installed libraries in library manager, but I had to install ESP support in the board manager to select the D1 Mini. Then I imported my code to a new project and was not able to compile at all! It wouldn’t even start. It just kept giving me an error saying it couldn’t locate “preferences.txt” but the preferences screen shows me the exact location of the file and it is right there. After more wasted hours of Google searches, I was able to stumble upon someone who had the same issue. Turns out there is a bug in the ESP8266 boards library that causes this issue. I had to install an older version (v3.0.0) and it instantly compiled and worked.
So far, I never got a chance to use the ESP Exception Decoder because something strange is happening – instead of crashing every few minutes, the board has been running non-stop for over 3 and a half hours as I type this. Hmmm… perhaps the new ESP8266 library is what’s causing the illegal operation exceptions?! It’s still too early to tell and I will need to to run at least 12 hours to be somewhat sure, but it seems like it could be the case.
If anyone else wants to try, roll back your ESP8266 down to version v3.0.0 and re-compile and see if the reboots still occur.
I should have another update tomorrow or soon after. If it turns out it’s the ESP8266 Arduino core, then I’ll have more work to do to figure out and report the issue.