WittyPi – Review and tutorial of the incredible HAT for Raspberry PI

After much work prior to the holidays and end of semester exams, I have the long-awaited and well-deserved time to write a good tutorial; This time talk about WittyPi brand Uugear.

This useful HAT It provides several additional features to our Raspberry Pi, as for example a real time clock, and the ability to configure the switching on and off automated; something really useful for implementing servers or the development of projects designed to operate in difficult to access areas.

WittyZero1

WittyPi con Raspberry Pi Zero V1.

To download the control software we can use terminal order wget, for then launch the installation script with root permissions; Once done already can run WittyPi to start enjoying their functions.

#Descargamos el software WittyPi
pi@raspberrypi:~$ wget http://www.uugear.com/repo/WittyPi/installWittyPi.sh

#Ejecutamos el script de instalación con permisos de root
pi@raspberrypi:~$ sudo sh installWittyPi.sh

If we want to use it with Raspberry PI 3, We must bear in mind that some values have been modified from the pins GPIO This model in the new versions of the Raspbian firmware to support the new Bluetooth module, by what we must add the following line to the end of the configuration file.

#/boot/config.txt
dtoverlay=pi3-miniuart-bt

If not add the line above in the configuration file before you connect WittyPi to the GPIO port, our Raspberry Pi will not start with WittyPi; being only on the Red led.

