Hello All, I am Veeru from ElectronicsInnovation,
I am your host for this episode. In the previous video, we have set up this
LPS8 gateway and register the same on The Things Network. We have also seen that the gateway successfully
connected to the network server and transmitted its status message. We have also explored that what are the event
details included in that status message. In this video we are going to develop a Lora
end node that can be activated in ABP mode with RFM95 module and Arduino UNO to publish
hello electronics innovation world message. as we have discussed earlier the data being
transmitted over the LoRaWAN is encrypted, so we will also see how to decrypt that data
and see what is the exact data present in that data packet. So, Let's see how we can do that. The RFM95 module breakout PCBs which are being
used in this tutorial are sponsored and manufactured by pcbway.com. I would like to take moment and thank pcbway
for sponsoring the video. PCBWay.com has been an essential company that
supports makers like me around the world building professional PCB projects. they also support some of your favorite YouTubers
with their projects. without pcbway, some of the best projects
posted online every day wouldn't be existing/available. I am feeling grateful to Thank PCBWay for
everything they are doing for the maker community. PCBWay.com is an Online PCB manufacturing
Enterprise, which provides all services you need to make Hardware for your IoT or Embedded
Devices. If you have a similar requirement, do check
out their website for more details. The link is in the description below. In the previous video, we have registered
the LPS8 gateway on the TTN and configured the gateway to connect with The Things network
platform. Now we are going to work on the application
section of the TTN platform. Go to the application section and then click
on Add application. The owner will be selected default, if you
want you can change from here. Enter Application ID, this can be an alphanumeric
string but only lower case alphabets are allowed, Then enter Application name, this can be anything. Uppercase alphabets are allowed here. If you want you can also add a description
for the application here. Then click on create an application. That's it, a new application has been created. In this application, we can add our END devices. If you have a ready-made device from any certified
manufacturer, you can add that device here, but we are developing our device, so that
can be added to the manual category. Select the LoRaWAN version, we have to specify
which version on the LoRaWAN our device is using. select MAC1.0.3 then select the operating
frequency. 865-867Mhz selected, as I am from India. Here you have to observe one thing if you
are from India. the frequency plan 865-867Mhz is available
on the MAC1.0.3 or later version only. You will not find the 865-867Mhz frequency
band on MAC1.0.2 or the lower version. Click on this, Select the activation Mode,
Either it is OTAA - Over the air activation or ABP - Activation by personalization in
our case it is ABP. Leave the rest of the settings default and
click on generate DevEUI, Device Address, App session Key, and Network session key. We have to configure our End node with these
credentials. Then click on the register end device. That's it. The device has been created successfully. Let us build the LoRa end node with Arduino
UNO and RFM95 module. Here is the circuit diagram to interface RFM95
with Arduino UNO. After connection, the circuit might be something
like this. Now, It's Time to program the LoRa end node. Visit this git hub page and download the Arduino-lmic
library and then install it using the add zip library feature in the Arduino. After successful installation, you can find
the library in the include library section with the name, IBM LMIC Framework. Now go to the examples from the file menu
and search for the IBM LMIC framework and then open the ttn-abp example. This is the code that we are going to use
for programming the LoRa end node. Before uploading code to the node, we have
to make some changes to work according to our frequency band and registration on ttn. We have to add network session key, appskey,
devaddr here. all the credentials can be found on the ttn. Go to ttn, copy dev address, and past it here. Make sure, the credentials should be in the
same format as mentioned already. don't change them. Then copy the network session key, click on
the view key, click on this to convert the key into the array of hex decimal no, and
make sure it will be in MSB format. copy and replace here. repeat the same process for the app session
key. Let us change this publish message. also, change transmission interval to 15 sec. Then change the pin configurations according
to the circuit diagram. Scroll down and go to the 190th line. Here we have to provide the channel frequency
in which band we are going to operate it. As we can see here, our LoRaWAN operating
frequency is 865-867Mhz... we already know this right??? but what about channels??? how can we derive the channels... Yes, Good question. We cannot select the random channels, there
are already a few channels our gateway supports. so, let us use them. you can find these channels on the Lora log
page. these are the 8 8channels, our gateway can
receive the data. let us configure the same on the device. copy paste All required changes are done, now save this
file with the some name. Don't relax yet, We have to make changes to
a couple of library documents. Go to the library folder open SRC folder,
lmic folder, yeah config.h and lorabase.h we have to make changes in these documents. first, open config.h file, Make sure, eu868
is selected, cfg_sx1276_radio 1, lmic debug level 1, and lmic failure serail uncommented. then save the file. open lorabase.h, scroll down to the 73rd line
and change the channel frequency according to the frequency which we have already configured
on the Arduino program then save the file. Now, come back to Arduino IDE, connect Arduino
UNO with the laptop, select the board Arduino Uno, and port. then click on upload. after successful uploading
open serial port with baud rate 115200, if you see the TX complete text on the serial
monitor, congratulations. your Lora device is transmitting the Lora
data packets. Open ttn, go to gateway live data, as you
can see here gateway received an uplink from the device 26 0B 50 1B, Now go to applications
live data. as you can see here, we have also received
the payload from the device. total of 3 data packets we can see here. we can also see the spreading factor signal
to noise ratio, RSSI of the received data packet. but the payload is not readable. we have sent a hello electronics innovation
world message. but here we are receiving some random data. what could be the problem??? Is there any malfunctioning happened to data??? do you have any idea, why it is happening?? yes... you are right. The data which is being transmitted over the
LoRaWAN is encrypted. Here we are looking at the hexadecimal format
of encrypted messages. now we need to decrypt or convert that message
to a human-readable format. to decrypt the message, go to end nodes, click
on the end node, go to payload formats, choose formatter type javascript, and past this code. don't worry, you can find this code on the
project page which is mentioned in the description of the video. now come back to the ttn application live
data and reload the page. as you can see here, we can see the data inside the data packet. So, this is how we can decrypt the data of
the lorawan data packets. as the data transferred in the encrypted format, the security will
be very high for the data transmission. That's it for this tutorial. we have successfully developed a Lora end
node that can be activated in ABP mode with RFM95 module and Arduino UNO to publish hello
electronics innovation world message. aslo we have successfully decrypted the Lorawan
data packets. Stay tuned to electronics innovation for the
more interesting project on lorawan communications. see you on the next video... bubyeee