Is Witty Pi Compatible with Raspberry Pi 3?
If you are running Witty Pi with software version 2.16 (or above), there is nothing to worry about and it should work with Raspberry Pi 3 out of the box.
If you are running Witty Pi with older software (V2.15 or below), Your Witty Pi may refuse to turn on your Raspberry Pi 3 after a recent firmware upgrade. You press the button on Witty Pi, you see the red LED on Raspberry Pi just lights up and soon goes out. This looks exactly like the “dead lock” status on Witty Pi, which may happen if you unplug the power directly after scheduling the auto-shutdown time. But indeed this is not “dead lock”, it is just a failed starting up.
If your Witty Pi is in this situation, please read on.
How comes the Witty Pi stops working after running the “sudo rpi-update” command?
This only happens on Raspberry Pi 3, which newly has Bluetooth module on board. After upgrading the firmware, the Bluetooth module is detected and get initialized on boot, and it will take the UART0, which was used for serial port communication. As a result, the GPIO 14 (TXD) and GPIO 15 (RXD) pins are mapped to UART1 instead, and GPIO14 gets pulled down by default. Since GPIO 14 (TXD) is the pin for Witty Pi to detect whether the operating system has been shutdown, pulling down GPIO 14 tells Witty Pi a wrong story and forces Witty Pi to cut the power.
The “gpio” utility from wiringPi can help us to understand what actually happened. Before upgrading the firmware, or using Witty Pi with other models, the pin status on boot look like this:
As you can see the TXD is in ALT0 mode and it gets pulled up by default (V=1).
Now checking this with on a Raspberry Pi 3 with newer firmware, you will see:
Now the TXD pin is in IN mode, and more importantly, it gets pulled down by default (V=0). This will force Witty Pi to cut power, and stop the procedure of turning on your Raspberry Pi 3.
You may also notice the GPIO 4 is also get pulled down by default now. Don’t know how this happen but it turns out to be the side-effect of mapping GPIO 14/15 to UART1. Pulling down GPIO 4 will also force Witty Pi to cut power, just like holding the button without releasing it.
What to do?
The best way is to restore the default pin status on boot. This could be achieved by configuration of device tree. More specifically, we need to append this line to the /boot/config.txt file:
This will force the Bluetooth to use mini-UART (ttyS0) and restore UART0/ttyAMA0 over GPIOs 14 & 15. After a reboot this configuration will take effect and you will see the GPIO pin status goes back to normal. Also you will see the GPIO 4 gets pulled up by default again.
If you have installed Witty Pi software V2.16 or above, the install script already takes care of this issue and you don’t need to fix it manually. If you are using V2.15 or below, you can still get and run the newer install script to have this problem fixed:
sudo sh installWittyPi.sh
Without removing (or renaming) the “wittyPi” directory, running the install script will not update the software for Witty Pi. However, it will still fix this issue for you (after a reboot).
Update on 2016.05.31:
If you want to use Bluetooth, you may need to append “core_freq=250″ to the “/boot/config.txt” file, then reboot your RPi3.