Welcome to the Magic Mirror Group Page.
In order to implement this magic mirror, we used a raspberry pi as the computation device to drive the LCD. We used a python websocket server to run the api calls for the traffic and weather info, and used a webpage with embedded javascript and css to create the magic mirror page. The python backend also runs audio calls and plays audio for the personal greeting, weather, and traffic.
The Raspberry Pi duals as a controller and web socket server. First, the controller portion will make HTTP requests to Yahoo Weather, Google Maps, and WordsAPI for weather data, traffic times, and word of the day data. The API calls return JSON data to the controller which then parses this information for the web socket server portion. The Raspberry Pi web socket server takes the parsed JSON API information and forwards this to the client web page.
The controller portion of the Raspberry Pi is connected to a webcam that is running OpenCV detection software to check for new users that have approached the mirror. Upon detection of a new person will it forward this information to the web socket server portion stating who the person is and that it is ready to send new web socket data to any connected client web pages.
The client web page keeps an open web socket with the Raspberry Pi web socket server and asks the server every ten seconds if a new person was detected in front of the mirror. If a new person is detected, and when the client web page requests for new data then will the server reply with updated traffic time, weather information, and a new word of the day for the client page. If a new person is not detected, then each request for new data is discarded and no new information is sent to the web page. Simultaneously, if new data is sent to the client web page will the Raspberry Pi controller play audio stating the new data.
The client web page accepts the new information and displays this information on all black screen to be used for the mirror display to give the illusion that it is functioning as a ‘smart’ magic mirror.