This is the continuation of the Another Smart Mirror version 2 that was published about a month ago. This project objective is to research and see what can be possible to create with current libraries and APIs to get as close as possible to the video that I would like to call my main inspiration: A Day Made of Glass.
That video display such great ideas that are and would be possible in the near future. So this is my attempt to do so.
So here is Another Smart Mirror - Artik Cloud Edition.
Step 1: Artik Cloud setupSo the first step would be to create an account with Artik Cloud and after that create a new device type by going to your developer dashboard.
On the device page, click on the NEW button next to Device Types.
After that let's enter a display name, in this case Another Smart Mirror - Sidekick and a unique name, in this case com.vaporwarecorp.mirror.sidekick and then click the CREATE DEVICE TYPE button.
In the following screen, let's add two fields: ACTION as string and URL also as string and the click the Activate Manifest tab.
In the Activate Manifest screen, let's click the ACTIVATE MANIFEST button.
And we created our first device type (figure 5).
And let's create another one. This one is going to be for the Mirror Control device. So let's enter Another Smart Mirror - Control for device display name and com.vaporwarecorp.mirror.control for unique name and let's click the CREATE DEVICE TYPE button.
Now let's click the NEW MANIFEST button and create quickly a manifest.
Let's create a device field with name action and type string and let's click the SAVE button.
A device field has been created. So now let's click the Activate Manifest tab.
In the Activate Manifest tab let's click the ACTIVATE MANIFEST button.
Now we have created our second device type.
Now we are going to create an application so let's go create one at https://developer.artik.cloud/dashboard/applications
Let's enter as App Name Another Smart Mirror, enter a description for the app, for Authorization Methods, select implicit and for Auth redirect URL enter mirror://artik/redirect.
After that click the SAVE APPLICATION button.
Now you'll get the permissions screen, click on the SET PERMISSIONS FOR A SPECIFIC DEVICE link.
Let's do a search for Another Smart Mirror Sidekick and select it. Also check the Read and Write checkboxes.
Now let's click the ADD DEVICE TYPE and do another search. This time for Another Smart Mirror Control and select it.
Let's also check the Read and Write checkboxes and then click the SAVE button.
Now we have created our Artik Cloud Application. Click on the SHOW CLIENT ID & SECRET link.
This would display a pop up with our Client ID and password for it. Write down the Client ID as we are going to need it to set up our devices.
Now go to your connected devices page at https://artik.cloud/my/devices and click on Connect another device link.
In this page let's do a search from Another Smart Mirror - Sidekick and let's select it.
In this screen we just need to click the CONNECT DEVICE button.
We just connected our first device. Let's click the Connect another device link once again.
And search for Another Smart Mirror - Control and select it.
And click on the CONNECT DEVICE button once again.
So now we have our two connected devices set up. Let's click the gear icon for Another Smart Mirror - Sidekick application.
We get a popup. Let's write down the DEVICE ID for later use and close the popup.
Now let's click the gear icon for the Another Smart Mirror - Control device and we'll get another popup.
And let's click the GENERATE DEVICE TOKEN link.
From here let's write down the DEVICE ID and DEVICE TOKEN. We'll need it later on.
And that should be all that is needed on the Artik Cloud side.
Step 2: Mirror-Sidekick setupMirror Sidekick is in charge to turn on/off the mirror application and also of the share functionality.
git clone https://github.com/jreyes/mirror-sidekick.git
cd mirror-sidekick
Before building the application go to app/src/main/res/values/string.xml and enter the following values in this file. For artik_client_id your application ID from figure 19, for artik_device_id you sidekick device ID from figure 27 and for artik_beacon_id a random generated UID from https://www.guidgenerator.com/
After that is done, proceed with building and installing with the following commands
gradlew installDebug
After that, the Sidekick application should be ready to use.
Mirror-Control runs in a Raspberry PI and it is in charge of receiving commands from Wiimotes or Lirc compatible devices and send it to Mirror application using Artik Cloud.
First thing is to log in into your Raspberry PI and execute the following commands:
git clone https://github.com/jreyes/mirror-control.git
cd mirror-control
sudo scripts/install.sh
After the commands are done running, the program should be ready to run. Please have in hand the DEVICE ID and DEVICE TOKEN from Figure 29 to enter it when the script prompts for it.
Also don't forget to pair and trust the devices at least once using the Bluetooth manager in the Raspberry Pi (Figure 33).
The final step is to setup the Mirror application. Once the mirror application is loaded and running, go to the configuration screen located at http://your-mirror-ip:4000/ and to the Artik Cloud Configuration section.
Once there you will enter your application ID from figure 19, your control device ID from figure 29, and your sidekick device ID from figure 27 (figure 35).
After you are done, restart the Smart Mirror application and you would see a Samsung account login screen. Enter your credentials and click on the Sign In button.
After that a screen to allow the Another Smart Mirror application to use your allowed devices appears. Click on the Allow button.
And that's it. Everything is configured and ready to use.
ThanksAnd of course thanks to the people, projects, and ideas that inspired me to create this.
Comments