In modern days, Internet Of Things plays an important role in every part of life. Temperature monitoring system using IOT, helps us to record the temperature at every instant, and we can get immediate alert message whenever an anomaly occurs. One of the real time example includes application in pharmaceutical companies where medicines are stored at a lower temperature (30-40 degree celsius) and if the temperature exceeds the required boundary, i.e, if it crosses the maximum or the minimum limit, it becomes very harmful. So, we can get rid of this using IOT technique. Immediately we will get notified through email, SMS or any other means like Whatsapp and a phonecall recieved on crossing of temperature beyond the limit, so that we can take required remedial steps for recovery.
Embedded Youtube Video Link :Here is the whole project video of Temperature sensing
Steps for building this project:Step 1. Hardware Components :i.Bolt wifi module
ii. LM35 Temperature sensor
iii. Jumper male-female wire
iv. USB cable
v. Power Source
- Bolt Wifi module isconnected to LM35 temperature sensor through jumper wires.
- Using male to female wire we will connect the 3 pins of the LM35 to the Bolt Wifi Module as follows:
- VCC pin ofthe LM35 is connected to 5v of the Bolt Wifi module.
- Output pinof the LM35 is connected to A0 (Analog input pin) of the Bolt Wifi module.
- Gnd pin of the LM35 is connected to the Gnd.
Important Note:
First, we need to create a digitalocean account. Please click here https://m.do.co/c/80024cd68035 and create a new account. Type email id and password for Signing up and we will receive an account verification email. Open the email and click on the link to confirm our account.
After confirming your account, we need to add billing.
In this step, we will choose the appropriate image(version and type of OS) of droplet for this training. First, click on Create button and choose Droplet from the drop-down menu and the 'Create droplet' screen will appear.
At the time of this writing, the 64-bit Ubuntu 16.04.03 image is selected by default and we will use the same version for this training
In this step we will choose the size of the droplet i.e. the amount of RAM and storage space it should have.
Datacenter region is the place where our droplet will be deployed. It's like someone has bought a computer for you in that place. For the best performance, choose the data center nearest to us and our users. More distant server locations may increase the server's latency without providing any practical benefits. I am from India, so I kept Banglore as the default datacenter region
Once we have selected our options, click Create.
We created a droplet and got the login credentials and server IP over emails. Now, we will learn about tools/software for ssh(login to the server) into our server.
7. FOR Windows OSThe most popular software for ssh in windows is Putty. Putty is a free Telnet and SSH terminal software for Windows and Unix platforms that enable users to remotely access computers over the Internet. Visit the site https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html and choose the Windows installer from the Package files list according to our windows architecture.
After downloading putty MSI file, we have to install into windows desktop. Once PuTTY is installed, start the program and we will see a window pops up on our screen. Now enter the IP Address of our droplet that we received on our email id and click on open button.
Now type the username we have received on our email id and press enter.
Then type password and press enter. Password won’t be visible and we will have to type the same password, which is mailed to us from DigitalOcean.
After this, we are asked to change our password and we need to type our current password. And then we are asked to enter our new password twice for confirmation. Keep this password somewhere safe, because next time we have to type this new password. Once we have successfully logged in, we should be able to see the text shown below on our putty software.
The Bolt Python library makes it easy to interact with the Bolt cloud API from our Python application.
We can control or fetch the data from Bolt cloud to our server(Here Ubuntu from DigitalOcean ), Bolt Python library will help us in building the IoT product.
Before we proceed to this step, first ssh(login) to Ubuntu server and follow the below steps to use Bolt Python library in code.
1. Update the packages on UbuntuExecute the command below so that the packages on Ubuntu are updated to the latest version.
sudo apt-get -y update
2. Install python3 pip3pip3 is a package manager for python3 used to install and manage packages and python libraries. It is system independent.
Install pip3 using the following command,
sudo apt install python3-pip
3. Installing boltiot library using pipNow we will install the boltiot python library on your Ubuntu server.
Type the below command in terminal to install boltiot python library.
sudo pip3 install boltiot
Now we are done with boltiot python library installation.
C. Steps to install Linux, Apache, My sql, PHP stack on Ubuntu 18.04 for creating xml file for voice call:Step 1 — Installing Apache and Updating the FirewallThe Apache web server is among the most popular web servers in the world. It's well-documented and has been in wide use for much of the history of the web, which makes it a great default choice for hosting a website.
Install Apache using Ubuntu's package manager, apt
:
sudo apt update
sudo apt install apache2
Once we've entered our password, apt
will tell us which packages it plans to install and how much extra disk space they'll take up. Press Y
and hit ENTER
to continue, and the installation will proceed.
Adjust the Firewall to Allow Web Traffic :
Next, assuming that you have followed the initial server setup instructions and enabled the UFW firewall, make sure that our firewall allows HTTP and HTTPS traffic. You can check that UFW has an application profile for Apache like so:
sudo ufw app list
If we look at the Apache Full
profile, it should show that it enables traffic to ports 80
and 443
:
sudo ufw app info "Apache Full"
Allow incoming HTTP and HTTPS traffic for this profile:
sudo ufw allow in "Apache Full"
We can do a spot check right away to verify that everything went as planned by visiting your server's public IP address in your web browser (see the note under the next heading to find out what your public IP address is if you do not have this information already):
http://your_server_ip
We will see the default Ubuntu 18.04 Apache web page, which is there for informational and testing purposes. If we see this page, then our web server is now correctly installed and accessible through your firewall.
How To Find your Server's Public IP Address :
If we do not know what your server's public IP address is, there are a number of ways we can find it. Usually, this is the address we use to connect to our server through SSH.
There are a few different ways to do this from the command line. First, we could use the iproute2
tools to get IP address by typing this:
ip addr show eth0 | grep inet | awk '{ print $2; }' | sed 's/\/.*$//'
This will give two or three lines back. They are all correct addresses, but our computer may only be able to use one of them, so feel free to try each one.
An alternative method is to use the curl
utility to contact an outside party to tell us how it sees your server. This is done by asking a specific server what our IP address is:
sudo apt install curl
curl http://icanhazip.com
Step 2 — Installing MySQLNow that we have our web server up and running, it is time to install MySQL. MySQL is a database management system. Basically, it will organize and provide access to databases where our site can store information.
Again, use apt
to acquire and install this software:
sudo apt install mysql-server
This command, too, will show us a list of the packages that will be installed, along with the amount of disk space they'll take up. Enter Y
to continue.
When the installation is complete, run a simple security script that comes pre-installed with MySQL which will remove some dangerous defaults and lock down access to your database system. Start the interactive script by running:
sudo mysql_secure_installation
This will ask if we want to configure the VALIDATE PASSWORD PLUGIN
.
Answer Y
for yes, or anything else to continue without enabling.If we answer “yes”, we'll be asked to select a level of password validation.
Regardless of whether you chose to set up the VALIDATE PASSWORD PLUGIN
, our server will next ask you to select and confirm a password for the MySQL root user. This is an administrative account in MySQL that has increased privileges. Think of it as being similar to the root account for the server itself (although the one we are configuring now is a MySQL-specific account). Make sure this is a strong, unique password, and do not leave it blank.
If we enabled password validation, you'll be shown the password strength for the root password you just entered and our server will ask if you want to change that password. If we are happy with your current password, enter N
for "no" at the prompt:
Using existing password for root.Estimated strength of the password: 100Change the password for root ? ((Press y|Y for Yes, any other key for No) : n
For the rest of the questions, press Y
and hit the ENTER
key at each prompt. This will remove some anonymous users and the test database, disable remote root logins, and load these new rules so that MySQL immediately respects the changes we have made.
Note that in Ubuntu systems running MySQL 5.7 (and later versions), the root MySQL user is set to authenticate using the auth_socket
plugin by default rather than with a password. This allows for some greater security and usability in many cases, but it can also complicate things when you need to allow an external program (e.g., phpMyAdmin) to access the user.
If you prefer to use a password when connecting to MySQL as root,we will need to switch its authentication method from auth_socket
to mysql_native_password
. To do this, open up the MySQL prompt from our terminal:
sudo mysql
Next, check which authentication method each of your MySQL user accounts use with the following command:
mysql> SELECT user,authentication_string,plugin,host FROM mysql.user;
To configure the root account to authenticate with a password, run the following ALTER USER
command. Be sure to change password
to a strong password of our choosing:
mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
Then, run FLUSH PRIVILEGES
which tells the server to reload the grant tables and put our new changes into effect:
mysql> FLUSH PRIVILEGES;
Check the authentication methods employed by each of our users again to confirm that root no longer authenticates using the auth_socket plugin:
mysql> SELECT user,authentication_string,plugin,host FROM mysql.user;
Once we confirm this on our own server,we can exit the MySQL shell:
mysql> exit
Step 3 — Installing PHPPHP is the component of your setup that will process code to display dynamic content. It can run scripts, connect to your MySQL databases to get information, and hand the processed content over to your web server to display.
Once again, leverage the apt
system to install PHP. In addition, include some helper packages this time so that PHP code can run under the Apache server and talk to your MySQL database:
sudo apt install php libapache2-mod-php php-mysql
This should install PHP without any problems. We'll test this in a moment.
In most cases, you will want to modify the way that Apache serves files when a directory is requested. Currently, if a user requests a directory from the server, Apache will first look for a file called index.html
. We want to tell the web server to prefer PHP files over others, so make Apache look for an index.php
file first.
To do this, type this command to open the dir.conf
file in a text editor with root privileges:
sudo nano /etc/apache2/mods-enabled/dir.conf
It will look like this:
/etc/apache2/mods-enabled/dir.conf
<IfModule mod_dir.c> DirectoryIndex index.html index.cgi index.pl index.php index.xhtml index.htm</IfModule>
Move the PHP index file (highlighted above) to the first position after the DirectoryIndex
specification, like this:
/etc/apache2/mods-enabled/dir.conf
<IfModule mod_dir.c> DirectoryIndex index.php index.html index.cgi index.pl index.xhtml index.htm</IfModule>
When we are finished, save and close the file by pressing CTRL+X
. Confirm the save by typing Y
and then hit ENTER
to verify the file save location.
After this, restart the Apache web server in order for our changes to be recognized. Do this by typing this:
sudo systemctl restart apache2
We can also check on the status of the apache2
service using systemctl
:
sudo systemctl status apache2
Press Q
to exit this status output.
To enhance the functionality of PHP, you have the option to install some additional modules. To see the available options for PHP modules and libraries, pipe the results of apt search
into less
, a pager which lets us scroll through the output of other commands:
apt search php- | less
Use the arrow keys to scroll up and down, and press Q
to quit.
To learn more about what each module does, you could search the internet for more information about them. Alternatively, look at the long description of the package by typing:
apt show package_name
There will be a lot of output, with one field called Description
which will have a longer explanation of the functionality that the module provides.
For example, to find out what the php-cli
module does, you could type this:
apt show php-cli
If, after researching, you decide you would like to install a package, you can do so by using the apt install
command like you have been doing for the other software.
If we decided that php-cli
is something that you need, you could type:
sudo apt install php-cli
If you want to install more than one module, you can do that by listing each one, separated by a space, following the apt install
command, like this:
sudo apt install package1 package2 ...
At this point, your LAMP stack is installed and configured. Before making any more changes or deploying an application, though, it would be helpful to proactively test out your PHP configuration in case there are any issues that should be addressed.
Step 4 — Creating xml file on our Web server :Now we are creating xml file for our voice call to receive.
In Ubuntu 18.04, this directory is located at /var/www/html/
. Create the file at that location by running:
sudo nano /var/www/html/voice.xml
This will open a blank file. Add the following text, which is valid xml code, inside the file:
voice.xml
<Response>
<Say voice="alice">
Anomaly Detected! Someone definitely Opened the Fridge Door. The current temperature is increasing. Please take remedial step quickly.
</Say>
</Response>
When we are finished, save and close the file.
Now we can test whether your web server is able to correctly display content generated by this xml script. To try this out, visit this page in your web browser. We'll need your server's public IP address again.
The address you will want to visit is:
http://your_server_ip/voice.xml
If we can see this page in your browser, then your xml is working as expected.
D. Twilio configuration :D.A For SMS :Twilio is a third-party SMS functionality provider. It is a cloud communications platform as a service (PaaS) company. Twilio allows software developers to programmatically make and receive phone calls and also send and receive text messages using its web service APIs.
Creating an account on Twilio
1. Open https://www.twilio.com/ in browser.
2. Click on Get a Free API Key
button to sign up.
3. Fill all the necessary details in SIGN UP form. Below is the screenshot of filled sign up form.
4. To verify they will ask for our phone number. Choose India as an option in the dropdown and then enter our phone number.
5. Click on "Products" as shown on the screen below,
6. Now enable the SMS services by clicking on two checkboxes for Programmable SMS and Phone Numbers as shown below.
Once you have done this, scroll to the bottom of the screen and click on "Continue".
7. Now, we will need to give a name for our project. I have given the name as My Project. Click on "Continue" once we have entered the project name.
8. Click on "Skip this step" when it asks to Invite a Teammate.
9. Our project should be created at this point. Click on "Project Info" to view the account credentials which is required for our projects.
10. We can view the Account SID and Auth token on this page. The Auth token is not visible by default, we can click on "view" button to make the Auth token visible as shown below. Copy both and save them somewhere securely.
11. From the drop-down menu, choose "Programmable SMS". Now click on Get Started
button to generate phone number.
12. Click on Get a number
button.
13. Then a popup will appear. Click on Choose this number
button.
14. Then a popup will appear which will have the final number. Copy this number and save to notepad for future references.
We have successfully enabled sms configuration.
D.B For Whatsapp :1. We have to save the given number in our mobile phone and need to send a code that is showing with the number in following image join ground-party
2. After sending the code we will get a reply from Twilio "You are all set" on our whatsapp.
3. Now we will go to next step which is "send a one-way message".
4. For rechecking and reverification we will send whatsapp message to our mobile number from twilio.
5. If we successfully receive the sent message on our whatsapp then we have successfully configured the whatsapp set up.
1. For Phone call click on get a number .
2. Select the type of language in which you want to write the code
3. We need coding for phone call , so click the link for our appropriate code
4. Now check on Active Number List that Twilio provided Number support call option or not , If not then request a new number which support calling feature
5. Make Sure all of numbers are verified in Twilio's Verified Caller List to received Phone call Alert
Mailgun is an Email automation service. It has a very powerful set of inbuilt functions for sending emails. Developers can process their email with the help of Mailgun API
Creating an account on Mailgun
1. Open https://www.mailgun.com/ in browser.
2. Click on Sign Up
button.
3. Fill all the necessary details in SIGN UP form. Below is the screenshot of filled sign up form.
4. We will get a verification mail having a link. Click on that link to verify our mail.
5. To verify they will ask for phone number. Choose India as an option in the dropdown and then enter our phone number.
6. After verification, scroll down to Sandbox Domain
section. Click on Add Recipient
button.
7. Click on Invite New Recipient
button.
8. Enter the Receipient Email ID. In this case enter our Email ID.
9. After adding Email ID a new sandbox will be generated. Click on the ID of the newly generated sandbox.
10. The new screen will have all the necessary credentials that you want for sending an email. Copy all this credentials and save in the notepad.
We have successfully created the account on Mailgun.
Step 4. Generating API in Bolt cloud :We have to generate Bolt API key as the following in Bolt cloud:
1. Make the same circuit connections as described before.
2. Once you are done with that, log in to digitalOcean droplet and create a new folder to hold the files for this topic.
3. We can create a new folder and enter it using the following command.
mkdir Anomaly_Detectioncd Anomaly_Detection
4. Create a configurations file for this project, using the following command.
sudo nano conf.py
After the editor is open, type in the following configuration parameters
SSID = 'You can find SSID in your Twilio Dashboard'
AUTH_TOKEN = 'You can find on your Twilio Dashboard'
FROM_NUMBER = 'This is the no. generated by Twilio. You can find this on your Twilio Dashboard'
TO_NUMBER = 'This is your number. Make sure you are adding +91 in beginning'
MAILGUN_API_KEY = 'You can find in your Mailgun dashboard'
SANDBOX_URL = 'You can find in your Mailgun dashboard'
SENDER_MAIL = 'Mail address of Mailgun. You can find in your dashboard'
RECIPIENT_MAIL = 'Write Your mail'
API_KEY = 'This is your Bolt Cloud account API key'
DEVICE_ID = 'This is the ID of your Bolt device'
FRAME_SIZE = 10
MUL_FACTOR = 6
Note: We have to replace all the above value with our credentials. We can find the first four values in Twiliodashboard and the last two in Bolt Cloud dashboard.
You can set the FRAME_SIZE to 10, and the MUL_FACTOR to 6 for now. Once done, we can save the configurations file by pressing 'CTRL+x'
5. Now create one more file named anomaly_detection.py, using the following command
sudo nano anomaly_detection.py
This file will contain the main code. The algorithm for the code can be broken down into the following steps:
5.1) Fetch the latest sensor value from the Bolt device.
5.2) Store the sensor value in a list, that will be used for computing z-score.
5.3) Compute the z-score and upper and lower threshold bounds for normal and anomalous readings.
5.4) Check if the sensor reading is within the range for normal readings.
5.5) If it is not in range, send the SMS.
5.6) Wait for 5 seconds.
5.7) Repeat from step 1.
6. Here we will start writing the code. Let us start with the imports.
import conf, json, time, math, statistics
from boltiot import Sms, Bolt, Email
from twilio.rest import Client
The math and statistics libraries will be required for calculating the Z-score and the threshold boundaries.
The following lies code helps define a function which calculates the Z-score and the using the Z-score calculates the boundaries required for anomaly detection.
def compute_bounds(history_data,frame_size,factor):
The above line helps define a function, which takes 3 input variables: hisotry_data, frame_size and factor.
if len(history_data)<frame_size :
return None
if len(history_data)>frame_size :
del history_data[0:len(history_data)-frame_size]
The above code checks whether enough data has been accumulated to calculate the Z-score, and if there is too much data, then the code deletes the older data.
Mn=statistics.mean(history_data)
The above code calculates the mean (Mn) value of the collected data points.
Variance=0
for data in history_data :
Variance += math.pow((data-Mn),2)
This code helps to calculate the Variance of the data points. You can read more about variance here.
Zn = factor * math.sqrt(Variance / frame_size)
High_bound = history_data[frame_size-1]+Zn
Low_Bound = history_data[frame_size-1]-Zn
return [High_bound,Low_Bound]
Here we calculate the Z score (Zn) for the data and use it to calculate the upper and lower threshold bounds required to check if a new data point is normal or anomalous.
The next code is used to initialize the Bolt and SMS variables, which we will use to collect data and send SMS alerts. Here we also initialize an empty list with the name 'history_data' which we will use to store older data, so that we can calculate the Z-score.
mybolt = Bolt(conf.API_KEY, conf.DEVICE_ID)
sms = Sms(conf.SSID, conf.AUTH_TOKEN, conf.TO_NUMBER, conf.FROM_NUMBER)history_data=[]
mailer = Email(email_conf.MAILGUN_API_KEY, email_conf.SANDBOXURL, email_conf.SENDER_EMAIL, email_conf.RECIPIENT_EMAIL)
history_data=[]
client = Client(conf.SSID, conf.AUTH_TOKEN)
The following while loop contains the code required to run the algorithm of anomaly detection.
while True:
rtextsms = mybolt.analogRead('A0')
remail = mybolt.analogRead('A0')
data = json.loads(rtextsms)
if data['success'] != '1':
print("There was an error while retriving the data.")
print("This is the error:"+data['value'])
time.sleep(5)
continue
sensor_value1 = int(data['value'])
sensor_value1 = sensor_value1/10.24
print ("The current temperature of your Refrigerator is "+str(sensor_value1) + " degree celsius" And the sensor Value is "+data['value'])
sensor_value=0
try:
sensor_value = int(data['value'])
except e:
print("There was an error while parsing the response: ",e)
continue
bound = compute_bounds(history_data,conf.FRAME_SIZE,conf.MUL_FACTOR)
if not bound:
required_data_count=conf.FRAME_SIZE-len(history_data)
print("Not enough data to compute Z-score. Need ",required_data_count," more data points")
history_data.append(int(data['value']))
time.sleep(5)
continue
try:
if sensor_value > bound[0] :
celsius_value = sensor_value/10.24
print ("Anomaly Detected! Someone definitely opened the fridge door. We are sending SMS, Mail, Whatsapp message and arranging a phone call")
rtextsms = sms.send_sms("Anomaly Detected! Someone definitely opened the fridge door. The current temperature is " + str(celsius_value) + "degree celsius")
message = client.messages.create(
body = 'Anomaly Detected! Someone definitely opened the fridge door. The current temperature is' + str(celsius_value)+ ' degree celsius',
from = 'whatsapp:+14155238886'
to = 'whatsapp:+917005507703'
)
print(message.sid)
call = client.calls.create(
url = 'http://139.59.42.205/voice.xml',
to = '+917005507703'
from ='+16672225480'
)
print(call.sid)
remail = mailer.send_email("Anomaly Detected!", "Someone opened the fridge door. The temperature of your refrigerator hasbeen increased suddenly. The current temperature is" +str(celsius_value) " degree celsius")
print("This is the response for SMS ", rtextsms)
print("This is the response for EMAIL",remail)
history_data.append(sensor_value)
except Exception as e:
print ("Error",e)
time.sleep(5)
Here is the full code in one frame.
import conf, json, time, math, statistics
from boltiot import Sms, Bolt, Email
from twilio.rest import Client
def compute_bounds(history_data,frame_size,factor):
if len(history_data)<frame_size :
return None
if len(history_data)>frame_size :
del history_data[0:len(history_data)-frame_size]
Mn=statistics.mean(history_data)
Variance=0
for data in history_data :
Variance += math.pow((data-Mn),2)
Zn = factor * math.sqrt(Variance / frame_size)
High_bound = history_data[frame_size-1]+Zn
Low_Bound = history_data[frame_size-1]-Zn
return [High_bound,Low_Bound]
mybolt = Bolt(conf.API_KEY, conf.DEVICE_ID)
sms = Sms(conf.SSID, conf.AUTH_TOKEN, conf.TO_NUMBER, conf.FROM_NUMBER)
mailer = Email(email_conf.MAILGUN_API_KEY, email_conf.SANDBOXURL, email_conf.SENDER_EMAIL, email_conf.RECIPIENT_EMAIL)
history_data=[]
client = Client(conf.SSID, conf.AUTH_TOKEN)
while True:
rtextsms = mybolt.analogRead('A0')
remail = mybolt.analogRead('A0')
data = json.loads(rtextsms)
if data['success'] != '1':
print("There was an error while retriving the data.")
print("This is the error:"+data['value'])
time.sleep(5)
continue
sensor_value1 = int(data['value'])
sensor_value1 = sensor_value1/10.24
print ("The current temperature of your Refrigerator is "+str(sensor_value1) + " degree celsius" And the sensor Value is "+data['value'])
sensor_value=0
try:
sensor_value = int(data['value'])
except e:
print("There was an error while parsing the response: ",e)
continue
bound = compute_bounds(history_data,conf.FRAME_SIZE,conf.MUL_FACTOR)
if not bound:
required_data_count=conf.FRAME_SIZE-len(history_data)
print("Not enough data to compute Z-score. Need ",required_data_count," more data points")
history_data.append(int(data['value']))
time.sleep(5)
continue
try:
if sensor_value > bound[0] :
celsius_value = sensor_value/10.24
print ("Anomaly Detected! Someone definitely opened the fridge door. We are sending SMS, Mail, Whatsapp message and arranging a phone call")
rtextsms = sms.send_sms("Anomaly Detected! Someone definitely opened the fridge door. The current temperature is " + str(celsius_value) + "degree celsius")
message = client.messages.create(
body = 'Anomaly Detected! Someone definitely opened the fridge door. The current temperature is' + str(celsius_value)+ ' degree celsius',
from = 'whatsapp:+14155238886'
to = 'whatsapp:+917005507703'
)
print(message.sid)
call = client.calls.create(
url = 'http://139.59.42.205/voice.xml',
to = '+917005507703'
from ='+16672225480'
)
print(call.sid)
remail = mailer.send_email("Anomaly Detected!", "Someone opened the fridge door. The temperature of your refrigerator hasbeen increased suddenly. The current temperature is" +str(celsius_value) " degree celsius")
print("This is the response for SMS ", rtextsms)
print("This is the response for EMAIL",remail)
history_data.append(sensor_value)
except Exception as e:
print ("Error",e)
time.sleep(5)
7. Save the file by pressing Ctrl+x.
Step 6. Project Output and How it Works :Now that we have written the code for anomaly detection lets run the code.
Once that is done, run the anomaly detection code using the following command
python3 anomaly_detection.py
After about 50 seconds (5 seconds delay with a frame size of 10), the system will start printing the values, as per the following image.
Note: If you are not getting these results, try changing the FRAME_SIZE and MUL_FACTOR values in the conf.py file.
After we open the fridge, immediately the temperature rises, and it will print out that "Someone opened the fridge door" and it will also print the degree celsius as well as the sensor value.
An email, an sms, a whatsapp message and also an alert call will also be received that time.
This is the call Output :
This is how the whole project works. Thank you.
Comments