! ! ! ! ! ! ! ! ! ! !
!
20!
!
1.! Scripts!do!not!get!executed!automatically!after!Raspberry!Pi!system!is!on!
After!installing!the!software,!you!will!have!“daemon.sh”,!“syncTime.sh”!and!
“runScript.sh”!scripts!in!the!directory!that!has!software!installed.!These!scripts!should!
be!executed!automatically!after!the!operating!system!is!up.!
If!these!scripts!are!not!automatically!executed!for!any!reason,!Witty!Pi!will!cut!the!
power!of!Raspberry!Pi,!
without!lighting!up!the!white!LED
.!In!this!case,!the!first!
place!to!check!is!the!“/etc/init.d/wittypi”!file,!and!there!is!possibility!that!it!contains!
wrong!paths!to!these!scripts.!
If!you!are!running!a!special!distribution!of!OS,!make!sure!to!check!if!the!commands!in!
the!“/etc/init.d/wittypi”!file!do!exist!in!the!system,!or!it!will!fail!silently.!For!example,!
Minibian!doesn’t!have!“sudo”!command.!
2.! GPIO\4!pin!doesn’t!reach!a!stable!status!in!given!time!
After!the!system!is!on,!GPIOc4!pin!should!be!in!input!mode!and!gets!internally!pulled!
up.!However,!during!the!startup!the!GPIOc4!pin!could!be!unstable.!In!the!
daemon.sh
!
script,!the!GPIOc4!listener!will!be!started!once!the!pin!state!hasn’t!changed!for!10!
seconds.!Once!the!GPIOc4!listener!is!started,!any!action!that!pulls!down!GPIOc4!will!
be!regarded!as!a!shutdown!command.!So!if!GPIOc4!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!GPIOc4!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!GPIOc4!listener,!and!in!the!major!of!cases!it!will!help.!You!can!modify!the!
"
daemon.sh
"!script,!in!line!44:!
while![!$counter!clt!
10
!]u!do!
Try!to!change!the!number!10!to!25.!The!bigger!number!you!use,!the!later!the!GPIOc4!
listener!will!be!started.!
This!modification!may!workaround!the!problem.!If!it!doesn’t,!it!means!your!GPIOc4!is!
really!pulled!down!(by!software!or!hardware),!and!you!can!confirm!that!by!measuring!
the!voltage!on!GPIOc4!with!a!multimeter.!By!default,!the!GPIOc4!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!GPIOc4.!