Having a semi-ready product but the main purpose of AI is not reached
It does NOT have any output besides the TV
So, It is time for the MMMs!
The power of the MagicMirror is in its modules and its huge community
If you jump to the GitHub MMM page you will find countless modules for anything you can possibly dream of.
If you jumped to the link provided above you will see categorized modules, each category for specific use
I first wanted to install Azan prayer times so I searched with ctrl+f for azan and found nothing then I searched for pray and found some modules, reading the description of each, and then settled on this MMM-PrayerTime
I spent a full day trying to figure out how I can run a module!
So. here how it works:
follow the instructions in GitHub page of the module and you will get azan sound in selected prayer times
You have to set configurations like this
lat and lon can be known from google maps
the numbers will be lat: 29.984459, lon: 30.957320
Time format must be as system or the Azan will not work, set both to 12h
language must be en or you will suffer!
Note* values must as in 'value' to take effect ('en')
This module comes in default but needs configuration
jump to the GitLab to set it up
You have to get Location, location ID, app ID in order to make it run smoothely
This module comes in default but needs configuration
jump to the MM documentation to set it up
Lots of electronic newspaper offers RSS feeds of news
RSS feeds is very brief, informative and it allows you to choose between different categories
all you have to do is to paste the RSS link and name the source
Well, I spent days trying to run this feature
I tried four modules but could not make them work.
Facial recognition itself is not the dilemma, but combining it with MagicMirror is.
A very handy article by Adrian Rosebrock about Raspberry Pi Face Recognition
In this article, Adrian explained face recognition and I will not be lying if I said it is the best of the best!
but when it comes to modules it is a matter of dependencies and low experience
taking an example of the failed attempts
Searching for face recognition I found those 2 modules
When I saw that normyx saying he edited the paviro's module and added awesome stuff I decided that I will use normyx's
He said that it works with versions of opencv above 3.3 and I was using 4.5, So I said yay.
That's when The fool me started to work on this module, I spent a full 5 days on this module, Although our instructor -Mego- helped me that's when I knew that I will not reach a good end.
The problem was that it was too old version (3 years ago)
I reached when it tries to take the capturing dataset and tried to generate the database but the process can not be completed
paviro's (4 years ago)
That's when I decided to take date of edit
I wanted to implement PIR sensor that makes the mirror lights up when some one approach or move nearby and turns off to save power when nobody is there.
I also wanted to add some indication when someone perform certain order or when it detect face or motion nearby and I though RGB led light will be awesome for indication.
I also wanted to add a simple button, I think it might be handy for the future
and I thought making it as a shield will be awesome so i searched online for a footprint of Raspberry Pi and added it to eagle , removed components, but that made some troubles later as layer issue
Anyway here is all the files;
You can back to week 3 and 4 and 5 to see the full fabrication process of a PCB,
BOM is as follows:
3 of tip 122
4 of 10k resistance
some pin headers
spacers
PIR sensor
4 terminal blocks to connect leds, power and an external push button
12v adaptor that powers the shield and the atmega 328p together
very simple, right ?
This is not the first version.
In the first version, I made some mistakes such as:
Forgot to add the 10k resistance to the TIP122 transistor and that results in a short circuit
layer issue resulted in unconnected grounds
Rosetta's connectors had not enough space to sit-in
This is the first ready version after some edits
Tested and ready to run
We will run a simple code, when detect motion of the PIR, it will simply light red
It is too simple but that is just for now.
The code will run beside magic mirror software in parallel processing, that means the code will be excuted in terminal as >>python3 code.py
The code will be as follows
###########
import time
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BOARD)
GPIO.setup( 3 , GPIO.IN )
GPIO.setup( 11 , GPIO.OUT)
while True:
if (GPIO.input( 3 ) == True ):
GPIO.output( 11,1)
print (" Motion Dete cted, Now Turning On Led ")
time.sleep( 1)
else:
GPIO.output( 11,0)
print (" There is No motion ")
time.sleep( 1 )
in order to fix the raspberry pi and its shield on the back surface of the smart mirror, A simple 3d printed part is required, designed it with Solidworks ( inspired by this thingy )
I did not believe it is just like this, fascinated by my work, and here I connect and it's working without capturing any video.
then it comes the next day (the last deadline to hand the project data) with bad news, the PIR sensor outputting 3.3, the input pin reads 5!, how the hell??, the connection was all checked before and then, no short circuit, nothing was wrong and there the raspberry pi goes without saying goodbye!
1k LE worth raspberry pi 3 b plus is BUSTED without knowing why!!!!
Our instructor Ahmed ibrahim provided me with another raspberry pi to add the final documentation,, THE calendar!
I have to stay awake for another day to finish the project that makes me awake for 72 hours :(
Anyway,
The PCB shield will be put on our week 2 atmega 328 PCB and run a fading code when PIR sensor triggers
The pins are cutting using a cutter knife and certain pins will be connected (D9,10,11 for rgb led strip --as they provide PWM-- , D4 for PIR input and ground)
They are not perfectly aligned but can do the job
I always thought that LED rgb fading is awesome so I searched for fading code for the atmega
Fortunatelly. I found a code that can work for me
We will upload the code as we did in week 3 and 4 and 5 . feel free to check them
Here is the code adding PIR control
I thought i did, 5 am in the morning, just 7 hours till deadline besides I have a lecture in the university that i have to attend ( 5 hours to go and back )
when I put the card it stays long time loading in boot and when I try to type any thing in the terminal it says illegal instruction (((HELL)))
the only available opton is to write this documentation and try to install the magicMirror again
and of course add the calendar module just i told ahmed ibrahim
Remember the raspberry pi provided by ahmed ibrahim ?
it turned out to be raspberry pi 2 b plus and the magicMirror software does not run on it, may destiny does not want to ?
I tried to flash a brand new software but;;;
The first line of the code appears that it have problems with raspberry pi so, CRY, CRY
I tried to fix my raspberry pi but it need lots of time, i googled a lot and posted on raspberry pi group on facebook, they all agreed it is hard to fix (not impossible) but requires some research before
CLICK HERE to see the full comments (join the group first)
plus, read this article by hackaday : ARTICLE
However, fusing the raspberry pi magic mirror and the atmega 328 board will be awesome, can not wait to try it but i have to save money to buy a new raspberry pi.
Final features:
the frame looks neat that gives a good look
the mirror acts a decor
shows time, azan, weather, RSS news
shows calendar for each person (linked to any calendar app on smartphones)
when you approach the mirror it lights the led strip in fading motion and that calm the sensation
all the mirror needs for power is a simple ac jack as any pc uses, inside, are all hidden!
What I have learned the most is
never ever make a shield for an expensive board (1k LE is expensive at least for me)
know your limits before starting a new task ( I was not ready for the facial or voice recognition )
Be careful when dealing with glass
Besides that, I enjoyed this diploma so much and I am very sad that it ended.
THANKS.