My complete github project (https://github.com/texadactyl/rpi_clock ) provides a Raspberry Pi Clock & Weather display (rpi_clock), based on the Quimat 3.5" TFT Touch Screen with a 320x480 resolution and their software housed at https://github.com/goodtft/LCD-show. The primary Tk window displays date, time, and current weather conditions outside according to the Richardson Texas USA station of the Weather Underground. If you touch the screen, it will bring up a secondary Tk window which offers the user to go back to the primary window, reboot, or shutdown.
You can see that I set up the primary window presentation for an American-formatted date & time presentation. Modifying this is very simple by editing bin/rpi_clock.py constants FORMAT_DATE and FORMAT_TIME. You can easily modify colors, fonts, widths, button sizes, etc. as you wish as they are also capitalized constants. The weather data comes in a response from the Weather Underground using a JSON-oriented API for current weather conditions. I chose to show temperature in both Celsius and Fahrenheit. The conditions string ("partlycloudy" in the image above) was returned by the Weather Underground as part of its JSON response message, probably formatted for American English due to the station parameters (Richardson); I simply used it as is.
Had I purchased a larger screen (E.g. 7") I could have employed graphic images and other data which would have been more aesthetically-pleasing.
Sorry but I did not show the usual unboxing of the display hardware etc. as I only thought about sharing this experience after construction finished (oops).
Note that the directions from Quimat (TFT supplier) were quite sparse (being generous). You can see my complete review at Amazon (https://www.amazon.com/gp/customer-reviews/RXAU7YNHXRTIP/ref=cm_cr_getr_d_rvw_ttl?ie=UTF8&ASIN=B06W55HBTX). There are probably better hardware solutions although this worked fine for a persistent old hacker like me. (=: In their defense, I'll say that the display hardware pushed onto the Pi's GPIO connectors without issues; no wiring required. However, watch out for the supplied plastic case because it is very brittle - mine broke [] so I slapped together a semi-protective solution (bottom of a clear case in my bottom desk drawer) that covers the bottom of the Pi. If the TFT (protecting the front of the Pi) dies because there is nothing protecting it, I'll look for another hardware vendor product. See? I went cheap (USD 28 for TFT, touch pen, DVD-docs, and brittle clear case) and got bitten. Lol@myself!
I used my existing Raspberry Pi 2 and passed along its USB drive (previous blog subject) to my new Raspberry Pi 3. It would not be terribly difficult to modify the rpi_clock.py Python 3 script to employ:
- A different touch-screen display product which interfaces with the Raspberry Pi 2 or 3.
- Run in another Linux distribution or under any O.S. which supports Python 3, JSON, and Tk.
View from the top:
View from the bottom:
GITHUB CONTENTS
Subfolders:
- bin - rpi_clock.py (Python 3 source code)
- docs - preparation_notes.txt (how-to do everything required - really! - after following Quimat hardware installation instructions).
AFTERTHOUGHTS
Admittedly, there seems to be other 3.5" TFT display products which claim to NOT require special drivers as of the latest Raspbian during 2017 (more desirable IMO). In fact, the Quimat product might too. I just got caught in the middle! Some time in the future, I might try it without the Quimat-supplied driver software. If that effort is successful, I will update this blog and the github project.
Will this work on a Pi Zero? Pi A or B?
How well did I test preparation_notes.txt?
Find any bugs?
Suggestions for improvement?
The Weather Underground seems to be world-wide. Alternate international weather data provider?
Richard Elkins Dallas, Texas, USA, 3rd Rock, Sol