I’ve decided to make this article english only. Mainly because I’m lazy but also because everyone who wants to do something similar should definitely understand english.
The question is: What the heck is a SmartMirror?
This Project was inspired by the MagicMirror found here. Sadly, that thing costs over 300€ so I’ve decided to build it in a smaller scale.
Good thing, that I had the insides of an Acer Aspire ZG5 Netbook lying around. In the end this whole project costed me about 60€.
First, a picture of the finished Smartmirror:
Apart from showing the current time/date/weather/news it is also acting as a DLNA Renderer. Networking is done via Wifi.
At first I tried the cheaper aproach and put some reflective film onto a normal pane, but sadly the result was also a pain. (Pun intended)
This is the first photo of me testing the one-way-mirror sample of my local glasser. Since they had no other one-way-mirrors to cut out mine they took it from the sample and so it costed me only 10€. \o/ I also ordered a frame there.
Mirror Size: 16x23cm
This is me testing the now cut out mirror. Note that it had to be bigger than the Panel because of the larger Motherboard behind it. This is NOT how it should be. The backlight bleeding and the lack of a sane viewing angle of the panel makes it easy to spot in this build.
The mirror should always be only as large as the panel.
The USB thumbdrive was later replaced with a tinier one. I’ve installed a simple Debian Wheezy on it.
This is the custom-made frame. It costed a whopping 39,50€.
Testing if everything fits inside the frame.
To align the panel and keep the light away from everything else I took a piece of black cardboard, cut it to 16x23cm and put a notch for the panel in the middle.
I’ve added some more cardboard to keep everything in place. Also, I cut out a hole for the webcam.
Some more cardboard to protect the panel from the heat of the mainboard.
Mainboard with Wifi antennas built in and fixed with some hot glue.
Planning the backside. It’s made of thicker high quality(?) cardboard.
Finally the finished mirror from the back with holes for ventilation and the power button cut out.
Nobody will ever look at the back side.. right? RIGHT?
Again, hotglue. I seriously hope that this thing will never die on me because I’d have to rip the whole back cardboard apart. 🙁
The speakers were glued to the cardboard, because they sound better that way. Why? Sounding Box maybe? I have no idea.
Now to the software. As mentioned in the beginning this machine is running a simple Debian Wheezy installed on a tiny 16GB USB thumbdrive.
I’ve configured another user “smartmirror” which runs everything important. The Display basically shows a fullscreen chromium instance in kiosk mode with fluxbox in an X session without a mouse cursor. Simple, eh?
I’m running the X server with the /etc/rc.local file.
mount -t tmpfs -o size=100M none /home/smartmirror/.config
su smartmirror -c “xinit /home/smartmirror/starter.sh — :0 -nocursor & 2>1 >/dev/null
Here’s the code of /home/smartmirror/starter.sh
xrandr –output LVDS1 –rotate left
xset s off
xset s noblank
/usr/bin/chromium “–no-first-run” “–incognito” “–kiosk” “file:///home/smartmirror/smartmirror_light/index.html”
The smartmirror_light html stuff is located in this git repo.
The display is turned off if nothing moved in front of it in the last 60 seconds. I’m doing this with “motion” and the following configuration:
It doesn’t save files and also doesn’t provide the livestream of the camera in this config. The only thing it does is running /usr/local/bin/monitoron.sh if it detects motion and /usr/local/bin/monitoroff.sh 60 seconds after the last motion.
Now to the contents of those files:
root@smartmirror-7:~# cat /usr/local/bin/monitoron.sh
xdotool mousemove 0 0 && xdotool mousemove 0 1
xset s off
root@smartmirror-7:~# cat /usr/local/bin/monitoroff.sh
xset dpms force off
Yes, using xdotool to simulate a moving mouse is the only way I know to enable the display again.
The DLNA Renderer stuff is done by gmrenderer-resurrect. It even includes a simple init script.
Wifi is done with wpa_supplicant and the /etc/network/interfaces file
iface wlan0 inet manual
post-up ifdown eth0
iface default inet dhcp
root@smartmirror-7:~# cat /etc/wpa_supplicant/wpa_supplicant.conf
I think thats it. If you got some questions about this feel free to ask in the comments or msg Hypfer on freenode.