Build a Selfie Machine With an IP Camera in Less Than 15 Minutes!
by thethingbox in Circuits > Raspberry Pi
1374 Views, 8 Favorites, 0 Comments
Build a Selfie Machine With an IP Camera in Less Than 15 Minutes!
![P1160195.JPG](/proxy/?url=https://content.instructables.com/FZ7/Y39L/IK7C8Z44/FZ7Y39LIK7C8Z44.jpg&filename=P1160195.JPG)
![Selfie Machine with TimeSquAir](/proxy/?url=https://content.instructables.com/FJZ/M4RZ/IK7C8Z6J/FJZM4RZIK7C8Z6J.jpg&filename=Selfie Machine with TimeSquAir)
Are you ready to build a selfie machine in less than 15 minutes, that sends to your email address a snapshot taken from an IP Camera? This is achievable thanks to TimeSquair.
The picture shows a IP Camera close to the TimeSquAir, but it could be wide away, connected on the same network.
Receipe Summary
Cook and Preparation Time: 15 minutes
Difficlutly: medium
Ingredients:
- 1 TimeSquAir
- 1 IP Camera
IP Camera Preparation
![SNH-E6411BN_F.png](/proxy/?url=https://content.instructables.com/FQ4/WCGD/IK7C93TM/FQ4WCGDIK7C93TM.png&filename=SNH-E6411BN_F.png)
![Samsung_SmartCam_Network.JPG](/proxy/?url=https://content.instructables.com/FPG/AQQO/IK7C93VT/FPGAQQOIK7C93VT.jpg&filename=Samsung_SmartCam_Network.JPG)
Unpack your IP Camera. In my case, it’s a Samsung SmartCam. In order to be comfortable for the following parts, the best is to fix its IP Address.
Find in the literature the URL that gives you a snapshot from the Camera stream. In my case, I found out that the URL is:
http://192.168.0.33/cgi-bin/video.cgi?msubmenu=jpg
In order to get rid of the login control, add your login and password for your camera in the URL. In my case, it results in:
http://admin:password@192.168.0.33/cgi-bin/video.cgi?msubmenu=jpg
The First Node : Grabe a Snashot From the Camera
![print-screen-1.jpg](/proxy/?url=https://content.instructables.com/FKW/C9K4/IK7C8Z2K/FKWC9K4IK7C8Z2K.jpg&filename=print-screen-1.jpg)
Now it’s time to build the node in TimeSquAir to get the snapshot. Connect to your TimeSquAir through a web browser.
We just use the wget command for the URL we discussed in the previous step. We will name the snapshot snapshot.jpg, and store it in the /media/ folder. It results in the following command:
wget -O /media/snapshot.jpg http://admin:password@192.168.0.33/cgi-bin/video.cgi?msubmenu=jpg
A Small Function to Prepare the Email Message
![print-screen-2.jpg](/proxy/?url=https://content.instructables.com/FY7/KGHG/IK7C8Z2L/FY7KGHGIK7C8Z2L.jpg&filename=print-screen-2.jpg)
![print-screen-3.jpg](/proxy/?url=https://content.instructables.com/FTF/S4E4/IK7C8Z25/FTFS4E4IK7C8Z25.jpg&filename=print-screen-3.jpg)
Let’s prepare the content for the mail! For this purpose, you just need to add a function that compiles the different fields of the mail.
This will feed the email node with the right parameters. Add the email node, with the good destination address. Don’t forget to fill in the appropriate Gmail credentials.
That's It!
![print-screen-4.jpg](/proxy/?url=https://content.instructables.com/FIY/70JZ/IK7C8Z28/FIY70JZIK7C8Z28.jpg&filename=print-screen-4.jpg)
![print-screen-5.jpg](/proxy/?url=https://content.instructables.com/FUU/X1P4/IK7C8Z2B/FUUX1P4IK7C8Z2B.jpg&filename=print-screen-5.jpg)
You are almost done!
Add a “Go” Node, and connect the nodes together.
Deploy your flow, and test it by pressing the “Go” Node. The destination mail address should receive in the following seconds a mail, with the snapshot taken from the IP Camera Stream.
Notes, Tips and Variations
![print-screen-6.jpg](/proxy/?url=https://content.instructables.com/FEC/B7EM/IK7C8Z2E/FECB7EMIK7C8Z2E.jpg&filename=print-screen-6.jpg)
![print-screen-7.jpg](/proxy/?url=https://content.instructables.com/FD2/66Q5/IK7C8Z2F/FD266Q5IK7C8Z2F.jpg&filename=print-screen-7.jpg)
![print-screen-8.jpg](/proxy/?url=https://content.instructables.com/FPP/E4GG/IK7C8Z2G/FPPE4GGIK7C8Z2G.jpg&filename=print-screen-8.jpg)
![print-screen-9.jpg](/proxy/?url=https://content.instructables.com/F9Y/IKY3/IK7C8Z2H/F9YIKY3IK7C8Z2H.jpg&filename=print-screen-9.jpg)
![print-screen-10.jpg](/proxy/?url=https://content.instructables.com/FYA/1VD9/IK7C8Z2I/FYA1VD9IK7C8Z2I.jpg&filename=print-screen-10.jpg)
![print-screen-11.jpg](/proxy/?url=https://content.instructables.com/FOW/VDG1/IK7C8Z2J/FOWVDG1IK7C8Z2J.jpg&filename=print-screen-11.jpg)
![photo.jpg](/proxy/?url=https://content.instructables.com/F7T/G6SJ/IK7C95CO/F7TG6SJIK7C95CO.jpg&filename=photo.jpg)
Here are some add-on tips to enhance the experience:
Launch the selfie with a NFC tag:
If you “tap” a NFC tag on your TimeSquAir, it will appear on your Node Red interface. Connect it to the “Recorder” Node, and Deploy. You’re done! You can now launch a selfie by tapping this tag on Your TimeSquAir.
Add a shutter sound:
If you connect speakers to your TimeSquAir, you can synchronize a shutter sound to the selfie launch. Put the chosen .wav file in yout Pi (I have chosen to put a shutter.wav file under the /media/ directory), and add the following command to a node: aplay /media/shutter.wav
Adding a watermak to the picture:
You can add a watermark overlay thanks to the composite command from ImageMagick library. Put a PNG file that will play the role of the overlay in your Pi (I’ve chosen to locate all the files in the /media/ directory), and add a node with the following command:
sudo composite -gravity center /media/overlay.png /media/snapshot.jpg /media/snapshot2.jpg
As a result, the snapshot2.jpg is the result of the merge of snapshot.jpg and the png file. Don’t forget to upgrade the following function by replacing “snapshot.jpg” by “snapshot2.jpg”. And put the “Watermak” node in-between the “Record” one and the function.
Learn More
![tsa.jpg](/proxy/?url=https://content.instructables.com/FH4/BQHU/IK7C951T/FH4BQHUIK7C951T.jpg&filename=tsa.jpg)
Learn how to link things together with TimeSquAir and IBM's Node-RED and discover the other Instructables related to the ThingBox and TimeSquair