Smart Mirror: Software update 1:


All work done on the software side is accessible on https://github.com/erlendhel/smartmirror/, where the master branch is a snapshot of the latest release, while the develop branch is up to date with the latest changes.

Summarized, the software for our smart mirror will of the first release has the following functionalities: live news, an indicator of travel time and live weather. These functionalities are to be presented in a graphical user interface. The software is intended to run on a Raspberry Pi 3 which is cast to a tablet (Currently of the type: UTOO Pad). This is currently done by establishing an SSH connection between the Pi and the UTOO Pad, further, a VNC client is used to share the desktop from the Pi to the screen of the tablet.

NewsAPI

The current concept is that a user of the smart mirror can have three favorite news sources. For these three news sources, the user can access live articles. To facilitate the presentation of live news in our smart mirror, we decided to use the NewsAPI (https://newsapi.org/). NewsAPI is a free API with more than 70 sources for news from across the world.

In order to minimize the number of external calls to the API, we decided to make a class dedicated to this behavior. The raw response from the API is stripped of redundant data and then stored locally. Further, the locally stored data is used in a wrapper class which supports easy usage between our two software students.

Google Maps API

To be able to provide a user of the smart mirror with travel times from his/her current location to another, we have made use of the Google Maps APIs (https://developers.google.com/maps/). To get a current location for a user, we’re using an IP-tracing service provided by http://freegeoip.net. We are at the time of writing experiencing some difficulties getting the positional data for the local IP. This results in weird positions of the origin and is something we are working on solving. Because of this, the travel time feature is currently only a proof of concept.

In terms of our usage of the API, we decided to go through with it in a similar fashion as we did the NewsAPI. After getting the responses needed from the Google Maps API (Places and Distance Matrix), a tailored response is created which is stripped of unnecessary data. This response is then used within our application.

Weather API

One of the ideas for the smart mirror is that the user should have quick access to frequently asked data. One of the features to support this idea is to bring the weather data to the user of the mirror.  We use the Weather API from https://openweathermap.org/api to achieve this feature.  To make it easier to use the data requested from the API, we have made a wrapper which strips redundant data and organizes the relevant data into different data structures. The user of this weather interface can request both current weather data, a daily forecast and a weekly forecast. The wrapper is currently hard coded to only serve weather data for Kongsberg as this is the only place we will use the mirror in this project, but can easily be expanded to contain several cities, or even look up the users IP address to get a geo location.

GUI

The graphical user interface (GUI) is divided into different screens. The screen at startup will contain all the different modules our smart mirror contains. As of now, this includes the navigation, weather and news modules. In addition to a clock- and date-label, the main screen also contains a settings button which is intended to let the user set his preferences, e.g. his/hers preferred news sources.

Navigation module

Currently, the navigation module will just show the time it takes to drive to Krona, but this is intended to be further expanded by letting the user choose ‘travelmode’ and destinations.

Weather module

The weather module on the main screen contains the current temperature as well as an icon corresponding to the weather description, e.g. ‘cloudy’. By touching/clicking the weather module of the main screen, the user is taken to the weather screen. This screen will contain more in-depth detail about the weather. This screen is divided into three parts. The first part shows more data about the current weather. The second part shows a daily forecast with 3 hours intervals. The third part shows a weekly forecast.

News module

The main screen will contain the chosen three preferred news for the user. By clicking/touching one of these source logos, the user will be taken to a source screen. This screen will contain ten titles (some of which may be cut because of limited screen size) from the clicked source. These titles are again linked to the description of the news article, which will be displayed to the user when a title is clicked/touched.

First working version of the GUI

 


Leave a Reply