How to integrate LoRaWAN gateway

Revision as of 14:10, 24 April 2022 by Registered User

1. Article purpose[edit source]

The purpose of this article is to explain how to integrate the LoRa Concentrator Module with STM32MP157F-DK2, managed by Linux on Cortex®-A7. This will help to configure STM32MP1 discovery kit either as a loragateway or running the ChiprStack open source component for LoRaWAN networks.

2. Prerequisites[edit source]

2.1. Hardware prerequisites[edit source]

  • STM32MP157F-DK2
STM32MP157F-DK2

For more information about the STM32 discovery board and how to start it up, jump to this section
Getting_started/STM32MP1_boards/STM32MP157F-DK2


  • RAKMODULES

Below is the picture of RAK modules File:Lorascreenshot 1.jpg File:Lorascreenshot 1.jpg

  • RAK EXTENSION
  • NUCLEO-WL55JC1
NUCLEO-WL55JC1

For more information about the STM32WL nucleo kit and refer the webpage
NUCLEO-WL55JC

2.2. Software prerequisites[edit source]

3. Hardware setup[edit source]

The lora concentrator module should be connected to 40 pin connector

3.1. ST hardware[edit source]

3.2. Additional hardware[edit source]

4. Software setup[edit source]

5. Building the distribution package[edit source]

Step 1. Download and compile the STM32MP1 Distribution Package
Step 2. Follow the default Example_of_directory_structure_for_Packages suggested by ST wiki page to follow this document synchronously.
Step 3. Download and clone the layer "meta-st-loragateway" to "meta-st" layer.

 cd $HOME/STM32MPU_workspace/STM32MP15-Ecosystemv3.1.0/Distribution-Package/openstlinux-5.10-dunfell-mp1-21-11-17/layers/meta-st
git clone https://github.com/amitemrkumar/meta-st-loragateway

Step 4. Set up the build configuration.

 DISTRO=openstlinux-weston MACHINE=stm32mp1 source layers/meta-st/scripts/envsetup.sh

Step 5. Add the meta-st-loragateway layer to build configuration.

 bitbake-layers add-layer ../layers/meta-st/meta-st-loragateway/

Step 7. Build your layer separately and then build the complete Distribution Layer.

 bitbake st-image-weston

Note: Building the Distribution Package for the first time may take several hours. However, it takes only few minutes to build meta-nfc6 layer and install the executables in the final images. Once the build is complete, the images are present in the following directory: build-<distro>-<machine>/tmp-glibc/deploy/images/stm32mp1.

Step 8. Follow instructions on ST wiki page:Flashing the built image to program the new built images onto the Discovery kit

6. How to run the chirpStack components on STM32MP157F-DK2[edit source]

Step 1. Connect the minicom to the /dev/ttyACM0 device.

 minicom -D /dev/ttyACM0

Step 2. Read the ipaddress of the STM32MP157 discovery kit.

 ifconfig

Step 3. Connect the STM32MP157F-DK2 board using ssh connection.

 ssh root@xxx.xxx.xxx.xxx

Step 4. Run the stm32mp1-config.sh script to initiate the gateway configuration .

  cd /usr/local/lorawan-gateway
 ./stm32mp1-config.sh 

Step 5. Run the stm32mp1-config.sh script to initiate the gateway configuration .

Loragatewayimage 1.png

Step 6. Select chirpstack option and click ok to proceed further.

Loragatewayimage 2.png

Step 7. Select concentrator selection option and click ok to proceed further.

Loragatewayimage 3.png

Step 8. Select RAK2287 SPI with GPS to configure the rak2287 module and click ok to proceed further.

Loragatewayimage 4.png

Step 9. Select EU868 ISM band and click ok to proceed further.

Loragatewayimage 5.png

Step 10. Select EU863_870_1 and and click ok to proceed further.

Loragatewayimage 6.png

Step 11. Wait to complete the frequency configuration.

Loragatewayimage 8.png

Step 12. Frequency channel details will be displayed . Click ok to proceed further.

Loragatewayimage 7.png

Step 13. If frequency configuration is correct then click Yes to proceed further else click No to redo the frequency configuration.

Loragatewayimage 9.png

Step 14. Please wait to complete the Frequency configuration. Once it completes then click to proceed with next step.

Loragatewayimage 10.png




7. How to run the LoRaWAN gateway application on STM32MP157F-DK2[edit source]

Step 1. Read the ipaddress of the STM32MP157 discovery kit.

 minicom -D /dev/ttyACM0
root@stm32mp1:~#
root@stm32mp1:~# ifconfig