it's now the LORA sending and receiving
the message
so we have a dragino LORA shield
module you can use this with an Arduino
and before we start using this we have
to know the frequency used by this
module so it's already checked in the
backside that it's used 433 megahertz
maybe you can use another frequency for
another LORA and you can check on the
bottom side like this so to communicate
we need at least two LORA and two
Arduinos and now we can start attach the
LORA shield to the Arduino you can
attach this by press the LORA shield to the arduino just like this make sure that
every pin is connected to the arduino so
you can press gently and yes it's already
connected and do the same for the other
Arduino
now we can plug the USB cable to the Arduino
and after that we can start program the
Arduino and the LORA shield before we
start to program the Arduino make sure
that the LORA shield is already turned
on by looking at the corner and it
should be yellow LED is already light up
like this it's on the corner the yellow
LED is a light up so before we continue
the video don't forget to Like and
subscribe and ring the bell
to this channel to make us more
enthusiastic to make another tutorial
video
okay now we can start the programming by
open the arduino ide
so in this program we will make two
program the first is for the client or
the sender and the second is for the
server or the receiver but we can make
the program is bi-directional so you can
send and receive at the same time okay
we make the client or the sender first
you can copy the program in the link
description below so before but before
make the program we have to edit the
frequency of the LORA in the library
this is important because if you not
edit the frequency you won't be able to
use this LORA okay so you need to find
your library open the Radiohead library
and if you didn't have one you have to
download the library first you can also
delete the library in the link below
okay you have to search for the error
it's RH_RF95.CPP
and find the function named set_frequency so I will search set
frequency this I already find and change according to your LORA
frequency so it's 433.0 and then save
the file after you save the file you can
continue to make the program I already
make the client program in the
description below you can copy and
before that make sure your com is the
one arduino for the client or for the
server because now we have two Arduino
so you have to make one as the client
and one as the server so this is my
program and you can send anything to the
server and this is the text that we want
to send to the server
hello I'm from LORA okay
you can edit everything you want and in
this sample we have just used a hi I'm
from LORA now we can upload this
program and save the name first
you can save the name with anything you
want okay it's uploading now
it's take long time to upload to arduino
okay it's done uploading now we can test
by open the serial monitor
so this is happen if your server is
already turned on but in this tutorial I
will just turn off the server so this
server should be not by replying our
message okay I'll upload the blank for
server so the server is not reply
okay and I will open another Arduino
instance so you can make sure that yeah
another Arduino is uploading in another
com because if we are not open another
Arduino IDE we can not use the different
com to upload through different action
okay see this is happen when the server
is not ready
so I already disconnect the server and
we can now try program the server
okay I open the another Arduino IDE so
that the comport is different from the
first if you will have to open another
Arduino IDE and just click new file you
will not able to upload two different
comport so now we have two arduino IDE the
left side is for the client and the
right side is for this server so I
already like this problem and this is
what will we send back to the client
hello back to you and make sure that we
choose the different comport what the
client it's com 5 so for this server it
should be different now we can upload the
sketch and save the program
okay after the server is done
uploading we can now check the serial
monitor and see what happened so in serial monitor of the server we will get
the message from the client it's hello
I'm from LORA
so the communication is fine it's
already works and this is what we see in
the client side it's a message from the
server hello back to you so now
we have the works communication between to
LORA and Arduino now if you have the
question how if we want to send a
sensor data to the server so we need a
little trick here because it can't just
send a string variable some sensor to
generate the integer value so we have to
send the integer to different variable
first
okay we can read a sensor using an
analog read so imagine you have a analog
sensor so you with the sensor by make variable its name sensor value and
then  we just analog read at A0
and then this is the trick to send the
data using LORA you can't send an integer
value so you have to convert the integer
to a char and convert data to char
so we make a char variable named data
and using the itoa fuction to
convert the integer to char so I will
convert the sensor value to variable
name data then we can some data in char
variable so it just like this
and we can upload this new sketch and
look what happened so before we upload
and will monitor the sensor values
so I will just print the value in client
and make sure that the values sent is
exactly same with the value in the
client make sure that the data is sent
without wrong data
okay we can upload the sketch and this
is what happened we already have this
sensor value on the left and sensor sent
on the right side so it's clearly it's
work fine
okay I think that this our tutorial
about LORA see you in the next tutorial
bye bye
