STM32 E22900T22D LoRa Transceiver Module and Range Test

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
there are many Lora wireless communication modules out there to choose from but which one is the right choice to go with the module that I've used made wireless communication a piece of cake even with long range tests today in this video I will be sharing with you guys my experience with a22 Lora module from ebite where I've implemented a sketch that leads to stm32 microcontrollers exchange dummy data wirelessly I've also implemented three rtos and circle buffer algorithm for data management we are going to exchange data over air today so without any further Ado let's Jump On In [Music] turn your dream project into reality with PCB way I've personally used their services to produce my own prototype for future iot projects ordering your own PCB has never been easier before with a lot of features they also have open source community so there are many projects to have a look at link is in the description alright so here's my setup as you can see here I have two different stm32 motor controllers where here I have the stm32 f411 cortex M4 and here I have the stm32 f103 cortex M3 and as you can see both they are connected over uart to this Laura module so they can communicate wirelessly over Laura over 868 megahertz band and as you may have noticed the lotto module is connected over uart to my MCU so the commands and the packets that should be transmitted over Laura are sent by the hosting MCU and currently these mcus are running the same code I have prepared a ping pong wirelessly communication firmware that's loaded to this stm32 model controller so basically when a message is received wirelessly the onboard LED will be toggled and with the wireless communication stops the LED toggling will stop so let me show you a demonstration so here let me press on the reset button so I can stop the communication as you can see here the green LED is stopped and when I release the reset the communication will go back again actually inside the firmware to manage everything I've integrated the free artos so this is also a plus in our firmware all right so now let's take this device outside to test its performance alright so here I am I'm going to test this loader module outside to see if it can communicate at least for one for one kilometers so I'm testing this e22 900 t22d Laura module so as you can see now this is from the Ping Punk test as you can see since the LEDs are toggling they are exchanging ping pong messages so the Lora communication is continuing but this is a power bank uh turns off once a while so yes I'll go to that side of the island to test this module so let's see okay so right now I came to the other side of the island and the module is currently communicating as you can see the blue LED is toggling now and then because the ping pong messages is being exchanged the other module is located right over there uh I can't tell actually but currently the distance now between the two of the module is around one kilometer yeah it's actually hard to hold both the phone and the module anyways so yes the communication distance is okay this is not the maximum range test but it can communicate wirelessly with a good distance okay so right now let's go back and continue with our tutorial okay so here we are with the Lora module of configuration I'm using this software that's provided by the manufacturer company of the module and so in order to use this software all I've done is that I hook it up a TTL converter to my module to the RX and TX pin of it and connected the m0 to ground and M1 to the VCC in order to access the configuration mode of the module so when I do this command I can read the values of the configuration like the about rate parity the communication speed the packet size of the module so of course I can change these parameters I adjusted them the way they are right now so here I'm using the fixed mode I'm not using the broadcasting mode actually there's one thing I want to mention here is related to the a rate or the communication speed when you are about this parameter you can obtain higher communication range so I wanted to do an outdoor test so I used a relatively low value like this other than that these parameters are related to the sleep mode I'm not using sleep mode right now the a LBT is related to monitoring before transmission so if the wireless channel is available for data transmission the transmission will start after that so if this option is activated there will be a delay before the actual transmission occurs on the force here we have device address the communication Channel network ID and the key and here we can see the values of the internal memory of the module we can see the address of this registers right over here all right so here are the commands that are used in order to access the Lora module memory so here we have the set register command read resistor set temporary registers and wireless configuration so you can either let your MCU configure the module all over uart using these commands or you can use this firmware which which is actually using the same commands so I'm going with the easy way because this is a good visualization for things all right so now let's have a look at the data transmission and reception part of this module it's actually quite simple and straightforward there are actually two modes of data transmission the fixed one and broadcast so here we can see in the fixed packet first of all we have the target address and the target Channel and then we have the data that we want to transmit so here the communication will be between only two devices whereas in the broadcast mode the address is going to be FF and every device that has the same channel will receive the data transmitted from the transmitter so in my case I'm going to stick with the fixed mode because I have only two devices alright so here's the firmware that's running on the stm32 more controller where I have integrated the three rtos I may talk about the free articles integration to cms2 Firmware in a separate tutorial Solas carry on so here starting from the main of course first of all I have the clock configuration high level initialization initialization of course you know that these are generated from the cube MX of the stm32 let's have a look at the activated the peripherals so yes here we have the cube IDE as you can see here I have the single wire peripheral is activated for debug so here I have two GPI opens and that's going to select the operation mode of the Lora module and here I have the uart pins TX and RX here's the clock and here I have the onboard LED GPI open and there are the configured peripherals so let's have a look at the clock configuration of course I'm using here the high speed external clock source and of course I'm using the maximum system clock which is uh 100 megahertz so yeah that's all related to the MCU configuration let's get back to our main so first of all here we have the loadout module initialization function where I'm passing the uart Handler dma transmission function your charge reception with dma package receive callback and here are the configuration functions these are nothing but gpio selection functions so here I have for both the transceiver mode and the configuration mode for the learner module that we have so I'm actually doing that because I want to separate the library that's going to use to interface the Laura module that is E20 to 900 T 22d so I have no dependency in my code so this library is going to use the functions that are passed over the initialization process so you can use it no matter what your MCU is so here we have pointer functions and after that here I'm having two pointers that are assigned to the dma buffer which are Global offers and here I'm calling the transceiver mode function so now the GPS pins for the m0 and M1 are set to let the Laura module operate in transceiver mode and here I'm starting the transmission and here I'm starting the package reception of our uart because I've already passed the corresponding function from my main so the dma reception can start from this point and actually whenever a packet is received over Ur to the MCU the following callback will be executed we have it right over here so when this function is called inside the bucket reception callback we have here the size of the packet is passed and here's the pointer that's pointing at the reception buffer of the dma copying the value to the circle buffer that I have in order to keep the packets inside the ram so I can access them anytime I want which is the purpose of using Circle buffer which is a quite useful library that I've implemented over here so here I have the enqueue function in order to store a new packet received to my MCU and whenever my MCU is ready to process this data I can call the DQ function so I can read from the circle buffer so this Library will make my system work as fifo first and first out so no packet can be lost during this process alright so let's get back to our library implementation of course here we have covered the part that's related to the package reception so let's have a look at the packet transmission where I have a task that's dedicated for a packet transmission and we have it over here so first of all this task runs once every one second and here I'm selecting the packet size that's going to be transmitted over uarts which is a ping message for characters and then here I'm selecting the receiver address which is nine of course the module settings can be either done over firmware or you can connect a TTL converter and hook it up to your module and configure it from the firmware that we have have discussed at the beginning so the address was said to be nine and the communication channel was said to be 12 hex which is 18 decimal so here this task will run once every one second and the packet pink will be transmitted over Lora to the receiver side so here in the transmission function we see that the necessary parameters are put inside this packet Handler so here I am selecting the address until I'm selecting the communication Channel passed from the function parameter and then I'm copying the data packet content to the data buffer and then the whole packet Handler is put inside the circular buffer so I can process it later on for transmission and this is actually done inside the module Handler and we can have a look at it from here so what this function does is actually it checks if there's data inside the transmission circular buffer and data inside the reception Circle buffer so we were talking about the transmission buffer if there is data we check if the port is ready so here we are checking if there is no data being transmitted and then we read the data that we had put inside the circular buffer we copy it to the dma buffer and we start the transmission so you will notice that the Lora manager function is put inside the task that's running continuously and we can have a look at it from here in the task Handler so this function runs every 100 millisecond to check if there is data inside the circular buffers in order to process them okay so right now I have my logical and Azure hooked up to the uart TX and RX pins of my MCU which is also connected to the lower module and here we have the packets transmitted and received over Laura wirelessly of course so now let's zoom in to one of the packets so if we zoom into this packet here we have the pink packet which is sent by the transmitter of course the first two bytes are the address byte of the receiver side so if we have a look at the hex yes so this is nine and the channel is 18. that the communication is going on and here we have the four bytes of the data that's being transmitted which is nothing but a ping message and as a response in the receiver side it's responding with Punk message so since we are in the transmitter side here we can see only the received the message and it's a phone message all right that's all about this tutorial this brings me to the end of it I'll be sharing all the related materials in my GitHub repository you will find its Link in the video description if you have learned something new today please like this video share it among your friends and tell them about useful Electronics stay tuned for the upcoming tutorial and bye bye
Info
Channel: Useful Electronics
Views: 25,118
Rating: undefined out of 5
Keywords: stm32, stm32cubeide, stm32 programming, useful electronics, learn stm32, stm32 embedded, stm32 development, stm32 tutorial, lora, lora long range, lora range test, lora km, arduino lora, stm32 lora, lora module range, E22900T22D, lora project, lora long distance, stm32cubeide tutorial, stm32 uart, stm32 dma, stm32 project, lora long distance test, lora module 868mhz, lora module antenna, lora module code, stm32f4, stm32 black pill, stm32f1, ebyte, STM32 E22900T22D, sx1262
Id: fPgSf5HOfO8
Channel Id: undefined
Length: 15min 16sec (916 seconds)
Published: Sat Mar 18 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.