Programas para controlar remotamente tu ordenador hay muchos pero, sin duda, AnyDesk es una de las mejores opciones.
Efectívamente, programas para controlar remotamente tu PC, portátil, tableta o móvil hay muchos y muy diversos. Mi experiencia al respecto no es excesiva pero algunos he utilizado. Esencialmente RealVNC que, como es sabido, viene instalado por defecto con el Sistema Operativo Raspbian para Raspberry. De hecho, suele ser el programa «oficial» para controlar remotamente estos sorprendentes microordenadores (dentro de la misma red en mi caso) de una forma cómoda. Para mi resulta imprescindible tanto para el control de mi Magic Mirror como para la «Raspi» con Alexa integrada que me he montado en las últimas semanas. Aunque no es el objeto del post, por aquí te dejo la información para configurar VNC en tu Raspberry.
Sin embargo y más allá de las buenas prestaciones (pese a algún «cuelgue» puntual) de RealVNC para el control remoto de la Raspberry, la cuestión se complica algo más si lo que queremos es controlar otro tipo de dispositivos, especialmente si no se encuentran dentro de la misma red. Como es lógico, ello es posible con esta alternativa pero pronto nos encontraremos con algunos inconvenientes.
El primero y evidentemente más importante es que RealVNC no es gratuito o, para ser más exactos, no es totalmente gratuito. Es decir, si realmente necesitas funcionalidades más avanzadas que las básicas, será necesario que pases por «caja». Y no es que me parezca mal, obviamente. El «conocimiento» hay que pagarlo y la buena gente que está detrás de RealVNC pues también tendrá que comer, imagino. Solo lo cito porque entiendo que será de interés para la concurrencia.
Por otro lado si pretendes utilizar RealVNC para controlar algún dispositivo fuera de tu red, prepárate para «pelearte» con tu router dado que tendrás que abrir puertos y pijaditas semejantes, muy importantes -por supuesto- desde el punto de vista de la seguridad pero que complican el asunto bastante a los no muy duchos (como un servidor) en ese tipo de materias.
Así las cosas y en pleno periodo de confinamiento por el COVID-19, una compañera me pide que le ayude a configurar su nuevo ordenador, comprado expresamente para poder atrincherarse en condiciones en su casa y seguir desarrollando su actividad laboral. Dado que no me veía afrontando tal cuestión a golpe de teléfono o WhatsApp, pensé en el control remoto del portátil para facilitar la cuestión. Descartado -por las razones expuestas- RealVNC, es donde entra en juego mi amigo «Fran» (un entendido en informática pero de los de verdad y no un simple «apañado») el cual me recomendó y aquí llega la razón última de este post, AnyDesk.
Sin obligación de indagar mucho en su configuración, con una instalación simple y una forma de conexión remota más simple aún, pude fácilmente «tomar el control» del portátil de la compañera y hacerle (con su permiso) todas las herejías que me pareció oportuno incluyendo, obviamente, la desinstalación inmediata del Office 365 y sus insistentes propuestas de suscripción que no hay porque soportar existiendo alternativas muy válidas como LibreOffice u OpenOffice. Vale, ya se que no es lo mismo, pero todo es cuestión de acostumbrarse.
Pero volviendo al tema del post, esto es, el control de escritorios remotos mediante AnyDesk, puedo dar fe que su uso es muy sencillo e intuitivo. Lo primero, lógicamente, es descargar el programa en ambos ordenadores (existen versiones para Windows, macOS o Linux además de para Android e IOs). Una vez instalado, simplemente hay que abrirlo y automáticamente asignará a tu dispositivo un número ID de 9 cifras que será el que tendrás que utilizar si estás trasteando con aparatos tuyos o facilitar a la otra persona para que se conecte a tu dispositivo. Es importante señalar que este ID de 9 cifras nunca cambia (que yo sepa). Una vez tengas los 9 dígitos del ordenador al que te quieras conectar, solo tienes que introducirlos en el campo indicado y pinchar, obviamente, en «Conectar«. El ordenador a controlar remotamente recibirá una petición de «autorización» que, una vez aceptada, te permitirá tomar posesión del mismo sin más impedimentos ni configuración.
Creo que no hará falta recordar (pero lo recuerdo) que ambos dispositivos deberán estar encendidos y conectados a Internet porque el programa es bueno pero, milagros, lo que se dice, milagros, no hace…
Una vez estés trasteando con el ordenador a controlar, podrás utilizar otras funcionalidades de interés como, por supuesto, transferir archivos entre un dispositivo y otro.
Una de las características que me parecieron más interesantes del programa es su carácter bidireccional. Es decir, nada de «servidor» y «cliente». Simplemente con tener el programa instalado en ambos dispositivos y conocer el ID correspondiente, podrás enviar tu solicitud de conexión sin mayor problema.
Mencionar que el programa también permite controlar dispositivos de forma «permanente» si se configura adecuadamente por lo que resulta ideal para controlar el ordenador del trabajo desde casa o el de casa desde el móvil o lo que se te ocurra o necesites. Como no era mi caso en estos momentos, sinceramente no exploré esta posibilidad pero dicho queda.
Y hasta aquí esta breve referencia a AnyDesk que espero te haya resultado de interés y utilidad. Ahora solo me queda esperar la llamada de esta gente para que se paguen unas cañitas que sea por la publicidad gratuita que les he hecho.
Buscando proyectos para trastear con mi primera Raspberry, llegué al mundo de los Magic Mirror. Desde entonces y después de algunos meses de aprendizaje y cientos de pruebas y ensayos, he culminado mi primer «Espejo Mágico» que, pese a estar muy contento con el resultado final, considero solo un primer prototipo previo a retos mayores a afrontar en el futuro.
En esencia, un Magic Mirror no es más que un espejo (¿mágico?) que, además de realizar su función -más o menos- como tal, permite mostrar información de muy diverso tipo con un amplio abanico de posibilidades de configuración. Aunque algo existía ya previamente, la popularidad de estos dispositivos, que responden a la filosofía DIY (Do it Yourself), se debe a Michael Teeuw y la enorme y activa comunidad de makers existente en torno al mundo del Magic Mirror.
La «magia» la producen una serie de dispositivos -con especial referencia a la insustituible Raspberry- que, hábilmente, camuflados tras el cristal permiten lograr el efecto deseado, combinados con un potente software de carácter modular que te permite experimentar con infinidad de funcionalidades.
No hace falta decir que pocas aportaciones originales hay en el «prototipo» que voy a comentar en este post (aunque alguna contribución propia quizá se pueda encontrar). En esencia, es una recopilación de información y trabajos de otras personas (especialmente en lo que a los módulos instalados se refiere) a los que agradezco enormemente que hayan puesto sus conocimientos y sabiduría a disposición del personal a través de la red. A todos los «makers» del mundo… ¡Muchas gracias!
En este tutorial, no me pararé con excesivo detalle en el proceso de construcción o configuración del espejo propiamente sino, en esencia, lo que pretendo transmitir son mis experiencias al respecto, así como el resultado final. En todo caso, siempre encontrarás a lo largo de este post una recopilación de los enlaces necesarios para comenzar tu «mágica andadura».
¡Let’s go babe!
¡Sube el volumen! Mi Magic Mirror terminado (de momento).
¿Qué necesitamos?
Pues además de ganas, para desarrollar un proyecto similar (o seguramente mejorado) al que se recoge en este tutorial, unas cuantas cosillas aunque nada difícil de conseguir ni tampoco especialmente caro:
Raspberry Pi con una instalación limpía de Raspbian. En mi caso utilicé una Raspberry 3B+ aunque me consta que se pueden utilizar otros modelos, incluidos la Zero y la flamante Raspberry Pi 4.
Tarjeta MicroSD de calidad. En mi caso, utilizo una SanDisk de 32 GB pero es factible utilizar de menor capacidad.
Televisión o monitor de ordenador del tamaño que desees en función del tipo de Magic Mirror que tengas pensado. (Yo utilice un monitor de desecho de 24 pulgadas -o eso creo- adquirido en una tienda de segunda mano por 5 €.).
Adaptador VGA-HDMI. En mi caso obligado puesto que mi vetusto monitor no contaba con la entrada HDMI necesaria para conectarlo a la Raspberry. En concreto me refiero a algo como la imagen y que, en mi caso, adquirí aquí.
Adaptador HDMI a VGA
Cable HDMI. Mientras más corto mejor por aquello de ahorrar espacio en la «trastienda».
Teclado y un ratón inhalambricos o usb. Necesarios solo para la configuración inicial de la Raspberry. Luego podrás prescindir de ellos.
Un marco reutilizablepara construir la estructura que deberá soportar el espejo o la madera necesaria para ello. Después de varias pruebas, está segunda fue la opción que yo escogí.
Algún conocimiento de inglés. Como siempre ocurre en el mundo DIY, a medida que quieres profundizar en cualquier proyecto, las páginas en español se van quedando cortas y, más pronto que tarde, necesitarás consultar páginas en inglés. Aún así, no debes preocuparte en exceso puesto que en Internet encontrarás también información en español suficiente como para apañártelas. Así que si no controlas el idioma de Shakespeare, tampoco debe ser motivo para desanimarte. Además… ¡Siempre te queda el Google Translate!
Y la esencia del «invento», un espejo espía, también llamado espejo de doble vía, entre otras denominaciones, o si optas por una opción más casera y económica, un simple cristal y un vinilo efecto espejo para ir en plan «maker» ya total. También existen otras posibilidades como utilizar cristales reflectantes como los típicos que se colocan en las fachadas de algunos edificios, por ejemplo. En todo caso, como esta es sin duda la parte más complicada de todo el proyecto, le dedicaremos un apartado específico dentro de este post.
¿Y sí lo complicamos un poco?
Lo anterior sería lo básico y más que suficiente para montar tu Magic Mirror en condiciones pero ¿qué maker que se precie se conforma con lo justo? ¡Uf! una vez comiences y si eres una persona curiosa, probablemente querrás experimentar con otras funciones y dotar a tu nuevo espejo de infinidad de «trucos mágicos» que te servirán para quedar como un campeón cuando vayan tus amigos y amigas a tu casa y les quieras dar la tabarra con tu espejito. Así que, vamos a ver algunas cosillas que le he incorporado a mi proyecto:
Interruptor inalámbricoSONOFF (u otra marca, obviamente) para poder controlar el apagado y encendido de la pantalla de forma sencilla. Como muchos otros dispositivos SONOFF, este interruptor funciona con la App EweLink (también disponible para IOs) además de integrarse perfectamente con Alexa y Google Home. Ello te permitirá programar el apagado y encendido del monitor (por aquello del Planeta y tal) o, simplemente, hacerlo funcionar con el comando de voz que le asignes en tu asistente. ¡Más «magia» para nuestro proyecto! En mi caso, además de instalarlo dentro de la estructura, lo tengo funcionando integrado con Alexa. Concretamente, este es el dispositivo que yo utilicé.
Interruptor Inhalámbrico Sonoff
Disco duro externo para almacenamiento. Pues así de simple. A mi proyecto le he añadido un simple disco duro externo extraído de un viejo portátil y que guardaba en un cajón desde hacía años. Obviamente, está conectado a la Raspberry y oculto tras el espejo. Esencialmente lo utilizó para almacenar mi música que oigo a través de los dispositivos Alexa de mi casa mediante la Skill My Media for Alexa a la que le dedicaré algún post más adelante. Más allá de esto y de realizar copias de seguridad periódicas de la propia configuración del Magic Mirror, no le doy otra función. Esencialmente es una forma de optimizar recursos y de, sobre todo, utilizar el espacio trasero del Magic Mirror para «esconder» algún cacharrillo que si no estaría por ahí ocupando espacio.
Sensores varios conectados mediante la GPIO de la Raspi. Obviamente, si el cerebro de todo el invento es una Raspberry, no es difícil intuir que tu Magic Mirror podrá mejorarse con sensores de todo tipo conectados a la GPIO que permitan mostrar o implementar funcionalidades que enriquezcan notablemente el proyecto. En mi caso y a la espera de nuevos pedidos, tengo instalados dos sensores interactuando con el software del espejo:
Sensor temperatura y humedad interior DHT22 funcionando con el módulo MMM-LocalTemperature aunque hay otros módulos también orientados a la inclusión de este tipo de sensores en nuestro proyecto (tranquilos que más adelante hablaremos con detalle del tema de los módulos, esenciales para que el «invento» funcione).
Y la que, modestamente, considero la «joya de la corona» de mi proyecto… el Sensor PAJ7620u2 (Grove Gesture) funcionando con el módulo MMM-GroveGesture. En mi caso, lo adquirí aquí. Algo caro (18,89 €) pero, lo puedo asegurar, merece la pena aparte de por venir ya soldado y preparado para «conectar», por las muchas posibilidades de interacción que ofrece para el control de tu Magic Mirror. En todo caso, existen otras alternativas más económicas que quizás te puedan funcionar a poco que controles algo de código y, quizás, soldadura. Por ejemplo, yo lo intenté previamente con este sensor aunque lo tuve que dejar por imposible y, finalmente, encargar el indicado. Si no te apañas bien soldando microchip, te sugiero que ni lo intentes. En el apartado dedicado a los módulos de terceros hablaré más detenidamente del sensor PAJ7620u2 y sus posibilidades.
Sensor temperatura y humedad DHT22
Sensor Grove Gesture PAJ7620u2
Construyendo el marco
Vista del Magic Mirror terminado
Detalle del marco y parte del interior
Tras todo lo anterior, es hora de ponernos manos a la obra. Dando por hecho que ya cuentas con todos los materiales necesarios (tranquilo que del cristal ya hablaremos, más adelante) y que, sobre todo, tienes clara la idea de lo que quieres hacer, toca demostrar que realmente eres un verdadero maker y no un simple friki que pasa sus tristes horas libres delante de la pantalla del ordenador. Es hora de ponerse serios, sacar las herramientas y ponernos a fabricar o reciclar la estructura (marco) que soportará todo el invento.
Existen infinidad de post en Internet que explican, paso a paso, como proceder al respecto, bien si quieres construir tu flamante marco desde cero o bien si optas por reciclar alguno que tengas a mano. Yo opté por la primera de las opciones, empleando para la tarea un buen puñado de listones de madera (de bastante buena calidad, por cierto) de un viejo somier que tenía arrinconado en el trastero. Las posibilidades son infinitas al respecto, tanto como tu imaginación. Lo que si es muy importante es que antes de ponerte a cortar tablas como un loco, tengas claro lo que quieres hacer, bien en tu cabeza, bien plasmado en algún boceto. Además, debes tener en cuenta que el marco que va alojar el Magic Mirror debe de tener algo de «fondo» para poder contener los dispositivos necesarios, también deberás considerar que las medidas del mismo dependerán en gran medida de las medidas del monitor o televisor que tengas previsto utilizar. Puedes optar porque el espejo se ajuste a esas medidas y que la información ocupe toda la superficie del cristal o bien, como ocurre en mi caso, puedes optar por un cristal y marco más grande que la propia pantalla que vayas a utilizar de forma que la información se muestre solo en una parte del Magic Mirror, quedando el resto como un simple espejo.
No me voy a detener expresamente en los detalles de la construcción del marco puesto que no soy experto en carpintería (ni en nada, me temo) y porque, como ya te indicaba, existen infinidad de muy buenos «tutos» para ello. Como muestra (encontrarás muchos más en Internet), aquí te dejo algunos de ellos que me sirvieron de inspiración para construir el marco de mi espejo:
Magic Mirror – The casing: En inglés. El propio Michael Teeuw nos orienta sobre la construcción del marco.
Building MirrorMirror: En inglés. Un tutorial completo sobre todo el proceso y también, por supuesto, para la construcción del marco. El marco de mi espejo sigue en gran medida lo aquí explicado.
Building the Frame: En inglés. Foro de la Comunidad Magic Mirror sobre la cuestión del marco.
Ya tengo el marco controlado… Vamos a por la pantalla
En este punto, deberíamos pensar en preparar nuestro monitor o televisor. Para ello es recomendable despojarlo (con cuidado) de la carcasa de plástico a fin de ahorrar espacio y evitar que la pantalla tenga demasiada profundidad dado que ello condicionaría el «fondo» que le vayamos a dar al marco donde colocaremos nuestro espejo. Al realizar esta operación, ten cuidado con no cargarte los controles para manejar el brillo y demás del monitor (si es lo que vas a utilizar) puesto que posteriormente te serán necesarios para controlar estos aspectos del mismo.
La pantalla «encajada» en el Magic Mirror
Aunque en Internet podrás encontrar algunos intentos al respecto, si pretendes reciclar la pantalla de una vieja tablet, portátil o, incluso, móvil (proyectos hay para todos los gustos) debes tener en cuenta que quizás no sea tan buena idea. Estos dispositivos, en principio al menos, puede que quizás cuenten con salida de vídeo (VGA, HDMI u otro tipo) pero en su inmensa mayoría, no cuentan con entrada que es lo que realmente necesitaremos para «proyectar» nuestro Magic Mirror desde la Raspberry en la pantalla escogida. En todo caso, si eres de los makers «voluntariosos» y un amante acérrimo del reciclaje, lo puedes intentar pero debes saber que, con toda probabilidad, necesitarás adquirir una «controladora de vídeo» adecuada para el modelo de tu dispositivo a fin de poder transmitir la imagen desde la Raspi hasta tu flamante y reciclada pantalla. Buscando en Internet encontrarás la información necesaria para ello. Todo un reto que, desde luego, yo preferí ahorrarme, por supuesto.
El problema del cristal
Y digo problema porque, sin duda, es la parte más delicada de todo el proyecto y no lo digo porque se pueda romper (que también aunque espero que no seas tan «manazas») sino por la dificultad existente para conseguir un espejo de doble vía, además de por el notable precio que suelen tener los mismos. En todo caso, siempre nos quedan alternativas viables para conseguir que nuestro proyecto «cristalice» y evitar quedarnos en el camino.
En esencia, lo que necesitamos (bien comprado, bien «fabricado») es un espejo que por una parte haga, más o menos, su función (sería la cara que, obviamente, colocaríamos hacia afuera en nuestro Magic Mirror) y que por la otra permita que pase la luz de la pantalla que vayamos a utilizar. El resto de la superficie trasera del espejo que no esté ocupada con el monitor o TV, deberemos «opacarla» totalmente a fin de evitar que se filtre ninguna luz a través del cristal, más allá de la que proyecta nuestra pantalla con la información que deseemos mostrar. Para este cometido, yo simplemente utilicé algo tan sencillo como cartulina negra y cinta aislante mate de electricidad.
Al respecto y de forma resumida, son varias las opciones existentes para solventar el tema del cristal:
Espejo espía o de doble vía: Esta, sin ningún lugar a dudas, sería la mejor opción en cuanto a resultados (y también la más cara con diferencia). Sin embargo, el problema fundamental reside, además de en el precio, en que no es nada fácil encontrar este tipo de material al menos en España. Probablemente, tu primer impulso sea acercarte a la cristalería del barrio y preguntarle al paisano de turno sobre la cuestión. No está de más hacerlo pero, con mucha probabilidad, el amigo te mirará con cara extraña y no será capaz de solventarte el problema. Ello no significa, por supuesto, que no puedan existir cristalerías patrias que suministren este tipo de productos pero, desde luego no es tarea fácil. Respecto a la opción de adquirirlo por Internet, tampoco es cuestión sencilla, al menos desde Canarias que es donde resido, puesto que, por ejemplo, Amazon -donde he visto que se ofertan- no envía (como otros tantos) este tipo de materiales al archipiélago. Por lo que he averiguado al respecto, existe la posibilidad de encargar online tu espejo espía a algún proveedor extrajero. Por ejemplo, allá por Alemania (creo) hay un tipo que se encarga de gestionarte tu pedido y remitírtelo a tu domicilio, eso sí, a un precio realmente notable. Me consta que algún compañero interesado en este mundillo ha optado por esta vía, con muy buen resultado. Por si te interesara, aquí encontrarás información al respecto si es que el amigo sigue en el «negocio». Igualmente, aquí te dejo una lista de proveedores en la que, como podrás comprobar, no figura ninguno de España.
Cristales «efecto espejo» para ventanas y fachadas: Muy utilizados en arquitectura, son fáciles de encontrar en cristalerías grandes. Los hay de diverso tipo, calidades y marcas y, en general, ofrecen un resultado óptimo aunque tienden a mostrar un reflejo notablemente oscurecido (pura cuestión de ciencia física en la que no nos detendremos). Por contra, cuentan a su favor con su moderado coste y la facilidad para encontrarlos. Acércate a una buena cristalería y pregunta si estás interesado en esta opción.
Vinilo efecto espejo: Finalmente, la opción más asequible aunque, probablemente, la que peores resultados ofrezca en cuanto a calidad del reflejo ofrecido por nuestro Magic Mirror, es utilizar un vinilo «efecto espejo» para adherirlo al cristal (en este caso, un cristal normal) que utilicemos para nuestro «invento». Esta, finalmente, es la alternativa por la que opte en la construcción de mi Magic Mirror. Te adelanto que si bien es la opción más asequible y viable, deberás armarte de paciencia porque la instalación del vinilo no es nada sencilla (a menos que no te importe que tu espejo se vea lleno de burbujas y rayones de todo tipo, claro). En mi caso, opté por la compra online de este producto que, sin duda, es uno de lo de mejor calidad que puedes encontrar en el mercado. En todo caso, te recomiendo encarecidamente que compres más metros de los que en principio piensas que vas a necesitar puesto que es probable que una buena parte la desperdicies haciendo pruebas hasta obtener el resultado deseado (un espejo más o menos en condiciones). En el anterior enlace también encontrarás este vídeo (en español) que te explica como realizar la delicada operación de colocación del vinilo. Aunque en el vídeo parece muy fácil, te aseguro por experiencia que no lo es.
Para ir finalizando este apartado, recomendarte que bien adquieras un espejo de doble vía o bien un simple cristal transparente para incorporarle un vinilo, el mismo deberá tener un grosor mínimo de 4 mm o más a fin de que soporte correctamente la presión de los dispositivos a colocar detrás del mismo al tiempo que evitar peligrosas roturas a la hora de manejarlo. Cierto es que a mayor grosor, más oscuro será el efecto «espejo» conseguido pero la seguridad ante todo.
También, me consta, que hay gente que ha sustituido el cristal por metacrilato u otros materiales. Hago referencia a ello pero no entro en detalles dado que no llegué a experimentar al respecto.
Configurando nuestro Magic Mirror
Toca el momento de entrar en la parte del Software, tanto de la Raspberry como del Magic Mirror propiamente. Evidentemente, podríamos haber comenzado nuestro proyecto (y quizás sería lo más recomendable) por esta parte más de “código” y “consola” y no por los aspectos más “manuales” abordados anteriormente pero, en cualquier caso, esto ya es cuestión de gustos y de lo que tengas a mano. En definitiva, si tienes la madera pues puedes comenzar por el marco y si lo que tienes es una Raspberry olvidada, cogiendo polvo en algún cajón, pues empieza por aquí. La cuestión es comenzar e irte ilusionando con el proyecto sin necesidad de esperar a contar con todos los elementos necesarios para su desarrollo.
Poniendo «en marcha» nuestra Raspberry
Como comentaba anteriormente, en mi caso he utilizado una Raspberry 3B+ con Raspbian pero puedes utilizar otros modelos de Raspi sin problemas. Información para ello encontrarás sobradamente en Internet.
Raspberry PI 3B+
Doy por hecho que tienes algún conocimiento sobre como “echar a andar” tu Raspberry pero ante la duda lo mejor es tirar de la gente que realmente sabe de estas cosas y seguir sus pasos y recomendaciones, punto por punto. En este sentido y como poco podría yo añadir a lo que otros ya han escrito como mucho más conocimiento de causa, aquí te dejo los enlaces necesarios para que puedas configurar adecuadamente tu miniordenador:
Setting up your Raspberry Pi. En inglés. Nada mejor que acudir a la Fundación Raspberry para aprender a poner en marcha nuestro dispositivo.
Es importante considerar que aunque en los enlaces anteriores podrás encontrar otras alternativas, es recomendable que instales el sistema operativo “oficial” de Raspberry (Raspbian) a fin de poder desarrollar nuestro proyecto de Magic Mirror. Para que no haya dudas al respecto, en este enlace encontrarás los archivos necesarios. Tenlo en cuenta si, como es habitual, utilizas Noobs (una herramienta de instalación rápida con diferentes sistemas operativos a escoger) a la hora de configurar tu Raspberry.
Finalmente y como comprobarás rápidamente, es precisamente en este momento cuando vas a necesitar echar mano del teclado y ratón que mencionamos entre lo “necesario”, al comienzo de este tutorial, para poder configurar tu Raspberry.
Señalar que dado que la Raspberry va a estar oculta tras el espejo junto con otros dispositivos que, obviamente, generarán calor, es importante garantizar su adecuada ventilación para evitar “calentones” innecesarios. Bastará con garantizar algunos agujeros de ventilación en el marco y dotar a nuestro micrordenador de los típicos disipadores de temperatura y algún pequeño ventilador.
Instalando y configurando el Magic Mirror
¡Y llegó el gran momento! Por fin vamos a comenzar con la instalación del software necesario para que nuestro Magic Mirror cobre vida.
Una vez tengamos configurado adecuadamente Raspbian en nuestra Raspberry, es el momento de instalar los paquetes necesarios para nuestro Magic Mirror. Lo más recomendable, como siempre, es acudir a la fuente original y seguir, paso a paso, las instrucciones indicadas. Al respecto, aquí te dejo los enlaces necesarios donde encontrarás toda la información para proceder correctamente:
Foro Raspberry sobre Magic Mirror. En español. Siempre es una buena idea darse una vueltita por los muchos foros existentes en la comunidad Magic Mirror para aclarar las dudas que nos puedan surgir.
Configurando los módulos de nuestro Magic Mirror
Una de las características, en mi opinión, más interesantes del Magic Mirror es su carácter modular. Es decir, una vez instalado el paquete básico que ya viene con unos módulos por defecto, se abre un inmenso abanico de posibilidades para instalar infinidad de módulos de terceros desarrollados por la activa comunidad existente en torno a este tipo de proyectos.
La mayoría de los módulos (no siempre) indican como realizar la instalación que siempre suele ser similar. En esencia, consiste en clonar vía consola el repositorio que corresponda al módulo escogido dentro del directorio “/home/pi/MagicMirror/modules/” que, si todo ha ido bien, deberías encontrar en la ruta indicada. Además, es posible que en algún caso se te solicite instalar determinadas dependencias, todo ello a través de tu terminal. Una vez realizado este proceso, deberás editar el archivo “config.js” que encontrarás en la ruta “/home/pi/MagicMirror/config/” para incluir en el mismo la configuración básica del módulo así como escoger entre las diferentes opciones de que te proponga el autor/a del mismo.
Sin duda, la configuración del archivo “config.js” puede ser la parte más tediosa y delicada del asunto puesto que ya entramos en terreno de “códigos” lo cual para alguien como yo, poco ducho en la materia, obviamente es lo más complicado. Si controlas sobre estos temas y estás acostumbrado a trastear con distribuciones linux, será pan comido, y si, como es mi caso, no es así, pues ármate de paciencia y, sobre todo, no olvides realizar siempre una copia de seguridad del archivo “config.js” antes de introducir ninguna modificación en el mismo.
De todas formas, no es difícil “cogerle el truco”, especialmente si sigues los ejemplos de configuración básica inicial que encontrarás en la propia documentación de instalación del software. Es muy importante que prestes mucha atención a la sintaxis del archivo “config.js” porque cualquier pequeño error puede impedir que tu Magic Mirror cargue correctamente. En todo caso, si después de cualquier cambio en la configuración, el espejo no arranca adecuadamente, fíjate en la línea de error que te mostrará la consola para poder solucionarlo.
Igualmente, si te lo exige la configuración del módulo (no es lo habitual) o si simplemente deseas experimentar al respecto, también podrás realizar modificaciones en la configuración de estilos a través de del archivo genérico de configuración “custom.css” que deberías encontrar en “/home/pi/MagicMirror/css/” así como de los diferentes “nombrearchivo.css” de cada módulo que encontrarás en sus correspondientes directorios. Sea como sea, vaya por delante mi recomendación de manejar estos archivos con “prudencia” y siempre realizar copias de seguridad antes de meterte a “trastear” con los códigos. ¡Avisado quedas!
Instalando módulos de terceros
Quizás, la parte más “divertida” de todo el proyecto. Existen infinidad de módulos desarrollados por la comunidad que son los que realmente, una vez instalados los “default modules”, van a darle vida y personalidad a tu Magic Mirror.
Recuerda que los “default modules” con los que contarás en la instalación inicial, también aceptan modificaciones de configuración. Por si te sirve de idea y entre otras modificaciones que he introducido en los módulos por defecto, en mi caso, los mensajes del módulo “Compliments” están adaptados a la previsión del tiempo así como a la hora del día. Es decir, aparte de algunos genéricos, los consejos ofrecidos dependerán de la climatología y del momento del día. Igualmente, el modulo “Calendar” en mi caso lo utilizo para conocer la previsión de las mareas de la Playa de mi ciudad así como la hora de salida y puesta del Sol. Por su parte, el módulo NewFeeds lo tengo “duplicado”, mostrándose en uno noticias de mi zona y en otro noticias internacionales.
Entrando propiamente en los “modulos de terceros”, en esencia, existen dos repositorios fundamentales para buscar y probar módulos de terceros. Ambos los encontrarás en GitHub. Aquí tienes los enlaces:
3rd Party Modules. El listado de módulos por excelencia, ordenados por temáticas. La mayoría están “operativos” pero también es frecuente encontrar algunos “abandonados”. Todo es cuestión de ir probando.
Legacy Modules. Listado de módulos ordenados alfabéticamente. En ocasiones encontrarás, básicamente, los mismos o versiones previas de los ya existentes en el listado anterior. También aquí podrás encontrar módulos interesantes y totalmente operativos.
Modulos de terceros instalados en mi proyecto
Durante estos meses dedicados a la construcción del Magic Mirror he probado infinidad de módulos (no todos los existentes, ni mucho menos, por supuesto) hasta al final quedarme con la selección que relacionaré a continuación. Por supuesto, esto es absolutamente arbitrario y los módulos a instalar dependerán exclusivamente de tus necesidades, gustos y preferencias. Todos los módulos indicados, los encontrarás en los enlaces anteriores, especialmente en el primero de ellos (3rd Party Modules.).
Dado que, como indico, esta es una cuestión muy personal, me limitaré simplemente a mencionar los módulos que tengo actualmente instalados (nunca se sabe lo que pasará mañana) y comentaré algún aspecto que pueda considerar de interés sobre los mismos:
MMM-pages. Fundamental si piensas instalar muchos módulos. Te permite organizar los mismos en diferentes páginas. Existen otras alternativas interesantes para conseguir algo parecido como puede ser MMM-Carousel que te permite “alternar” entre módulos.
MMM-UVIndex. Módulo que me informa sobre la intensidad de los Rayos UVA en mi localidad.
MMM-AirQuality. Me indica la calidad del aire en mi localidad.
MMM-Tools. Imprescindible para conocer como va tu “Raspi”. Uso CPU, RAM, temperatura y demás…
MMM-Buller. La solución que utilizo (muy útil para mi) para visualizar mis tareas de Google Task en el espejo.
MMM-CalendarExt2. Algo complicado de configurar pero muy versátil. Una alternativa muy completa al calendario por defecto.
MMM-DarkSkyForecast. Uno de los tantos módulos sobre el tiempo que hay disponibles. Muy atractivo visualmente y fácil de configurar.
MMM-TouchPlayerBasic. Un reproductor de música tan sencillo como poco útil. En esencia, una curiosidad.
MMM-network-signal. Pues eso mismo.
MMM-GoogleFit. Un módulo muy curioso aunque algo limitado que te permite visualizar tu actividad sincronizado con Google Fit.
MMM-GoogleFit2. Lo mismo pero para una segunda persona.
MMM-BackgroundSlideshow. Permite colocar una serie de imágenes de fondo (ocupando toda la pantalla) y rotar automáticamente entre las mismas.
MMM-SimpleLogo. Pues eso. Una forma fácil de colocar alguna imagen concreta en cualquier espacio.
MMM-NewsFeedTicker. Un módulo muy “chulo” aunque mejorable. Puedes configurar fuentes de noticias que irán pasando en un franja (lo típicos de los informativos).
MMM-Widget. Te permite insertar en tu Magic Mirror cualquier tipo de Widget. En mi caso, tengo insertados tres dedicados a mi equipo de fútbol predilecto.
MMM-LocalTemperature. Vinculado con el sensor DHT22 que comentábamos con anterioridad. Me permite conocer la temperatura y humedad interior.
MMM-TelegramBot. Muy interesante. Te permite cierto control sobre tu Magic Mirror a través, obviamente, de Telegram.
MMM-Cursor. Un simple cursor de ratón útil cuando el espejito se pone rebelde o quieres realizar alguna operación sencilla. Obviamente, tienes que contar con un ratón inhalámbrico conectado a tu Magic Mirror.
MMM-GroveGestures. También algo ya comentamos en la anterior entrega. Vinculado con el sensor Sensor PAJ7620u2 (Grove Gesture) permite controlar el espejo mediante gestos. Sin duda, una alternativa muy interesante sobre cuyas posibilidades ya has podido visualizar una pequeña demostración en este vídeo ya publicado en este mismo tutorial. Dado el interés que entiendo puede despertar este módulo, le dedicaremos un apartado especial más adelante.
MMM-page-indicator. Nos indica, mediante un circulito situado en la parte inferior de cada página, el número de páginas de tu Magic Mirror y en cual estás. No tiene más función.
MMM-ImageSlideshow. Permite insertar una imagen de forma simple. Lo utilizo para un pequeño “menú” recordatorio de los gestos que utilizo y que tengo fijado en la parte inferior de todas las páginas.
MMM-MotionDetector. Entre otras funciones, te puede servir para programar el encendido y apagado de la pantalla en función del movimiento detectado por una cámara. Aunque funcionaba perfectamente, en estos momentos lo he desactivado y he retirado la cámara del Magic Mirror por simples razones de seguridad. La cuestión del encendido y apagado de la pantalla lo he solucionado finalmente con el interruptor inhalámbrico SONOFF ya mencionado en la anterior entrega y con el MMM-GroveGestures que ofrece una opción al respecto mediante gestos.
MMM-GooglePhotos. Obviamente, un módulo que te permite visualizar tus álbumes de fotos de Google Photos. Funciona sin problemas aunque en estos momentos lo tengo desactivado dado que tengo la impresión de que consume excesivos recursos y me ralentiza todo el sistema por no decir que directamente lo “tumba”.
¿En qué áreas de la pantalla coloco mis modulos?
Pues no es una cuestión menor esta, especialmente cuando comiences a acumular módulos y más módulos y el espacio “disponible” se vaya acabando. Como ya he indicado, existen soluciones si tu intención es llenar el Magic de módulos pero también es relevante conocer las distintas “áreas” o “regiones” donde puedes ubicar la información a mostrar por tus módulos. La mayoría de ellos te indicarán cual es la mejor área para ubicarlos aunque, en muchas ocasiones, solo sera una recomendación opcional (no en algunos módulos que “solo” te funcionarán correctamente en la ubicación que su autor/a te indique). Para todo ello a mi me resultó de mucha utilidad esta sencilla explicación gráfica sobre las diferentes áreas útiles de tu Magic Mirror a la hora de organizar los módulos:
Y aquí la explicación de los códigos de colores anteriores:
top_bar and bottom_bar are light gray.
top_left and bottom_left are red.
top_center and bottom_center are blue
top_right and bottom_right are green
upper_third is yellow
middle_center is cyan
lower_third is magenta
Y como de “bien nacidos es ser agradecidos”, aquí les dejo enlace original de donde obtuve la información anterior.
Algo más sobre el MMM-GroveGestures
Buscando un sistema para interactuar con mi Magic Mirror, más allá del control por voz que no me motivaba especialmente al haber ya experimentado mucho con los dispositivos Alexa y Google Home y no resultarme especialmente novedoso, me topé con el módulo MMM_GroveGestures. Mediante el mismo y contando con el ya mencionado sensor PAJ7620u2 (Grove Gesture) conectado a nuestra Raspberry a través, obviamente, de los pines adecuados de la GPIO, es posible controlar tu Magic Mirror mediante gestos desde una distancia máxima (aproximadamente) de unos 20 cm. Ofrece por defecto nueve gestos diferentes (UP, DOWN, LEFT, RIGHT, FORWARD, BACKWARD, CLOCKWISE, ANTI-CLOCKWISE Y WAVE) pero, además, permite realizar combinaciones de dos, tres o más movimientos con ellos lo cual multiplica exponencialmente las posibilidades. Lógicamente, si creas muchas “combinaciones de gestos”, además de poner a prueba tu memoria, también incrementarás las posibilidades de error a la hora de ejecutar los mismos ya que la sensibilidad del sensor es bastante notable.
Este sistema te posibilitará no solo enviar notificaciones a tu Magic Mirror y a aquellos módulos que acepten tal funcionalidad sino también y esto me parece muy relevante, ejecutar comandos con tu Raspberry como si estuvieras trabajando con la consola.
Por ejemplo, en mi caso tengo una serie de gestos vinculados al programa “mpg123” lo que me permite escuchar música desde el disco duro externo integrado en el espejo (una Playlist previamente configurada para ser concretos) así como subir y bajar el volumen, entre otras funciones. Aunque evidentemente resultaría fácil integrar unos simples altavoces en el Magic, en este momento y hasta que encuentre los adecuados, utilizo un altavoz externo conectado por bluetooth o cable, según esté de humor.
Como ya he comentado y entre otras posibilidades, también podrás utilizar el sensor para activar tu pantalla o, pasado el tiempo que especifiques sin recibir ningún gesto, conseguir que se apague automáticamente. En definitiva, múltiples opciones que te animo a explorar.
Montaje final del Magic Mirror
Obviamente, en algún momento, tendremos que realizar el “montaje” de todo el invento. Es decir, colocar nuestra Raspberry, pantalla y demás elementos dentro de la estructura que hayamos fabricado para nuestro Magic Mirror. Dado que las posibilidades al respecto son infinitas y dependerá en gran medida de nuestras preferencias y objetivos, me limito a compartir algunas imágenes de las “tripas” de mi Magic Mirror que espero sean de utilidad para proceder al montaje final del mismo:
¿Y hay más?
Pues sí. Hay mucho más pero, de momento, hasta aquí he llegado y creo que tampoco seguiré profundizando mucho más en la cuestión dado que estoy relativamente satisfecho con el resultado final de mi proyecto, aunque esté feo que yo lo diga.
Solo como apunte, y a modo ejemplo de otras posibilidades existentes, no me olvido de la implementación del proyecto con control por voz (tanto con Alexa como Google Home), para lo cual existen numerosas opciones de módulos, o algo que a mi me parece incluso más interesante al tiempo que complejo, como es el reconocimiento facial y las posibilidades de respuesta personalizada del Magic Mirror que ello ofrece. En los enlaces a los módulos de terceros encontrarás también propuestas al respecto.
¿Qué será lo próximo?
Como decía casi al principio del post, cuando empiezas es realmente difícil parar con este tipo de proyectos dada la cantidad de posibilidades que ofrece. Aunque ya he dado el Magic Mirror “oficialmente” por terminado, no es menos cierto que estoy pendiente de recibir un sensor PIR y un interruptor giratorio KY-040 por aquello de seguir “experimentando” aunque, sinceramente, no se si me quedarán pines libres en la GPIO para seguir conectando chismes a la Raspberry.
Looking for projects to mess with my first Raspberry, I came to the world of Magic Mirror. Since then and after a few months of learning and hundreds of tests and trials, I have completed my first «Magic Mirror» which, despite being very happy with the final result, I consider only a first prototype prior to major challenges to be faced in the future .
In essence, a Magic Mirror is nothing more than a (magical?) Mirror that, in addition to performing its function -more or less- as such, allows to display information of very different types with a wide range of configuration possibilities. Although something already existed previously, the popularity of these devices, which respond to the DIY (Do it Yourself) philosophy, is due to Michael Teeuw and the enormous and active community of makers existing around the world of the Magic Mirror.
The «magic» is produced by a series of devices -with special reference to the irreplaceable Raspberry- that, cleverly camouflaged behind the glass, allow the desired effect to be achieved, combined with powerful modular software that allows you to experiment with infinite functionalities.
It goes without saying that few original contributions are in the «prototype» that I am going to comment on in this post (although some own contribution may be found). In essence, it is a compilation of information and work from other people (especially as regards the installed modules) that I greatly appreciate that they have made their knowledge and wisdom publicy available via the network. To all the makers of the world… Thank you very much!
In this tutorial, I will not dwell in too much detail on the mirror construction or configuration process itself, but essentially what I intend to convey are my experiences in this regard as well as the end result. In any case, you will always find throughout this post a compilation of the necessary links to start your «magical journey».
Let’s go babe!
Turn up the volume! My Magic Mirror finished (for now).
What do we need?
Well, in addition to your desire, to develop a project similar (or surely improved) to the one explained in this tutorial, a few little things, although nothing difficult to get or especially expensive:
Raspberry Pi with a clean install of Raspbian. In my case I used a Raspberry 3B+ although I know that other models can be used, including the Zero and the brand new Raspberry Pi 4.
Quality MicroSD card . In my case, I use a 32 GB SanDisk but it is feasible to use a smaller capacity.
Television or computer monitor of the size you want depending on the type of Magic Mirror you have in mind. (I used a 24-inch waste monitor – or so I think – purchased from a thrift store for € 5.).
VGA-HDMI adapter . In my case, since my old monitor did not have the necessary HDMI input to connect it to the Raspberry. Specifically, I am referring to something like the image and that, in my case, I acquired here .
HDMI to VGA adapter
HDMI cable . The shorter the better for saving space in the «back room».
Wireless and usb keyboard and mouse. Required only for the initial configuration of the Raspberry. Then you can do without them.
A reusable frame to build the structure that must support the mirror or the wood necessary for it . After several tests, this second one was the option that I chose.
Some knowledge of English. As always happens in the DIY world, as you want to delve into any project, the Spanish pages are falling short and sooner rather than later, you will need to consult English pages. Even so, you should not worry excessively since on the Internet you will also find enough information in Spanish to cope. So if you don’t control Shakespeare’s language, it shouldn’t be a reason to be discouraged either. Also … You always have the Google Translate!
And the essence of the «invention», a spy mirror, also called a two-way mirror , among other denominations, or if you opt for a more homemade and economic option, a simple glass and a mirror-effect vinyl to go as a «maker» plan now total. There are also other possibilities such as using reflective glass like the typical ones that are placed on the facades of some buildings, for example. In any case, as this is undoubtedly the most complicated part of the entire project, we will dedicate a specific section within this post.
What if we complicate it a bit?
The above would be the basics and more than enough to mount your Magic Mirror in conditions but what self-respecting maker settles for the right thing? Phew! once you start and if you are a curious person, you will probably want to experiment with other functions and provide your new mirror with infinity of «magic tricks» that will serve to make you look like a champion when your friends go to your house and want to pester them with your mirror. So, let’s see some things that I have incorporated into my project:
SONOFF wireless switch (or other brand, obviously) to control the on and off of the screen easily. Like many other SONOFF devices, this switch works with the EweLink App (also available for IOs) as well as seamlessly integrating with Alexa and Google Home. This will allow you to program the monitor on and off (for that of the Planet and such) or, simply, make it work with the voice command that you assign in your assistant. More «magic» for our project! In my case, in addition to installing it inside the structure, I have it working integrated with Alexa. Specifically, this is the device that I used .
Sonoff Wireless Switch
External hard drive for storage. Well, it’s that simple. To my project I have added a simple external hard drive removed from an old laptop and kept in a drawer for years. Obviously, it is connected to the Raspberry and hidden behind the mirror. Essentially he used it to store my music that I hear through the Alexa devices of my house through the Skill My Media for Alexa to which I will dedicate a post later. Beyond this and making regular backups of the Magic Mirror’s own settings, I give it no other function. Essentially it is a way of optimizing resources and, above all, using the rear space of the Magic Mirror to “hide” some gadget that would otherwise be taking up space.
Various sensors connected by the Raspi GPIO . Obviously, if the brain of the whole invention is a Raspberry, it is not difficult to intuit that your Magic Mirror can be improved with all kinds of sensors connected to the GPIO that allow showing or implementing functionalities that greatly enrich the project. In my case and waiting for new orders, I have installed two sensors interacting with the mirror software:
DHT22 indoor temperature and humidity sensor working with the MMM-LocalTemperature module although there are other modules also aimed at the inclusion of this type of sensors in our project (rest assuredthat later we will talk in detail about the modules, essential for the “invention ”Works).
And the one that, modestly, I consider the «jewel in the crown» of my project … the Sensor PAJ7620u2 (Grove Gesture) working with the MMM-GroveGesture module . In my case, I got it here. Something expensive (€ 18.89) but, I can assure you, it is worth it apart from coming already welded and ready to “connect”, due to the many possibilities of interaction it offers to control your Magic Mirror. In any case, there are other cheaper alternatives that perhaps can work for you after you control some code and, perhaps, solder. For example, I previously tried this sensor although I had to leave it as impossible and finally order the right one. If you don’t do well by microchipping, I suggest you don’t even try. In the section dedicated to third-party modules I will talk more about the PAJ7620u2 sensor and its possibilities.
DHT22 temperature and humidity sensor
Grove Gesture PAJ7620u2 Sensor
Building the framework
After all of the above, it is time to get down to business. Taking for granted that you already have all the necessary materials (rest assured that we will talk about glass later on) and that, above all, you have a clear idea of what you want to do, it’s time to show that you really are a true maker and not just a simple one geek who spends his sad free hours in front of the computer screen. It is time to get serious, take out the tools and start manufacturing or recycling the structure (frame) that will support the entire invention.
There are countless posts on the Internet that explain, step by step, how to proceed in this regard, either if you want to build your brand new frame from scratch or if you choose to recycle one that you have on hand. I opted for the first option, using for the task a good handful of wooden slats (of a fairly good quality, by the way) from an old bed base that had been cornered in the storage room. The possibilities are endless in this regard, as much as your imagination. What is very important is that before you start cutting boards like crazy, be clear about what you want to do, well in your head, well reflected in some sketch. In addition, you should bear in mind that the frame that will house the Magic Mirror must have some «background» to be able to contain the necessary devices, You should also consider that the measurements of the same will largely depend on the measurements of the monitor or television that you plan to use. You can choose to have the mirror adjust to those measurements and that the information covers the entire surface of the glass, or, as in my case, you can choose a glass and frame larger than the screen you are going to use so that the information is displayed only in one part of the Magic Mirror, leaving the rest as a simple mirror.
I am not going to stop expressly in the details of the construction of the frame since I am not an expert in carpentry (or anything, I’m afraid) and because, as I already indicated, there are infinite number of very good «tutos» for it. As a sample (you will find many more on the Internet), here are some of them that inspired me to build my mirror frame:
Magic Mirror – The casing : In English. Michael Teeuw himself guides us on the construction of the frame.
Building MirrorMirror: In English. A complete tutorial on the whole process and also, of course, for the construction of the frame. The frame of my mirror largely follows what is explained here.
Building the Frame: In English. Magic Mirror Community Forum on the framework issue.
Magic Mirror using an IKEA RIBBA framework: In English. Within the possibilities, you can also recycle a frame that you already have around or that you acquire for the occasion.
I already have the frame controlled… Let’s go to the screen
At this point, we should think about preparing our monitor or television. For this, it is advisable to strip it (carefully) of the plastic casing in order to save space and avoid that the screen has too much depth since this would condition the “background” that we are going to give to the frame where we will place our mirror. When performing this operation, be careful not to overload the controls to manage the brightness and other of the monitor (if it is what you are going to use) since they will later be necessary to control these aspects of it.
The screen «embedded» in the Magic Mirror
Although on the Internet you can find some attempts in this regard, if you intend to recycle the screen of an old tablet, laptop or even mobile (there are projects for all tastes) you should bear in mind that it may not be such a good idea. These devices, in principle at least, may perhaps have video output (VGA, HDMI or other) but in the vast majority, they do not have an input which is what we will really need to «project» our Magic Mirror from the Raspberry on the chosen screen. In any case, if you are one of the “willing” makers and a staunch lover of recycling, you can try it, but you should know that, in all probability, you will need to purchase a suitable “video controller” for the model of your device in order to be able to transmit the image from the Raspi to your brand new and recycled screen. Searching the Internet you will find the necessary information for it. A challenge that, of course, I preferred to save myself, of course.
The glass problem
And I say problem because, without a doubt, it is the most delicate part of the whole project and I am not saying it because it can break (which also, although I hope you are not so “big”) but because of the difficulty in obtaining a double-track mirror. , in addition to the remarkable price that they usually have. In any case, we always have viable alternatives to ensure that our project «crystallizes» and avoid staying on the road.
In essence, what we need (well bought, well «manufactured») is a mirror that on the one hand does, more or less, its function (it would be the face that, obviously, we would place outwards in our Magic Mirror) and that on the another allows the light of the screen that we are going to use to pass. The rest of the rear surface of the mirror that is not occupied with the monitor or TV, we must «opaque» it completely in order to avoid any light filtering through the glass, beyond that projected by our screen with the information we want to show. For this purpose, I simply used something as simple as black cardboard and matte electrical tape.
In this regard and in summary, there are several options available to resolve the issue of glass:
Spy or double track mirror: This, without a doubt, would be the best option in terms of results (and also the most expensive by far). However, the fundamental problem lies, in addition to the price, in that it is not at all easy to find this type of material at least in Spain. Probably your first impulse is to go to the neighborhood glassware and ask the countryman on duty about the matter. It does not hurt to do it but, in all probability, the friend will look at you with a strange face and will not be able to solve the problem. This does not mean, of course, that there can be no national glassware that supplies this type of product, but, of course, it is not an easy task. Regarding the option of acquiring it on the Internet, it is not an easy matter, at least from the Canary Islands, which is where I reside, since, for example, Amazon – where I have seen that they are offered – does not send (like many others) this type of materials to the archipelago. From what I have found out about it, there is the possibility of ordering your spy mirror online from a foreign supplier. For example, back in Germany (I think) there is a guy who is in charge of managing your order and sending it to your home, yes, at a really remarkable price. I know that a colleague interested in this world has opted for this route, with very good results. In case you were interested, at a really remarkable price. I know that a colleague interested in this world has opted for this route, with very good results. In case you were interested, at a really remarkable price. I know that a colleague interested in this world has opted for this route, with very good results. In case you were interested, here you will find information about it if the friend is still in the «business». Likewise, here I leave you a list of providers in which, as you can see, none of Spain is listed.
«Mirror effect» glass for windows and facades: Widely used in architecture, they are easy to find in large glassware. There are different types, qualities and brands and, in general, they offer an optimal result although they tend to show a remarkably obscured reflection (purely a matter of physical science in which we will not stop). On the contrary, they count in their favor with their moderate cost and the ease of finding them. Come to a good glassware and ask if you are interested in this option.
Mirror effect vinyl: Finally, the most affordable option, although probably the one with the worst results in terms of the quality of the reflection offered by our Magic Mirror, is to use a «mirror effect» vinyl to adhere it to the glass (in this case, a glass normal) that we use for our “invention”. This, finally, is the alternative that I chose in the construction of my Magic Mirror. I anticipate that although it is the most affordable and viable option, you must arm yourself with patience because the installation of the vinyl is not easy (unless you do not mind that your mirror is full of bubbles and scratches of all kinds, of course). In my case, I opted for the online purchase of this product which, without a doubt, is one of the best quality you can find on the market. In any case, I highly recommend that you buy more meters than you initially think you will need, since it is likely that a good part will be wasted testing to obtain the desired result (a mirror more or less in condition). In the previous link you will also find this video (in Spanish) that explains how to perform the delicate operation of placing the vinyl. Although in the video it seems very easy, I assure you from experience that it is not.
To finish this section, we recommend that you either acquire a double-track mirror or a simple transparent glass to incorporate a vinyl, it must have a minimum thickness of 4 mm or more in order to properly support the pressure of the devices to place behind it while avoiding dangerous breakages when handling it. It is true that the greater the thickness, the darker the “mirror” effect achieved, but safety above all.
To finish this section, we recommend that you either acquire a double-track mirror or a simple transparent glass to incorporate a vinyl, it must have a minimum thickness of 4 mm or more in order to properly support the pressure of the devices to place behind it while avoiding dangerous breakages when handling it. It is true that the greater the thickness, the darker the “mirror” effect achieved, but safety above all.
Also, I am aware that there are people who have replaced glass with methacrylate or other materials. I refer to it but I do not go into details since I did not get to experiment on it.
Setting up our Magic Mirror
It touches the moment of entering the Software part, both of the Raspberry and of the Magic Mirror itself. Obviously, we could have started our project (and perhaps it would be the most recommended) for this more part of «code» and «console» and not for the more «manual» aspects discussed above but, in any case, this is already a matter of taste and what you have on hand. In short, if you have the wood, you can start with the frame and if what you have is a forgotten Raspberry, picking up dust in a drawer, it starts here. The question is to start and get excited about the project without waiting to have all the necessary elements for its development.
Launching our Raspberry
As I mentioned before, in my case I have used a Raspberry 3B + with Raspbian but you can use other Raspi models without problems. You will find information for this on the Internet.
Raspberry PI 3B +
I assume that you have some knowledge on how to «get started» your Raspberry but when in doubt the best thing is to pull people who really know about these things and follow their steps and recommendations, point by point. In this sense and how little could I add to what others have already written as much more knowledge of cause, here I leave you the necessary links so that you can properly configure your minicomputer:
Setting up your Raspberry Pi . In English. Nothing better than going to the Raspberry Foundation to learn how to start up our device.
It is important to consider that although in the previous links you can find other alternatives, it is recommended that you install the «official» Raspberry (Raspbian) operating system in order to develop our Magic Mirror project. So there is no doubt about it, in this link you will find the necessary files. Keep this in mind if, as usual, you use Noobs (a quick installation tool with different operating systems to choose from) when configuring your Raspberry.
Finally and as you will quickly see, it is precisely at this moment when you are going to need to use the keyboard and mouse that we mentioned among the «necessary», at the beginning of this tutorial, in order to configure your Raspberry.
Note that since the Raspberry is going to be hidden behind the mirror along with other devices that will obviously generate heat, it is important to ensure its adequate ventilation to avoid unnecessary “heaters”. It will be enough to guarantee some ventilation holes in the frame and equip our microcomputer with the typical heatsinks and a small fan.
Installing and configuring the Magic Mirror
And the great moment has arrived! Finally we are going to start with the installation of the necessary software so that our Magic Mirror comes to life.
Once we have properly configured Raspbian on our Raspberry, it is time to install the necessary packages for our Magic Mirror. The most recommended, as always, is to go to the original source and follow, step by step, the indicated instructions. In this regard, here I leave you the necessary links where you will find all the information to proceed correctly:
Raspberry Forum on Magic Mirror. In Spanish. It is always a good idea to take a tour of the many existing forums in the Magic Mirror community to clarify any doubts that may arise.
Configuring the modules of our Magic Mirror
One of the most interesting features of the Magic Mirror in my opinion is its modular character. That is, once the basic package that already comes with default modules is installed, an immense range of possibilities opens up to install infinity of third-party modules developed by the active community around these types of projects.
Most of the modules (not always) indicate how to carry out the installation, which is always similar. In essence, it consists of cloning via console the repository that corresponds to the module chosen within the directory «/home/pi/MagicMirror/modules/» which, if everything went well, you should find in the indicated path. In addition, it is possible that in some cases you will be asked to install certain dependencies, all through your terminal. Once this process is done, you must edit the file “config.js” that you will find in the path “/home/pi/MagicMirror/config/” to include in it the basic configuration of the module as well as choosing between the different options that the author of the same proposes you.
Without a doubt, the configuration of the “config.js” file can be the most tedious and delicate part of the matter since we have already entered into the field of “codes” which for someone like me, little experienced in the matter, is obviously the most complicated. If you control over these issues and you are used to fiddling with Linux distributions, it will be a piece of cake, and if, as in my case, it is not so, then be patient and, above all, do not forget to always make a backup copy of the file «config.js” before making any changes to it.
However, it is not difficult to “get the hang of it”, especially if you follow the initial basic configuration examples that you will find in the software installation documentation itself. It is very important that you pay close attention to the syntax of the “config.js” file because any small error can prevent your Magic Mirror from loading correctly. In any case, if after any change in the configuration, the mirror does not start properly, look at the error line that the console will show you in order to solve it.
Likewise, if the module configuration requires it (it is not usual) or if you simply want to experiment with it, you can also make changes to the style configuration through the generic configuration file “custom.css” that you should find in «/Home/p /MagicMirror/css/» as well as the different «filename.css» of each module that you will find in their corresponding directories. Be that as it may, go ahead with my recommendation to handle these files with «prudence» and always make backup copies before you «fiddle» with the codes. You are warned!
Installing third-party modules
Perhaps the most «fun» part of the entire project. There are countless modules developed by the community that are the ones that really, once the default modules are installed, are going to give life and personality to your Magic Mirror.
Remember that the “default modules” that you will have in the initial installation, also accept configuration modifications. For if it is an idea and among other modifications that I have introduced in the default modules, in my case, the messages of the “Compliments” module are adapted to the weather forecast as well as the time of day. That is, apart from some generics, the advice offered will depend on the weather and the time of day. Likewise, in my case I use the «Calendar» module to know the forecast of the tides of the Beach in my city as well as the time of sunrise and sunset. For its part, the NewFeeds module is «duplicated», showing in one news from my area and in another international news.
Entering properly into the «third-party modules», in essence, there are two fundamental repositories to search and test third-party modules. You will find both on GitHub. Here are the links:
3rd Party Modules. The list of modules par excellence, ordered by subject. Most are «operational» but it is also common to find some «abandoned». It is all a matter of trying.
Legacy Modules. Alphabetically ordered list of modules. Sometimes you will find, basically, the same or previous versions of those already existing in the previous list. Also here you can find interesting and fully operational modules.
Third-party modules installed in my project
During these months dedicated to the construction of the Magic Mirror, I have tried infinity of modules (not all the existing ones, far from it, of course) until the end I stayed with the selection that I will relate below. Of course, this is absolutely arbitrary and the modules to install will depend exclusively on your needs, tastes and preferences. You will find all the indicated modules in the previous links, especially in the first one (3rd Party Modules).
Since, as I indicate, this is a very personal matter, I will limit myself to simply mentioning the modules that I currently have installed (you never know what will happen tomorrow) and I will comment on some aspect that you may consider of interest about them:
MMM-pages. Essential if you plan to install many modules. It allows you to organize them on different pages. There are other interesting alternatives to achieve something similar, such as MMM-Carousel that allows you to “switch” between modules.
MMM-UVIndex. Module that informs me about the intensity of UVA Rays in my locality.
MMM-AirQuality. It indicates the air quality in my locality.
MMM-Tools. Essential to know how your “Raspi” is going. I use CPU, RAM, temperature and others …
MMM-Buller. The solution that I use (very useful for me) to visualize my Google Task tasks in the mirror.
MMM-CalendarExt2. Something complicated to configure but very versatile. A very complete alternative to the default calendar.
MMM-DarkSkyForecast. One of the many modules on time available. Very visually appealing and easy to set up.
MMM-TouchPlayerBasic. A music player as simple as it is not very useful. Essentially a curiosity.
MMM-network-signal. Well that.
MMM-GoogleFit. A very curious but somewhat limited module that allows you to view your activity synchronized with Google Fit.
MMM-GoogleFit2. The same but for a second person.
MMM-BackgroundSlideshow. Allows you to place a series of background images (occupying the entire screen) and automatically rotate between them.
MMM-SimpleLogo. Well that. An easy way to place a specific image in any space.
MMM-NewsFeedTicker. A very «cool» module although it can be improved. You can configure news sources that will be happening in a strip (typical of the news).
MMM-Widget. It allows you to insert any type of Widget into your Magic Mirror. In my case, I have three dedicated to my favorite football team inserted.
MMM-LocalTemperature. Paired with the DHT22 sensor that we discussed earlier. It allows me to know the temperature and humidity inside.
MMM-TelegramBot. Very interesting. It allows you some control over your Magic Mirror through, obviously, Telegram.
MMM-Cursor. A simple mouse cursor useful when the mirror gets rebellious or you want to do some simple operation. Obviously, you have to have a wireless mouse connected to your Magic Mirror.
MMM-GroveGestures. We also discussed something in the previous installment. Paired with the sensor Sensor PAJ7620u2 (Grove Gesture) allows gestures to control the mirror. Without a doubt, a very interesting alternative about whose possibilities you have already been able to visualize a small demonstration in this video already published in this same tutorial. Given the interest that I understand this module can arouse, we will dedicate a special section to it later.
MMM-page-indicator. It indicates to us, by means of a small circle located at the bottom of each page, the number of pages of your Magic Mirror and which one you are on. It has no more function.
MMM-ImageSlideshow. It allows to insert an image in a simple way. I use it for a small «menu» reminder of the gestures I use and that I have posted at the bottom of all pages.
MMM-MotionDetector. Among other functions, it can be used to program the screen on and off based on the movement detected by a camera. Although it worked perfectly, right now I have disabled it and removed the camera from the Magic Mirror for simple security reasons. The question of turning the screen on and off has finally been solved with the SONOFF wireless switch already mentioned in the previous installment and with the MMM-GroveGestures that offers an option in this regard through gestures.
MMM-GooglePhotos. Obviously, a module that allows you to view your photo albums from Google Photos. It works without problems although at the moment I have it disabled since I have the impression that it consumes excessive resources and slows down the entire system, not to mention that it directly «knocks it down».
MMM-LocalTemperature
MMM-UVIndex
MMM-Tools
In which areas of the screen do I place my modules?
Well, this is not a minor issue, especially when you start accumulating modules and more modules and the «available» space is running out. As I have already indicated, there are solutions if your intention is to fill the Magic with modules but it is also relevant to know the different «areas» or «regions» where you can locate the information to be displayed by your modules. Most of them will tell you which is the best area to locate them although, in many cases, it will only be an optional recommendation (not in some modules that «only» will work correctly for you in the location that their author indicates). For all this, this simple graphic explanation of the different useful areas of your Magic Mirror when organizing the modules was very useful to me:
And here the explanation of the previous color codes:
top_bar and bottom_bar are light gray.
top_left and bottom_left are red.
top_center and bottom_center are blue
top_right and bottom_right are green
upper_third is yellow
middle_center is cyan
lower_third is magenta
And since “well-born is to be grateful”, here is the original link from where I obtained the above information.
Something more about the MMM-GroveGestures
Looking for a system to interact with my Magic Mirror, beyond the voice control that did not motivate me especially, having already experimented a lot with the Alexa and Google Home devices and not being especially novel, I stumbled upon the MMM_GroveGestures module. Through it and with the aforementioned PAJ7620u2 sensor (Grove Gesture) connected to our Raspberry through, obviously, the appropriate pins of the GPIO, it is possible to control your Magic Mirror by gestures from a maximum distance (approximately) of about 20 cm. It offers by default nine different gestures (UP, DOWN, LEFT, RIGHT, FORWARD, BACKWARD, CLOCKWISE, ANTI-CLOCKWISE AND WAVE) but, in addition, it allows you to perform combinations of two, three or more movements with them, which multiplies the possibilities exponentially. Logically, if you create many «combinations of gestures», in addition to testing your memory, you will also increase the chances of errors when executing them since the sensitivity of the sensor is quite remarkable.
This system will allow you not only to send notifications to your Magic Mirror and to those modules that accept such functionality but also and this seems very relevant to me, executing commands with your Raspberry as if you were working with the console.
This system will allow you not only to send notifications to your Magic Mirror and to those modules that accept such functionality but also and this seems very relevant to me, executing commands with your Raspberry as if you were working with the console.
For example, in my case I have a series of gestures linked to the «mpg123» program, which allows me to listen to music from the external hard drive integrated in the mirror (a Playlist previously configured to be specific) as well as increase and decrease the volume, between other functions. Although it would obviously be easy to integrate a few simple speakers into the Magic, right now and until I find the right ones, I use an external speaker connected by bluetooth or cable, depending on your mood.
As I have already mentioned and among other possibilities, you can also use the sensor to activate your screen or, after the time you specify without receiving any gesture, get it to turn off automatically. In short, multiple options that I encourage you to explore.
Final assembly of the Magic Mirror
Obviously, at some point, we will have to do the «assembly» of the entire invention. That is to say, place our Raspberry, screen and other elements within the structure that we have manufactured for our Magic Mirror. Since the possibilities in this regard are endless and will depend largely on our preferences and objectives, I limit myself to sharing some images of the «guts» of my Magic Mirror that I hope will be useful to proceed with the final assembly of it:
And there is more?
You are right. There is much more but, for now, I have come this far and I think I will not continue to delve much deeper into the issue either, since I am relatively satisfied with the final result of my project, even if it is ugly that I say so.
Just as a point, and as an example of other existing possibilities, I do not forget the implementation of the project with voice control (both with Alexa and Google Home), for which there are numerous module options , or something that seems to me even More interesting as well as complex, such as facial recognition and the possibilities of personalized response of the Magic Mirror that it offers. In the links to the third-party modules you will also find proposals in this regard.
What will be next?
As I said almost at the beginning of the post, when you start it is really difficult to stop with these types of projects given the number of possibilities it offers. Although I have already officially terminated the Magic Mirror, it is no less true that I am waiting to receive a PIR sensor and a KY-040 rotary switch so I can continue «experimenting» although, honestly, I do not know if I will have free pins at the GPIO to continue connecting gossips to the Raspberry.