Smart Mirror (EASY Software Setup)

Ose 9
46 followers
11 Video Views·Oct 27, 2022
First we're going to put the microSD into the SD adapter and plug it into our PC.
Next we can open up the AIY Projects with Google page.
We're going to scroll down and see where it says you can open up the earlier version
and then scroll down until you see the get the SD image.
Click on the voice kit SD image and a little image should download.
Show in folder.
Now here we have the OS for the Raspberry Pi.
Now open up the Etcher app.
Select that image.
Select your SD card and flash it and it's complete.
Next we're going to plug in our Raspberry Pi to our monitor.
Make sure our Wi-Fi is connected.
Then we're going to go here preferences and audio device settings.
This is where you're going to set up your speakers and your microphone.
Once that's done we can check the audio.
There you can see my speaker and my microphone works pretty well.
Now we're going to open up the internet and it comes with preset bookmarks.
Click on the first one and we're going to sign into Google.
Once you sign in it's going to open up your Google home page.
We're going to click down here.
Hit the plus button to create a project and name your project.
I'm going to name mine Gruntsome Mirror.
Hit create.
Next we're going to come over here and enable APIs.
Search for Google Assistant.
Click on that one and then we're going to hit enable.
Once you enable the API we're going to come over here and create credentials.
Make sure when you do this we're going to create the client ID.
Before we can click that we have to configure it.
The email box should auto populate and we're just going to rename it.
I'm going to keep everything consistent Gruntsome Mirror.
Press save.
Now we can hit other and create.
Again we're going to name it Gruntsome Mirror.
Keep everything the same thing.
Create and then it will give you your client ID and secret ID.
Next we're going to download that file and find it in our folder.
Then we're going to right click it and rename it to Assistant.
Next we're going to move this into our Pi folder.
There you can see it in there.
Next we're going to go to our second bookmark.
Back to the AOI projects page.
Again we're going to go to the older version instructions.
We're going to search for activity.
Here you can see the link for activity controls.
Make sure web and app activity is selected or enabled.
Device information is enabled and voice and audio activity is also enabled.
Now we can close out of this.
Go into our folder.
AOI projects.
Source.
Examples.
Voice.
And then we're going to look for the one assistant library demo.
Execute.
When you first execute it a window is going to pop up.
And you're just going to have to sign again into your google account.
And this will only happen the first time you boot it.
Press allow.
Close the window.
And then you can go ahead and speak with google.
Okay once that's set up we're going to download the magic mirror software.
So go to raspberry pi configuration.
Go to localization.
Set local.
I'm going to set it to the US.
Okay all that's all set.
Set our time zone next.
Again I'm going to find the US.
There it is.
And location I'm going to set to eastern.
Set the keyboard.
English.
US.
Okay.
Wi-Fi.
That's all set.
Okay now that it's all configured.
You should probably reboot.
I just didn't because I already had everything set up right.
Once that's all set up we can open the terminal.
And we're going to paste this code here.
I linked in the description.
This is your main command to download the magic mirror software.
I recommend pressing Y when it asks you for the PM2 install.
That's the auto boot function.
And here you see it pop up.
Now that it's installed let's customize it to how we want.
Okay next we're going to open up our terminal again.
And we're going to press PM2 stop magic mirror.
This will keep it from auto booting every 10 seconds.
Here you can see it says stopped.
Minimize that.
Go back over here.
We're going to go to magic mirror.
Config.
Config.js.
Here's what controls the whole layout of our display.
Down here we can change the time format.
Units from metric to imperial since I'm in the US.
So that'll be like Celsius instead of or Fahrenheit instead of Celsius.
Here's all your modules.
Clock, calendar, weather.
If you don't want a module like I don't.
Do bracket to bracket and just delete it from your file.
Get rid of that.
Come up here.
We'll get rid of update notifications and alert.
Just go bracket to bracket.
Backspace.
And save that.
Now we can come over here.
Now to start it back up to auto boot.
We do PM2 start magic mirror.
And it should boot right up.
Here you can see the time up.
But as you can see the weather's not coming up.
Now we have to configure the weather with an API key in order to do this.
So we're going to come back over here.
Exit out of this.
And go back onto the internet.
First we'll stop the magic mirror from auto booting again.
So go to the internet.
And we're going to type in open weather map.
Should be open weather map dot org slash API.
Next we're going to sign up or sign in.
Enter all your information.
And once you log on.
We're going to go to our home.
And then go to API keys.
Here it'll give you your API key.
So just copy that.
Minimize the window.
And then we're going to come back here.
Magic mirror.
Back to our config file.
And back into that.
JavaScript.
And then we're going to come here.
And replace where it says your open weather API key.
And we're going to paste our actual API key.
Save that.
And let's do a manual boot.
So we do CD magic mirror.
NPM start.
Now as you can see the weather has come up with the default New York US location.
So now we're going to go and change the location.
I live in Boston.
So we're going to copy this link here.
Open a new tab.
Paste that.
And it'll open up this whole list of cities.
I'm going to search for Boston.
Now I realize here this is Boston, Great Britain.
Which is the wrong one.
But you can get the idea.
Paste your ID there.
Rename it Boston.
Again for weather forecast.
Rename it Boston.
Paste my city code.
Save that.
I just control S.
And again NPM start.
Here you can see it updated to Boston.
Current weather.
Okay once that's done.
I'm going to show you how you can change the orientation of your monitor.
So type in sudo nano bootconfig.txt.
This is your config file.
And we're going to paste display underscore rotate.
One for vertical.
Zero for horizontal.
On default it is zero horizontal.
Control X Y enter to save it.
And we're going to reboot.
As you can see it's swapped the orientation of my screen.
I'm going to go back to the normal view for now.
Go back into my config file.
Now if you make any mistakes with your config file.
You can always go into the sample.
This is just your default.
So just copy and paste.
To get back to the original.
Now I'm going to put everything on the left.
Like I showed in the beginning of my video.
So all you have to do to do that is rename the position spot.
Save that.
And let's boot it back up manually with npm start.
And as you can see everything is now oriented on the left side of my screen.
Now you can hit control minus to zoom out.
And control shift plus to zoom in the text.
Depending on how large you want it.
Now to finish the design up.
I'm going to make the background black.
So when it boots up you do not see the background image.
It'll just be the mirror.
So we're going to change that to black.
The panel is going to be completely translucent.
Now there's barely anything left on the screen.
And then we're going to come back here.
Go to pi.
We want to show hidden files dot config auto lx session lxd pi.
And we're going to right click that folder.
Open in terminal.
Then write sudo nano autostart.
Next we're going to paste these commands here.
This will just keep it from going to sleep.
And shutting off the display.
Control x y enter to save.
And then finally so that the cursor doesn't come up when we boot the display.
We're going to write the command sudo apt-get install unclutter.
And that'll do the trick.
Finally if you want to be able to edit it without having to take the pi out every time.
We're going to come over here.
Go to our configuration.
Go to interfaces.
Enable the vnc function.
And then up here if you click on that it'll tell you the ip address of your pi.
Next you have to download vnc viewer online.
Open it up.
And file new connection.
We're going to type in the ip address that we found on our pi.
Name it something and press ok.
Here I did it for my bathroom mirror.
You can see it.
And that's how I've been connecting this whole time.
Via my laptop.
So that's about it.
I hope you enjoyed this video.
This is quite a long project of mine that is finally underway.
Now I didn't want this video to run too long.
So I will be covering how to set up your mirror calendar.
With your personal iphone or google calendar.
As well as how to set up the spotify now playing module in upcoming videos.
Additionally I will be covering how to set up this mirror with an integrated alexa.
Or an external echo dot instead of google assistant.
So let me know what you think in the comments.
And feel free to subscribe and like if you enjoyed this video.
Stay tuned for more upcoming videos and updates on the smart mirror.
