Introduction: Build a Selfie Machine With an IP Camera in Less Than 15 Minutes!
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.
Step 1: Receipe Summary
Cook and Preparation Time: 15 minutes
- 1 TimeSquAir
- 1 IP Camera
Step 2: IP Camera Preparation
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:
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:
Step 3: The First Node : Grabe a Snashot From the Camera
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:firstname.lastname@example.org/cgi-bin/video.cgi?msubmenu=jpg
Step 4: A Small Function to Prepare the Email Message
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.
Step 5: That's It!
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.
Step 6: Notes, Tips and Variations
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.
Step 7: Learn More
Participated in the
Digital Life 101 Challenge