You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/hardware/04.pro/boards/portenta-x8/tutorials/multi-protocol-gateway/content.md
+17-17Lines changed: 17 additions & 17 deletions
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ description: 'This tutorial shows on how to setup multi-protocol gateway environ
4
4
tags:
5
5
- containers
6
6
- Docker
7
-
- LoRa
7
+
- LoRa®
8
8
- WiFi
9
9
- Sensor
10
10
- RPC
@@ -20,12 +20,12 @@ hardware:
20
20
21
21
Portenta X8 has the NXP® i.MX 8M Mini MPU (Linux) and STM32H747XI dual Cortex®-M7+M4 32bit low power ARM® MCU (Arduino) stacked together and can be used to design different work loads for these two different microprocessors. We will use the Portenta Max Carriers onboard CMWX1ZZABZ-078 LoRaWAN® module from Murata®, and the WiFi connectivity from Portenta X8 to build a Multi-Protocol Gateway.
22
22
23
-
In this tutorial we will go through the steps on how to setup both the Linux and Arduino side. A device collecting sensor data will transfer the data via WiFi, receive the data and exchange it between the Arduino and Linux layers, to then use LoRaWAN to finally send the information to The Things Network. We will also configure and expose a local communication lane to further expand its capability if a local sensor is desired.
23
+
In this tutorial we will go through the steps on how to setup both the Linux and Arduino side. A device collecting sensor data will transfer the data via WiFi, receive the data and exchange it between the Arduino and Linux layers, to then use LoRaWAN® to finally send the information to The Things Network. We will also configure and expose a local communication lane to further expand its capability if a local sensor is desired.
24
24
25
25
## Goals
26
26
27
27
- Build an Arduino layer script using RPC to handle sensor readings or data traffic on Portenta X8.
28
-
- Build a multi-protocol script to manage MQTT protocol and LoRa connectivity to handle data traffic on the Linux layer of Portenta X8.
28
+
- Build a multi-protocol script to manage MQTT protocol and LoRa® connectivity to handle data traffic on the Linux layer of Portenta X8.
29
29
- Assemble both layer scripts to build an operational multi-protocol gateway using Portenta X8 and Max Carrier.
30
30
31
31
### Required Hardware and Software
@@ -49,7 +49,7 @@ The Portenta X8 paired with the Portenta Max Carrier has the potential to create
49
49
50
50
- WiFi (MQTT Protocol)
51
51
- Bluetooth Low Energy
52
-
- LoRaWAN (The Things Network)
52
+
- LoRaWAN® (The Things Network)
53
53
- NB-IoT & Cat-M1
54
54
55
55
The following image illustrates how a overall multi-protocol gateway works with Portenta X8 and Max Carrier as the gateway system.
@@ -75,9 +75,9 @@ Hence the multi-protocol architecture will process and manage the data traffic w
75
75
76
76
### Linux Layer
77
77
78
-
It is important to understand that **all networking processes are made within the Linux layer**. All network processes that are WiFi, Bluetooth low energy, LoRa, NB-IoT, and Cat-M1. We will focus on using WiFi with MQTT protocol, and LoRa connectivities to establish a multiple protocol gateway.
78
+
It is important to understand that **all networking processes are made within the Linux layer**. All network processes that are WiFi, Bluetooth low energy, LoRa®, NB-IoT, and Cat-M1. We will focus on using WiFi with MQTT protocol, and LoRa® connectivities to establish a multiple protocol gateway.
79
79
80
-
The Portenta X8 provides WiFi connectivity and the Portenta Max Carrier provides a LoRaWAN module that can help us communicate with The Things Network. We will use the MQTT protocol to receive the sensor data transmitted by an end device.
80
+
The Portenta X8 provides WiFi connectivity and the Portenta Max Carrier provides a LoRaWAN® module that can help us communicate with The Things Network. We will use the MQTT protocol to receive the sensor data transmitted by an end device.
81
81
82
82
We will use a python script that will configure and handle the connectivity modules and its sensor data. The RPC calls will be used to expose the received sensor data to the Arduino layer, setting up data exchange configuration to further expand the capability of the Portenta X8 and Max Carrier. The process can also be done vice-versa if the Arduino layer is to transmit the data to the Linux layer from the local end-device.
83
83
@@ -87,13 +87,13 @@ Now that we know the roles of Arduino and Linux layer, we will need a clear pict
87
87
88
88
## Instructions
89
89
90
-
To showcase the ability of the Linux layer and Arduino layer extended by M4 Core, we will build a mult-protocol gateway that will receive MQTT protocol packets using EMQX as the broker, retrieve the data from a local sensor attached to Portenta via RPC mechanism, wrap the data together and send to The Things Netowork using LoRa connectivity within Cayenne Low Power Payload Encoder.
90
+
To showcase the ability of the Linux layer and Arduino layer extended by M4 Core, we will build a mult-protocol gateway that will receive MQTT protocol packets using EMQX as the broker, retrieve the data from a local sensor attached to Portenta via RPC mechanism, wrap the data together and send to The Things Netowork using LoRa® connectivity within Cayenne Low Power Payload Encoder.
91
91
92
92
This will help you get a better understanding of how the Portenta X8 and the Portenta Max Carrier helps you develop a multi-protocol gateway.
93
93
94
94
### Hardware Setup
95
95
96
-
First things first, we will need to configure the hardware to be able to develop and work on the Multi-Protocol gateway. We will attach the Portenta X8 to the Portenta Max Carrier with High-Density Connectors, and we will make sure to attach an antenna for LoRa connectvity. The Portenta X8 also needs to have the WiFi antenna attached to it.
96
+
First things first, we will need to configure the hardware to be able to develop and work on the Multi-Protocol gateway. We will attach the Portenta X8 to the Portenta Max Carrier with High-Density Connectors, and we will make sure to attach an antenna for LoRa® connectvity. The Portenta X8 also needs to have the WiFi antenna attached to it.
We now have the pre-requisites for the Portenta X8 ready, but as we are using the LoRa connectivity, we will need a platform that has the capability to receive data transmitted from the Portenta X8 and Max Carrier. **The Things Network** will be the platform we are going to use communicate using LoRaWAN. On the platform, we will need to create an application to add the Portenta Max Carrier as an End-Device.
145
+
We now have the pre-requisites for the Portenta X8 ready, but as we are using the LoRa® connectivity, we will need a platform that has the capability to receive data transmitted from the Portenta X8 and Max Carrier. **The Things Network** will be the platform we are going to use communicate using LoRaWAN®. On the platform, we will need to create an application to add the Portenta Max Carrier as an End-Device.
146
146
147
-
When adding the End-Device, at the moment we will have to use the **Manual** option. The Portenta Max Carrier will be added under Arduino SA in the near future to be included in the LoRaWAN Device Repository. The LoRaWAN version and parameters compatible with the Portenta Max Carrier are as follows. The frequency plan will depend on the region in which you are going install the device.
147
+
When adding the End-Device, at the moment we will have to use the **Manual** option. The Portenta Max Carrier will be added under Arduino SA in the near future to be included in the LoRaWAN® Device Repository. The LoRaWAN® version and parameters compatible with the Portenta Max Carrier are as follows. The frequency plan will depend on the region in which you are going install the device.
***To learn more about LoRa and LoRaWAN, please have a look at our [Arduino Guide to LoRa® and LoRaWAN®](https://docs.arduino.cc/learn/communication/lorawan-101). Additionally, if you wish to learn on how to properly setup the End-Device in The Things Network, please read [this tutorial](https://docs.arduino.cc/tutorials/mkr-wan-1310/the-things-network) reference***
151
+
***To learn more about LoRa® and LoRaWAN®, please have a look at our [Arduino Guide to LoRa® and LoRaWAN®](https://docs.arduino.cc/learn/communication/lorawan-101). Additionally, if you wish to learn on how to properly setup the End-Device in The Things Network, please read [this tutorial](https://docs.arduino.cc/tutorials/mkr-wan-1310/the-things-network) reference***
152
152
153
153
Let us now dive into developing a multi-protocol gateway using Portenta X8 and Max Carrier!
154
154
@@ -243,7 +243,7 @@ mqtt_username = 'emqx'
243
243
mqtt_password ='public'
244
244
```
245
245
246
-
These 2 parameters are required to establish a connection with The Things Network. The `APP_EUI` and `APP_KEY` are required to be configured, as they are provided from The Things Network for example or from the LoRaWAN platform that you may try extablishing connection to. Additionally, the `DEV_EUI` will be predefined as the device will request and apply the EUI. However, if it requires to use different `DEV_EUI`, you can make the change in this section.
246
+
These 2 parameters are required to establish a connection with The Things Network. The `APP_EUI` and `APP_KEY` are required to be configured, as they are provided from The Things Network for example or from the LoRaWAN® platform that you may try extablishing connection to. Additionally, the `DEV_EUI` will be predefined as the device will request and apply the EUI. However, if it requires to use different `DEV_EUI`, you can make the change in this section.
247
247
248
248
```python
249
249
# Obtained during first registration of the device
For LoRa connectivity to establish communication with The Things Network, we are going to use the Cayenne Low Power Payload Encoder as part of the process in this build.
310
+
For LoRa® connectivity to establish communication with The Things Network, we are going to use the Cayenne Low Power Payload Encoder as part of the process in this build.
311
311
312
312
```python
313
313
...
@@ -367,7 +367,7 @@ void loop(){
367
367
}
368
368
```
369
369
370
-
The sketch above will help to expose and transfer the data that is processed within the Linux side. Transferring data to Linux side can be seen as a direct communication, as the sensor connected and monitored via Arduino side will send this data over LoRa connectivity. For this build, we are going to use Analog readings to emulate the functionality.
370
+
The sketch above will help to expose and transfer the data that is processed within the Linux side. Transferring data to Linux side can be seen as a direct communication, as the sensor connected and monitored via Arduino side will send this data over LoRa® connectivity. For this build, we are going to use Analog readings to emulate the functionality.
371
371
372
372
Additionally by exposing, it means you will bring forth the data received within the Linux side to the Arduino side to feed the local-device as a control input. It can be used to display the data if you wish to for instance. This can be implemented in this script if you wish to further develop your desired multi-protocol gateway.
373
373
@@ -492,7 +492,7 @@ After a successful container build, we will have to make the image run. To do th
492
492
#Multi_Protocol_Gateway_X8 sudo docker-compose up
493
493
```
494
494
495
-
Finally, you will have the multi-protocol gateway running, in which it uses WiFi and LoRa connectivity. And also RPC for exchanging data between its layers. However, there are cases where you wish to make changes by adding more functionalities, such as including Cat-M1 or NB-IoT to expand its communication spectrum, for this you will need to stop the image. To stop the image from running, you can use following command.
495
+
Finally, you will have the multi-protocol gateway running, in which it uses WiFi and LoRa® connectivity. And also RPC for exchanging data between its layers. However, there are cases where you wish to make changes by adding more functionalities, such as including Cat-M1 or NB-IoT to expand its communication spectrum, for this you will need to stop the image. To stop the image from running, you can use following command.
496
496
497
497
```
498
498
#Multi_Protocol_Gateway_X8 sudo docker-compose down
@@ -515,10 +515,10 @@ If you are curious about what to expect from the build we have made in this tuto
515
515
516
516
## Conclusion
517
517
518
-
In this tutorial you have learned how to set up a Multi-Protocol Gateway composed of MQTT protocol, RPC, and LoRaWAN, by using the Portenta X8 and the Portenta Max Carrier. You have built the gateway that will connect the The Things Network to send the desired data. Also, the gateway is capable of exchanging data between Arduino and Linux layer using RPC, in which you have exposed the ports to be able to receive data from the local sensor to be sent directly to The Things Network.
518
+
In this tutorial you have learned how to set up a Multi-Protocol Gateway composed of MQTT protocol, RPC, and LoRaWAN®, by using the Portenta X8 and the Portenta Max Carrier. You have built the gateway that will connect the The Things Network to send the desired data. Also, the gateway is capable of exchanging data between Arduino and Linux layer using RPC, in which you have exposed the ports to be able to receive data from the local sensor to be sent directly to The Things Network.
519
519
520
520
### Next Steps
521
-
- Now that you have established a multi-protocol gateway, using WiFi and LoRaWAN connectivity, expand the gateway's capability by adding other connectivity types such as Cat-M1 and NB-IoT
521
+
- Now that you have established a multi-protocol gateway, using WiFi and LoRaWAN® connectivity, expand the gateway's capability by adding other connectivity types such as Cat-M1 and NB-IoT
522
522
- Expand functionalities for data processing using RPC while using multi-protocol architecture.
0 commit comments