Welcome back guys to video number 3.4 and
this we are going to set up MIT app
and whatever mobile app or esp32 Smart
Lock, okay.
So here is the website just type app and enter.it.edu and
you will see that page then click on the create apps
and it will login you.
By the Google email addresses so for that you
have a Google it.
So here is the interface after
the login just click on the start new project.
And type the name and here I'm going to type the
ESP.
32
smart
Lock, okay.
And click on that.
And here we have a screen so firstly we need to put
the horizontal Arrangement one.
To and the three actually one
for the message that devices are
the connected are the not connected. The next is a
list view where we will select the
device from the list and the third one is a button
to on and off. Okay, so firstly we
need to make the height 60 pixel.
And the width you can say that well
the parent and by the way, if I
will make it duplicate, okay, it's not
making no worries.
So again put the 60 pixels here.
And the width of field parent, okay.
Don't worry about that distance. It will be not shown in the app.
60
Sorry and feel parent,
okay?
So where is the label?
I need to
put here the text connected. Okay not.
Connected by default text and you can change
the phone to the 20.
And click on that and make the alignment
center and the center by the
way. It's a horizontal Arrangement alignment. Okay, and here's
the list picker, okay.
Make it fill the
parent and with fill the parent. Okay, and
we are good to go with that.
and
you can change the
select device
alright guys
And the next we need to put the button here. Okay,
and
Make the width and height fill the
parent.
Okay, we are good to go with that.
and
on the lock you can say
that open lock.
Yes, it's more appropriate word overlock. And
we're good to go with that. Now. We
need to click on the blocks to adjust the block.
So firstly we need to work
on the select device area Okay, so click
on the list picker and
Here we need to select before picking.
Yes before picking when we
click on. We need to provide the list of the stuff.
Okay for the list picker. We
need to set the list items. Okay
set the list items.
Here we need to select.
List text not elements. We
need to focus on the elements.
sorry, I am little bit new to the
MIT App Inventor after a long time. I am using that.
So where are the elements? We need to find out the elements?
Yes here for the elements and
from where we need to get the elements. Yes. We
need to get the elements from the Bluetooth, but still
we didn't put any
of there.
To connectivity. We need to click on the Bluetooth
client and drag that.
And we're good to go with that. This is invisible element.
Okay, and now we come to the blocks here. We
will get the Bluetooth client. Okay.
Click on the Bluetooth and here we need to get the address
and the names. Okay guys
and by this way, when we click on the list
picker, it will give us a names.
Here after clicking that so what happened
when we select the device so here
again, we need to click on that.
on the list picker
and here is an event what after the picking so
we need to connect with
that. Okay. So click on the Bluetooth and
here is the connect.
Bluetooth Dot
connect address that block we need to put here.
Okay. It's not coming here. No worries.
No worries. Yes, firstly we need to put the
logic here.
Yes, if then else, okay.
and
it all that and what thing we need
to put here is the list picker.
and
from there we need to.
list picker Dot
selection
the what item has been
selected by the user will connect to that
address. Okay after connecting when we click
on the connect button, we have only two options
other device will be connected with that app or not.
after the connection what we need to do firstly we need
to change the text of the label so
set label.
Content where is the set level text? Okay.
Here, okay.
We need to put it here.
And what we need to change is at text, okay?
And here we need to type.
Connect it and make it
that duplicate.
And here we need to drive.
Not connected, okay.
So after the selection of device, the status
will be changed either. It will be connected or the not connected.
Now. The next thing is open and the close log
status, okay.
so
where we need to click on the button when button clicks what
we need to do here. Okay. So this
is the main stuff click on that and
drag that element here a block.
Sorry not element. Okay, and here we need to put the
control statement.
Sorry, my drag and drop is just making
an issue.
When button dot click okay, so firstly
we need to verify that if the value is open
lock or closed lock because I'm not going to use two
bottles. I'm just going to use the one button, okay.
so here we need to verify the
button value Okay, so
Here we need to verify the stuff.
with the button text if button text
logic
And we need to put here.
if button text
is equal equal to what?
the text
open log. What is that open log? Yes.
Open lock.
So what do we need to do is we need
to send the command to the Bluetooth.
Where is the Bluetooth sand and
sand that
text call the Bluetooth and text and
where is the text?
Here we need to send that and
the value will be the one. Okay,
make it the duplicate and
We are good to go with that and we need
to change it to the zero. Okay, and we'll need
to change the button.
text
is the button text and it comes
here.
Okay.
Sorry with.
Yes, here is this.
And we need put here.
duplicate and
close lock
make the duplicate.
Open lock.
Okay now.
We are ready to work with that app.
So what we have options.
You can use the AI companion for that. We need
to install mitf and water in our device and
it will show us a QR code and we
can access that app by putting that code or scanning that QR code.
Okay, this is the first option. The second is the
emulator and the third option is a USB. So I'm
going to use that but you have option to
build Android app APK and you
can download it and install it. Okay, and you can also build
the Android app until actually I
use that one. So I'm going to use that one. Okay.
Welcome back guys. I actually there is a issue and
Android 12 or later
latest versions that the app should
take the permission to access the Bluetooth. So in
my xiaomi mobile device, actually I
didn't have any issue but in my Samsung mobile device,
it's giving the error regarding
the Bluetooth permission. So firstly we need to
Add the permission system. So when the app
will be turned on on device, it will
ask for the Bluetooth and it will make our operation smooth.
So for that we need to add the
permission. So click on.
The wind screen and
here we need to.
Take the permission when screen initialize, okay and
click on.
and permissions
Where is the section?
Ask for the permission, okay.
And here we have the section the permission.
Parts location. I'm going to delete that.
And going to put a new text here.
And the permission name is Bluetooth underscore.
Connect. Okay, so it will take the permission
when the app.
Will be initialized on the device. So I'm going
to use the AI companion.
to connect with the
MIT app and winter before moving that you
need to install the MIT app
and went to on your mobile devices and then
you have a two option either. You can load your app
by this code or by scanning the QR code. I'm going to use the
QR code to load the app. So just
give me some seconds and then I will be back with the
app.
Welcome back guys. I have opened MIT app
and winter and here we have a two option connect with
the code or scan with the QR code and I'm going
to scan the QR code to work
instantly.
And I have scanned the code.
And within a couple of seconds the app.
Will be loaded to my mobile device.
Yes, and if you see here the Wild app has been
loaded, okay?
The mobile app didn't ask for permission
because I already allotted the Bluetooth
permission. So just click on the select device. And here
we have
a lot of
Devices, okay, and just
click on the Smart Lock.
Yes, the device is off. So I
need to turn on the device because it's
my mistake because I am using
that cable to charge my light device.
So that's why it's giving the error.
Just need to plug my cable.
USB cable another device has been
activated just again select device and click on
the esp32 Smart Lock. And now you see we are
good to go with that. Click on the open and the log
goes back and click on
the close lock and then now lock has been released open
lock and the close and now
this is your custom overlap with
the help of MIT App Inventor. You didn't
need to pay a lot of money to mobile
app developer. You can just fail a beautiful UI
mobile app for your projects.
So guys, this is the complete demonstration
and that's why I
Change my plan from blink app to
the MIT app and whatever because still blink is
the third party app. And by the way, they stop supporting
the Bluetooth and ble. That's why
I made a plan to develop app
in MIT app and windows. So you guys get some cool ideas
how to develop air by joining the
block and it's easy if you spend 10 to 15 minutes or
one hour you will understand how the system works. So this is
easy to select the devices open
close lock, and I hope you guys
will automate your home covers or home tours
or something interesting, please I'll share
your projects with me in the messy box. So guys in
the next video. We're going to talk about pros and the cons of Bluetooth.
So see you in the next video. Have a good day, bye-bye.