Interactive Smart Mirror

Pages
Contributors: Shawn Hymel
Favorited Favorite 24

The Code

Download the smart mirror code and unzip it:

rm master.zip
wget https://github.com/sparkfun/IoT_SmartMirror/archive/master.zip
unzip master.zip
mv IoT_SmartMirror-master IoT_SmartMirror

Edit the smartmirror.js file:

cd IoT_SmartMirror
vi smartmirror.js

Find the OPENWEATHER_API_KEY and change it to your API key. Additionally, change the LATITUDE and LONGITUDE variables to reflect your location (don't forget to press 'i' to edit text).

Updating smartmirror.js

When you are finished, press 'esc' and enter ':wq' to save and exit. Now, we can run the smart mirror code!

export NODE_PATH=$NODE_PATH:/usr/local/lib/node_modules/
node smartmirror.js

This should cause the mirror to (slowly) refresh and begin displaying weather data (make sure nothing is blocking the APDS-9960's sensor when you run the program). Press 'ctrl+c' to stop the code. Now that we know it works, it's time to configure the Edison so that our program starts on boot.