My intensive project is the Smart Mirror.
The Smart Mirror functions as your everyday mirror. Unlike normal mirrors, the smart mirror projects the weather, your location, and the news. See Figure 1.For my first milestone, I integrated multiple APIs into a Python script running on Raspberry Pi. I successfully downloaded necessary files and dependencies and registered the API tokens for weather news and location websites.An application programming interface, or API for short, is a set of protocols and tools used for programming.One example is the google maps API. Instead of recreating a map every time I wanted to show one on a website or other software, I can use the existing google maps software to do the same action more efficiently.
An API token is a unique identifier of an application requesting access to a service.A user can request an API token from a website that in return will give them information such as the user’s location and weather.Using Hackershack’s Github instructions, I used my Raspberry Pi 3 to display specific time weather and location on the monitor.
See link here: https://github.com/HackerShackOfficial/Smart-Mirror
There were many steps to reach this milestone. First, I connected all wires (HDMI cables and Raspberry Pi) that would enable me to project the content onto the monitor.Raspberry Pi is a series of small single board computers often used to promote basic computer science skills. It is commonly used in projects such as these for ease of use and relative cheapness.Next, using the terminal and the Github instructions, I gained access to the smart mirror’s files that have space to insert API tokens for the mirror display.I used the command line Terminal in Raspberry Pi to navigate through files and edit code used for the mirror.For instance, I used Dir and Cd commands to both access files and change directories in addition to Vim to access the script.
Using Dir and Cd commands. Notice how after dir (standing for directory) all the folders are visible. After, cd (meaning change directory), I access the sub folder Smart-mirror- master of the main folder Desktop. Vim is a text editing program used to open and display a file to modify within the command line.Through Vim, I was able to view and edit the features on the display screen using the URLs and API tokens from websites like Dark sky and Freegeoip.Some topics I have learned whilst completing this project is terminal commands and simple code in Python.More specifically, I learned how to access and exit out of directories and edit code in Python.
Some issues I have encountered was getting the correct IP addresses, links, and making sure there were not any errors in my code . Several websites that I initially requested API tokens from were shut down and I was not able to receive the specific information to display on the mirror. To solve this I searched for an alternative API for a similar feature.Another problem I encountered was making sure that there were no mistakes in my code.Due to little coding experience, it is easy to make minor mistakes that are essential to running the code properly. By having independence in trying to solve mistakes in my code and navigating around directories and files , I learned more about commands and functions of terminals.