I’ve often found that the most useful debugging technique is to be able to provide a visual cue that something is going on. And for that, blinking the power light on the Raspberry Pi is the easiest thing to do.
The power light (often called LED1) is always on, and bright red. So turning it off, and back on is a great little debugging technique.
A short note about the LEDs on Raspberry Pi. There are two, one is the green one [led0] for network activity, and the other is the red one [led1] for power.
They are exposed through
/sys/class/leds/led[number]
To turn off the red LED
echo 0 > /sys/class/leds/led1/brightness
To turn on the red LED
echo 0 > /sys/class/leds/led1/brightness
Doing this requires that you are privileged. So to make things easy I wrote it in C, put the binary in /bin, and turned on the setuid bit on it. I’ve also used a library that blinks the power LED in simple morse code to get a short message across. I can’t do more than about 10 wpm in my head now so while it is slow, it is very very useful.