(I'm not sure this belongs in "Programming Questions", but it doesn't seem compatible with the description of "Installation and Troubleshooting". The description of the project is only to give context. I'm hoping to get some general debugging advice, not help with the project.)
I'm using an Arduino Wifi Rev 2, with the arduino IDE 1.8.19 (on an M1 MacBook Pro). I wrote a project using the IRRemote library to serve as a translator/repeater for IR controls for AV equipment. It works for a while, but eventually crashes (or stops functioning, anyway) in 1 of 2 ways. I use "crash" to mean "stops working": I don't actually know if execution has halted, or if the project is stuck in a loop.
-
I can immediately make it "crash" by sending a command from a particular IR remote. But when I put in serial prints to debug, it no longer crashes when I use that same remote. Since I don't need to use that particular remote in the actual application, in practice I could live it, but it would be really nice to understand the underlying problem since it might be related to 2).
-
In the real-world application, I have to leave it running without a serial connection. After some random time from hours to days, it stops working. There don't seem to be any particular external circumstances that correlate with it crashing.
Any advice on how to go about debugging in both these cases?
Is there any way to learn about the state of an arduino/project after a project has stopped functioning?
Is there some configuration change I can make when there is a serial printing to make it more likely to catch this bug that so far only seems to occur when there is no serial print? I've tried 9600 and 115200 baud, to no effect.
Many thanks,
Peter
