Initial configuration

Initial configuration of the smart mirror software.

Advertisements

Allright, everything’s starting up.

But there’s one more problem.  When starting up the interface tells us nothing is configured yet.  Luckily this can easily be helped.

The magic mirror application has to be configured using a configuration javascript file called “config.js”, located in the “config” subfolder of the project.  However, if you browse to it there is no such file.  There is a .js.sample file instead.

Open a terminal and navigate to the location of the “Smartmirrorproject”, and change directory to the “config” folder.

copy the sample file to a regular file using

cp config.js.sample config.js

list the contents of the directory, and you see there’s now a file called config.js.

Schermafbeelding 2017-01-04 om 23.31.48.png

let’s see the contents.  Navigate to the file in atom and click it.

You can see that it’s actually a json file.

Every object (between curly braces) in the “modules” property is a module configured to appear on the mirror.  There are a lot of defaults activated.  I would like to start by adjusting the weather modules (current weather and forecast).

This module connects through the API of open weather map : http://www.openweathermap.org

You can see that the AppID en LocationID properties are not filled in.  We need to do that in order to get the weather for the appropriate location.

First things first : go to the website of open weather map, and register yourself.  Fill in the necessary details, and you’ll automatically get a key for the “free” plan. A plan that lets you query the service for a maximum of 60 times per minute.  That’s every second… should do, right?

Schermafbeelding 2017-01-04 om 23.48.41.png

So, now we have the AppID.  What about the location?

The API can get the weather for a whole lot of locations in the world.  I live in the town of Oudenaarde, Belgium.  A god forsaken place with 2 streets and a saloon so to speak.  Still, it’s in the list that can be found at this location :

http://openweathermap.org/help/city_list.txt

Find the city you want, and copy out the LocationID.

Now, adjust config.js so it looks like this :

Schermafbeelding 2017-01-05 om 00.04.02.png

Notice how I entered the locationID and AppId.

The service from open weather map, might take a few minutes to start serving you the weather.  Just try and save the config.js file, and run the mirror app again.

Tah dah :

Schermafbeelding 2017-01-04 om 23.54.58.png

Good luck with that!

 

 

 

 

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s