To understand the change that occurs to add this line in the configuration file of Raspberry Pi, You can run the utility GPIO readall before and after the change, as you can see from the results of both tests.

 
 +-----+-----+---------+------+---+---PI 3---+---+------+---------+-----+-----+
 | BCM | wPi |   Name  | Mode | V | Physical | V | Mode | Name    | wPi | BCM |
 +-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+
 |     |     |    3.3v |      |   |  1 || 2  |   |      | 5v      |     |     |
 |   2 |   8 |   SDA.1 | ALT0 | 1 |  3 || 4  |   |      | 5V      |     |     |
 |   3 |   9 |   SCL.1 | ALT0 | 1 |  5 || 6  |   |      | 0v      |     |     |
 |   4 |   7 | GPIO. 7 |   IN | 1 |  7 || 8  | 0 | IN   | TxD     | 15  | 14  |
 |     |     |      0v |      |   |  9 || 10 | 1 | IN   | RxD     | 16  | 15  |
 |  17 |   0 | GPIO. 0 |   IN | 0 | 11 || 12 | 0 | IN   | GPIO. 1 | 1   | 18  |
 |  27 |   2 | GPIO. 2 |   IN | 0 | 13 || 14 |   |      | 0v      |     |     |
 |  22 |   3 | GPIO. 3 |   IN | 0 | 15 || 16 | 0 | IN   | GPIO. 4 | 4   | 23  |
 |     |     |    3.3v |      |   | 17 || 18 | 0 | IN   | GPIO. 5 | 5   | 24  |
 |  10 |  12 |    MOSI |   IN | 0 | 19 || 20 |   |      | 0v      |     |     |
 |   9 |  13 |    MISO |   IN | 0 | 21 || 22 | 0 | IN   | GPIO. 6 | 6   | 25  |
 |  11 |  14 |    SCLK |   IN | 0 | 23 || 24 | 1 | IN   | CE0     | 10  | 8   |
 |     |     |      0v |      |   | 25 || 26 | 1 | IN   | CE1     | 11  | 7   |
 |   0 |  30 |   SDA.0 |   IN | 1 | 27 || 28 | 1 | IN   | SCL.0   | 31  | 1   |
 |   5 |  21 | GPIO.21 |   IN | 1 | 29 || 30 |   |      | 0v      |     |     |
 |   6 |  22 | GPIO.22 |   IN | 1 | 31 || 32 | 0 | IN   | GPIO.26 | 26  | 12  |
 |  13 |  23 | GPIO.23 |   IN | 0 | 33 || 34 |   |      | 0v      |     |     |
 |  19 |  24 | GPIO.24 |   IN | 0 | 35 || 36 | 0 | IN   | GPIO.27 | 27  | 16  |
 |  26 |  25 | GPIO.25 |   IN | 0 | 37 || 38 | 0 | IN   | GPIO.28 | 28  | 20  |
 |     |     |      0v |      |   | 39 || 40 | 0 | IN   | GPIO.29 | 29  | 21  |
 +-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+
 | BCM | wPi |   Name  | Mode | V | Physical | V | Mode | Name    | wPi | BCM |
 +-----+-----+---------+------+---+---PI 3---+---+------+---------+-----+-----+
 +-----+-----+---------+------+---+---PI 3---+---+------+---------+-----+-----+
 | BCM | wPi |   Name  | Mode | V | Physical | V | Mode | Name    | wPi | BCM |
 +-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+
 |     |     |    3.3v |      |   |  1 || 2  |   |      | 5v      |     |     |
 |   2 |   8 |   SDA.1 | ALT0 | 1 |  3 || 4  |   |      | 5V      |     |     |
 |   3 |   9 |   SCL.1 | ALT0 | 1 |  5 || 6  |   |      | 0v      |     |     |
 |   4 |   7 | GPIO. 7 |   IN | 1 |  7 || 8  | 1 | ALT0 | TxD     | 15  | 14  |
 |     |     |      0v |      |   |  9 || 10 | 1 | ALT0 | RxD     | 16  | 15  |
 |  17 |   0 | GPIO. 0 |   IN | 0 | 11 || 12 | 0 | IN   | GPIO. 1 | 1   | 18  |
 |  27 |   2 | GPIO. 2 |   IN | 0 | 13 || 14 |   |      | 0v      |     |     |
 |  22 |   3 | GPIO. 3 |   IN | 0 | 15 || 16 | 0 | IN   | GPIO. 4 | 4   | 23  |
 |     |     |    3.3v |      |   | 17 || 18 | 0 | IN   | GPIO. 5 | 5   | 24  |
 |  10 |  12 |    MOSI |   IN | 0 | 19 || 20 |   |      | 0v      |     |     |
 |   9 |  13 |    MISO |   IN | 0 | 21 || 22 | 0 | IN   | GPIO. 6 | 6   | 25  |
 |  11 |  14 |    SCLK |   IN | 0 | 23 || 24 | 1 | IN   | CE0     | 10  | 8   |
 |     |     |      0v |      |   | 25 || 26 | 1 | IN   | CE1     | 11  | 7   |
 |   0 |  30 |   SDA.0 |   IN | 1 | 27 || 28 | 1 | IN   | SCL.0   | 31  | 1   |
 |   5 |  21 | GPIO.21 |   IN | 1 | 29 || 30 |   |      | 0v      |     |     |
 |   6 |  22 | GPIO.22 |   IN | 1 | 31 || 32 | 0 | IN   | GPIO.26 | 26  | 12  |
 |  13 |  23 | GPIO.23 |   IN | 0 | 33 || 34 |   |      | 0v      |     |     |
 |  19 |  24 | GPIO.24 |   IN | 0 | 35 || 36 | 0 | IN   | GPIO.27 | 27  | 16  |
 |  26 |  25 | GPIO.25 |   IN | 0 | 37 || 38 | 0 | IN   | GPIO.28 | 28  | 20  |
 |     |     |      0v |      |   | 39 || 40 | 0 | IN   | GPIO.29 | 29  | 21  |
 +-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+
 | BCM | wPi |   Name  | Mode | V | Physical | V | Mode | Name    | wPi | BCM |
 +-----+-----+---------+------+---+---PI 3---+---+------+---------+-----+-----+

Now we can already start our Raspberry Pi by pressing the WittyPi power button, Enter the folder of the software you downloaded previously, and then run the file wittyPi.sh to set all your options.


