Customize Consent Preferences

We use cookies to help you navigate efficiently and perform certain functions. You will find detailed information about all cookies under each consent category below.

The cookies that are categorized as "Necessary" are stored on your browser as they are essential for enabling the basic functionalities of the site. ... 

Always Active

Necessary cookies are required to enable the basic features of this site, such as providing secure log-in or adjusting your consent preferences. These cookies do not store any personally identifiable data.

No cookies to display.

Functional cookies help perform certain functionalities like sharing the content of the website on social media platforms, collecting feedback, and other third-party features.

No cookies to display.

Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics such as the number of visitors, bounce rate, traffic source, etc.

No cookies to display.

Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.

No cookies to display.

Advertisement cookies are used to provide visitors with customized advertisements based on the pages you visited previously and to analyze the effectiveness of the ad campaigns.

No cookies to display.

DIY Home Security System using Raspberry Pi

DIY Home Security System – Install and configure the door sensors application

In this step we look at the door-sensor software.

All the commands on this page are executed on the raspberry pi box. See previous page for tips to connect remotely using ssh.

In order to run java programs install the JDK

First, check if you have java pre-installed

java -version

my current output is

java version "1.8.0"
Java(TM) SE Runtime Environment (build 1.8.0-b132)
Java HotSpot(TM) Client VM (build 25.0-b70, mixed mode)

If you get an error or you have an older version of java, install the java 8 JDK:

sudo apt-get install oracle-java8-jdk

Re-run the java -version command to verify the installation.

Download the doorsensors build

cd ~
wget http://teakdata.com/doorsensor/doorsensor-1.0.0-SNAPSHOT-bin.zip

Unzip the package

unzip doorsensor-1.0.0-SNAPSHOT-bin.zip

At this point you should see the folder doorsensor-1.0.0-SNAPSHOT

ls doorsensor-1.0.0-SNAPSHOT

The above command should list all the files in the new folder:

door.properties  door.sh  lib

Edit the configuration file door.properties, I am using the nano editor. After finished your changes, to save press CTRL-o and press enter to save to existing file. To exit press CTRL-x

cd ~/doorsensor-1.0.0-SNAPSHOT
nano door.properties

The main changes you should do in the door.properties file are related to your email configuration.

IMPORTANT: it is a good idea to not use your main email, you can create a test gmail account to use it with the device. As “email.to” you can use your real email to receive notifications.

The sample has preconfigured values for GMAIL accounts (smtp host, port).

#destination email to send the pictures
email.to=your_real_email@gmail.com
#sender email
email.from=your_test_email@gmail.com
#smtp server configuration
email.smtp.host=smtp.gmail.com
email.smtp.port=587
email.smtp.user=your_test_email
email.smtp.passwd=yourpassword

We are now ready to start the application.

cd ~/doorsensor-1.0.0-SNAPSHOT
sudo ./door.sh

The application is running and the logs are now displayed on the console. To close the application use CTRL-C

 

Next Page: DIY Home Security System – Final Assembly

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *