Last night I wrote the necessary code to debug the sensor detector hang problem.
Essentially I created a timer-based interrupt. Every 500ms a simple watchdog interrupt is called. The watchdog interrupt sees if a variable has been set by the main program. If so, it resets it, if not then it transmits a packet with the value of the last procedure called by the main loop.
I don’t know if this trick of using an interrupt will let me find the problem, but it is the best solution I’ve been able to come up with to debug this problem.
This morning I reinstalled the sensor detector back in the garage and connected it to the sensor that has been having the problem.