================================================================================
|                                                                              |
|   Witty Pi - Realtime Clock + Power Management for Raspberry Pi              |
|                                                                              |
|                   < Version 2.17 >     by UUGear s.r.o.                      |
|                                                                              |
================================================================================
>>> Your system time is: Sat 11 Jun 2016 22:54:02 UTC
>>> Your RTC time is:    Sat 11 Jun 2016 22:54:03 UTC
Now you can:
  1. Write system time to RTC
  2. Write RTC time to system
  3. Set time for auto startup
  4. Set time for auto shutdown
  5. Choose schedule script
  6. Reset data...
  7. Exit
What do you want to do? (1~7) 

One of the most practical is to configure the software to read the power and shutdown cycles, as well as the time frame that applies to every one of them of a script hosted on our Raspberry Pi; below you can see several examples of syntax.

#Enciende Raspberry Pi a las 9:30 y la apaga a las 19:30

BEGIN	2016-01-31 00:00:00 
END	2017-01-31 23:59:59

ON	H9 M30
OFF	H19 M30


#Enciende Raspberry Pi el día 1 y el día 15 de cada mes durante una hora

BEGIN	2016-01-31 00:00:00 
END	2017-01-31 23:59:59

ON	H9 M30
OFF	H19 M30


#Enciende Raspberry Pi durante 5 minutos de cada 20

BEGIN	2016-01-31 00:00:00 
END	2017-01-31 23:59:59

ON	M5
OFF	M15


#Enciende Raspberry Pi 5 minutos de cada hora

BEGIN	2016-01-31 00:00:00 
END	2017-01-31 23:59:59

ON	M5
OFF	M55

For more advanced uses, You can consult the full the website of Uugear user manual; configuration problems before the first recommended step is to review file schedules.log, housed in the main directory of the software of WittyPi.

---------------------------------------------------
--------------- 2016-06-12 12:04:31 ---------------
File "schedule.wpi" not found, skip running schedule script.
---------------------------------------------------
--------------- 2016-06-11 23:20:14 ---------------
I can not find the begin time in the script...
---------------------------------------------------
--------------- 2016-06-11 23:49:22 ---------------
Schedule next shutdown at: 2016-06-12 00:05:00
Schedule next startup at:  2016-06-12 00:20:00
---------------------------------------------------

The HAT features of three jumpers with predefined functions, but we can also customize; the default position of the Red jumper It will require interaction with the user to turn on our Raspberry Pi, Since for this we must press the power button, If instead we change the position of such jumper, feeding WittyPi turns on our Raspberry automatically.

RojoOff

We can control the led indicator by sending a signal from one of the GPIO of Raspberry to pin Yellow, by default this signal will be received by the GPIO 17 But if we want to we can change the position of the jumper and assign other GPIO as input we will connect to the yellow pin.

Yellow

Finally sending a signal to the Green pin We can turn off properly our Raspberry Pi; as in the previous case this input function can assign to any pin by moving the jumper, by default the port used is the GPIO 4.

Green

If, after interrupting the supply of WittyPi our Raspberry starts a few seconds to finally shut down, will fix it by disconnecting the power and removing the battery from the HAT long enough so that all capacitors are discharged.

If you like you can follow me on Twitter, Facbook, Google +, LinkedIn, Feedly, or share it with the buttons under this publication, If you have any questions or suggestions please do not hesitate to comment.

Help us to reach more readers Share on LinkedInShare on FacebookTweet about this on TwitterShare on Google+Email this to someone

3 thoughts on"WittyPi – Review and tutorial of the incredible HAT for Raspberry PI

  1. Great to contribute to my RPI, but….. is not disponiple to your pag. Where can I buy? I'm in Blanes and would want to buy x free. Thanks . VERY GOOD EVERYTHING !!!!!!! You are great . excellent !!!!!!!!!!!

    • Hi Marc, Thanks for comment.

      Sorry if I have not answered in time, was out of the country for vacation and totally desconectat all; Many thanks for re-commented that as the interlaced output on sale.

Leave a Reply