loading

Building a Home Security Camera with

Estimated time: 15 minutesPrerequisites:Twilio Account Cloudinary AccountThinged.io Account ThingRaspberry Pi RPi CameraThis tutorial will step you through creating a thinged.io part that can take a photo with your Raspberry Pi, upload it to cloudinary and send it via mms using Twilio.

Building a Home Security Camera with 1

Well guide you through creating your first thinged part and how to think about structuring them, so you can build your own extensions to the Thinged.io platform.0: Setup your Raspberry Pi with Thinged.

ioSee your Raspberry Pi to take a photoUpload the photo to CloudinarySend a MMS using TwilioWrap upCreate the required accounts and get all the API keys and tokensOnce you create your Twilio and Cloudinary accounts, you can get your Account Ids and Access Tokens from their respective dashboards:2. Setup your Raspberry Pi with the Python Prequisites:Now you have your accounts created, we have to install requirements on the Raspberry Pi for communicating with Cloudinary and Twilio. sudo apt-get install python3-pippip3 install --user cloudinarypip3 install --user twilioDone.

2. Configure your Raspberry Pi cameraEnable your Raspberry Pis camera module through the raspi-config:sudo raspi-configSelect Interfacing Options , then Camera and enable it.Reboot your Raspberry Pi.

Test your camera:raspistill -v -o test.jpg3. Test the script on your Raspberry PiWeve created a github gist that you can use for taking these photos.

Building a Home Security Camera with 2

Download this script onto your Raspberry Pi and edit the following variables:cloudinary_cloud_namecloudinary_api_keycloudinary_api_secrettwilio_account_sidtwilio_auth_tokentwilio_from_numberphone_numberThe script itself is ultra simple and is comprised of a couple small functions:take_photo(photo_name) which takes the photo from the raspberry pi using the raspistill library installed in Raspbian by default.upload_photo_to_cloudinary(photo_file_name) which uploads a photo with the given name.send_mms(to, message, media_url) which sends a your photo using Twilio.

4. Creating the Thinged. io PartJust as the python script was a thin wrapper around the Cloudinary and Twilio, Thinged is a thin wrapper around shell commands.

A Thing is comprised of Parts which are just state that can be get and set through command line commands. The returned text of the command forms the basis of get parts and placeholders are used to step in for arguments in set commands. The Part we are creating looks like the following:There is a lot of different keys there, but dont worry- it is actually pretty simple.

Ive broken down the parameters below:humanName human friendly name that you can use to identify the part.description human friendly description so you can figure out how it works and add any other details. partId randomly generated string that thinged.

io uses to identify the part, and you use in the API to set values on it.type Either input, output or inputOutput defines whether the part is used to get state from your thing, set state on your thing, or a combination of the two (you can set it, but it could change elsewhere and should be read). Inputs require getCommand , outputs require setCommand.

setCommand The command that will be launched when setting a value. Here it just points to our python script. Addingvalue to this will be replaced everywhere with the parts value when you set commands via the API.

The python script will have to be loaded into the raspberry pi through other means.valueType This can be number, string or state. As mentioned earlier, Thinged is essentially a thin wrapper for command line commands, and so everything is translated into strings on the command line.

valueType is important for any GUI that wants to present details about the state of a part. Here, the valueType is state which implies that there are a discrete number of state, and they can be enumerated into values. This allows the GUI to present a nice button for 2 state parts and a drop down for 3 or more state parts.

states Each state represents a different discrete possibility. As Thinged.io will only trigger a set when a value changes, here the discrete states are duplicates of each other, but with different values.

regexes Useful for input or inputOutput parts where you would like to preprocess the response of the command.Create this part, either through the web portal, or through the API. from there you can add the part to your thinged and now you are done!

Wrap Up:If youve created the part, it should now look like this on the GUI:If you have loaded the script into your pi, and thinged. io service is running, everything is done. Now for the pay off: Press the button!

In this tutorial weve gone through working with thinged.io output parts to create a spy camera with a raspberry pi, cloudinary and twilio accounts and a 42 lines of python holding it all together. Stay tuned for more tutorials on thinged.

io.

GET IN TOUCH WITH Us
recommended articles
Cases
Best Gadgets Home Security Camera Is Now Available In Amazon IndiaIts not a tiny low investment to shop for into Arlo Pro two security camera kit this product is the...
Arlo Pro 2 Wireless Home Security Camera System reviewArlo Pro 2 Wireless Home Security Camera System best priceour low wire free cameras are the first and only smar...
Taking large strides in the security equipment industry CCTV camera systems are inevitable in the areas of surveillance and security in the fields of commercial use,...
Believing that administrative assistant, Warren Apelton, was taking an unauthorized sick day last week, his office colleagues at Colter Cloud in Philadelphia hacked ...
What a journey it has been to launch Ucam, the first absolutely private home security camera powered by IoTeX. Throughout this journey, we often asked ourselves how ...
Home Security Cameras have become an important part of avoiding rapid deterioration. Proper protection is very important to make sure that everything is fine at home...
If you choose the Arlo Pro 2 security camera for your home security. Then you can keep your mind calm. Also, by clicking on the Arlo Netgear Login you can control ea...
Washington Township Police Home Security Camera Registration Initiative:Crime prevention is a cooperative effort between those we serve and our agency. One of Chief ...
Science and Technology have reached the level that is unable to imagine in the yesteryears. With the advanced of the technological creativity, every single thing is ...
When it comes to justifying the utility of wireless security cameras through the geofencing there should be no flaws in the home surveillance system. Your home and b...
no data
Shenzhen Tiger Wong Technology Co., Ltd is the leading access control solution provider for vehicle intelligent parking system, license plate recognition system, pedestrian access control turnstile, face recognition terminals and LPR parking solutions.
no data
CONTACT US

Shenzhen TigerWong Technology Co.,Ltd

Tel: +86 13717037584

E-Mail: info@sztigerwong.com

Add: 1st Floor, Building A2, Silicon Valley Power Digital Industrial Park, No. 22 Dafu Road, Guanlan Street, Longhua District,

Shenzhen,GuangDong Province,China  

                    

Copyright © 2024 Shenzhen TigerWong Technology Co.,Ltd  | Sitemap
Contact us
skype
whatsapp
messenger
contact customer service
Contact us
skype
whatsapp
messenger
cancel
Customer service
detect