User Manual

39
After the system is on, GPIO-4 pin should be in input mode and gets internally pulled
up. However, during the startup the GPIO-4 pin could be unstable. In the daemon.sh
script, the GPIO-4 listener will be started once the pin state hasn’t changed for 10
seconds. Once the GPIO-4 listener is started, any action that pulls down GPIO-4 will
be regarded as a shutdown command. So if GPIO-4 pin doesn’t really get stable after
the given 10 seconds, Witty Pi will take it as a shutdown command, lights up the
white LED and then shutdown the system.
There are many factors that might cause the GPIO pin unstable, and the most
common one is the power supply. If your power supply is not strong enough, during
the booting its voltage may drop from time to time, which may also make the GPIO pin
voltage drop, and trigger the GPIO-4 listener to shutdown your Raspberry Pi.
If it is the case, you don’t have to replace the power supply. Just try to delay the
starting of GPIO-4 listener, and in the major of cases it will help. You can modify the
"daemon.sh" script, in line 66:
while [ $counter -lt 5 ]; do
Try to change the number 10 to 25. The bigger number you use, the later the GPIO-4
listener will be started.
This modification may workaround the problem. If it doesn’t, it means your GPIO-4 is
really pulled down (by software or hardware), and you can confirm that by measuring
the voltage on GPIO-4 with a multimeter. By default, the GPIO-4 should be internally
pulled up. If it gets pulled down, try to find out who does this and don’t let it do this
again, or you can use another pin to replace GPIO-4.