lora_dynamic_phy_layer_example
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
lora_dynamic_phy_layer_example [2021/06/23 17:38] – pesteve | lora_dynamic_phy_layer_example [2021/07/08 11:35] (current) – pesteve | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | # GNU Radio benchmark example with docker | + | # GNU Radio LoRa PHY layer for MAC experimentation |
- | This tutorial executes a LoRa transmission between a node and a gateway using docker in CorteXlab, transmitting dummy packets between them. | + | This tutorial executes a LoRa transmission between a node and a gateway using docker in CorteXlab, transmitting dummy packets between them. |
- | This implementation stands on the original | + | It shows how to use the interface of a plug and play complete |
- | In this tutorial, we will first deploy on CorteXlab | + | This implementation stands on the original LoRa PHY version made by [[https:// |
+ | |||
+ | In this tutorial, we will first deploy on CorteXlab | ||
## Example upper layer/ | ## Example upper layer/ | ||
Line 11: | Line 13: | ||
### Docker | ### Docker | ||
- | In this tutorial, we will use the docker image found on [Dockerhub](https:// | + | In this tutorial, we will use the docker image available |
- | Thanks to docker, it is possible to deploy a suitable environment | + | Thanks to a docker |
### Create the scenario | ### Create the scenario | ||
Line 49: | Line 51: | ||
node14: | node14: | ||
container: | container: | ||
- | - image: | + | - image: |
command: / | command: / | ||
node16: | node16: | ||
container: | container: | ||
- | - image: | + | - image: |
command: / | command: / | ||
</ | </ | ||
Line 134: | Line 136: | ||
In order to run this example you should launch 4 terminals: 2 for each USRP. Therefore, use the same `ssh` command to connect to the node 14 or 16 on each of the 3 remaining terminals. | In order to run this example you should launch 4 terminals: 2 for each USRP. Therefore, use the same `ssh` command to connect to the node 14 or 16 on each of the 3 remaining terminals. | ||
- | The part we are intersted | + | The part we are interested |
< | < | ||
Line 163: | Line 165: | ||
:warning: Both `udp_BS.py` and `udp_Node.py` have to be run with python3, whereas `lora_dyn_node` has to be run with python2. | :warning: Both `udp_BS.py` and `udp_Node.py` have to be run with python3, whereas `lora_dyn_node` has to be run with python2. | ||
- | Enter the following commands on the specified terminal to begin the experiment: | + | Open two terminals on each of the two nodes through SSH. The cortexlab node 14 will be used as the LoRa node and the cortexlab node 16 as the base station. |
< | < | ||
- | # From node 14 - on the 1st terminal, refered to as 14-a | + | # From node 14 - on the 1st terminal, refered to as NODE.phy |
root@mnode14: | root@mnode14: | ||
</ | </ | ||
< | < | ||
- | # From node 14 - on the 2nd terminal, refered to as 14-b | + | # From node 14 - on the 2nd terminal, refered to as NODE.up |
root@mnode14: | root@mnode14: | ||
</ | </ | ||
< | < | ||
- | # From node 16 - on the 3rd terminal, refered to as 16-a | + | # From node 16 - on the 3rd terminal, refered to as BS.phy |
root@mnode16: | root@mnode16: | ||
</ | </ | ||
< | < | ||
- | # From node 16 - on the 4th terminal, refered to as 16-b | + | # From node 16 - on the 4th terminal, refered to as BS.up |
root@mnode16: | root@mnode16: | ||
</ | </ | ||
Line 187: | Line 189: | ||
#### Send and receive messages | #### Send and receive messages | ||
- | On the 14-b terminal and the 16-b one, first choose your UDP TX and RX port. On CorteXlab | + | On the NODE.up |
- | Then enter one of the following keywords to change the corresponding parameter if needed on the 14-b terminal. | + | Then enter one of the following keywords to change the corresponding parameter if needed on the NODE.up |
``` | ``` | ||
Line 203: | Line 205: | ||
Enter the new value, then type `send` to send this new parameter to the physical layer. If a new `MSG` value is sent to the physical layer it is transmitted to the base station, which should respond with an acknowledgment. | Enter the new value, then type `send` to send this new parameter to the physical layer. If a new `MSG` value is sent to the physical layer it is transmitted to the base station, which should respond with an acknowledgment. | ||
- | For example, try running the following commands on terminal | + | For example, try running the following commands on terminal |
< | < | ||
Line 217: | Line 219: | ||
</ | </ | ||
- | Check out the results on terminal | + | Check out the results on terminal |
< | < | ||
Line 264: | Line 266: | ||
</ | </ | ||
- | Check out the results on terminal | + | Check out the results on terminal |
< | < | ||
Line 285: | Line 287: | ||
* The first line confirms that the message " | * The first line confirms that the message " | ||
* The node then waits for an acknoledgment from the base station and enters receiving mode. | * The node then waits for an acknoledgment from the base station and enters receiving mode. | ||
- | * The next ones concern the received acknoldgement. Before understanding them, check out the other terminals, starting with terminal | + | * The next ones concern the received acknoldgement. Before understanding them, check out the other terminals, starting with terminal |
< | < | ||
Line 303: | Line 305: | ||
</ | </ | ||
- | This confirms that the physical layer received a message " | + | This confirms that the physical layer received a message " |
< | < | ||
Line 329: | Line 331: | ||
On this last terminal, you should first see these information, | On this last terminal, you should first see these information, | ||
- | This acknoledgment is then sent by the physical layer as indicated by the TX UDP line on terminal | + | This acknoledgment is then sent by the physical layer as indicated by the TX UDP line on terminal |
< | < | ||
Line 348: | Line 350: | ||
## Customized experiment | ## Customized experiment | ||
- | This experiment is quite basic, even though it demonstrates how to connect an upper layer to the dynamic LoRa physical layer and to change the physical layer parameter. The node only sends a message and waits for eternity | + | This experiment is quite basic, even though it demonstrates how to connect an upper layer to the dynamic LoRa physical layer and to change the physical layer parameter. The node only sends a message and waits for an acknoledgment of the base station. The purpose of the physical layer is to be used by more complex upper layers. |
In this part, we will see how to modify the upper layer and redeploy it on CorteXlab. If you want to develop your own upper layer, you can refer to this tutorial to deploy it. | In this part, we will see how to modify the upper layer and redeploy it on CorteXlab. If you want to develop your own upper layer, you can refer to this tutorial to deploy it. | ||
Line 360: | Line 362: | ||
< | < | ||
- | you@yourpc: | + | you@yourpc: |
- | you@yourpc: | + | you@yourpc: |
</ | </ | ||
Line 380: | Line 382: | ||
#### Customize the UDP Base Station | #### Customize the UDP Base Station | ||
- | Here, we will just add a simple functionnality to the base station. If the SNR is higher than a threshold, then the GTX of the BS will be reduced, and if it is lower than a second threshold, then the GTx will be augmented. | + | Here, we will just add a simple functionnality to the base station. If the SNR is higher than a threshold, then the transmission gain of the BS will be reduced, and if it is lower than a second threshold, then the gain will be augmented. |
This simulates a simple logic behavior: if the receiving SNR is low, then the acknoledgment should be emitted with a high gain in order to be correctly received by the node. On the contrary, if the receiving SNR is very high, then there is no need to emit with a high gain. | This simulates a simple logic behavior: if the receiving SNR is low, then the acknoledgment should be emitted with a high gain in order to be correctly received by the node. On the contrary, if the receiving SNR is very high, then there is no need to emit with a high gain. | ||
Line 429: | Line 431: | ||
### Deploy the experiment on CorteXlab | ### Deploy the experiment on CorteXlab | ||
- | In order to send this environment on CorteXlab, follow the same procedure as in subsections [[lora_dynamic_phy_layer_example# | + | In order to send this environment on CorteXlab, follow the same procedure as in subsections [[lora_dynamic_phy_layer_example# |
### Results | ### Results | ||
- | You should now follow the same steps as in the first part to connect to the nodes 14 and 16 with four terminals, refered to as 14-a to 16-b, and execute `lora_dyn_node.py`, | + | You should now follow the same steps as in the first part to connect to the nodes 14 and 16 with four terminals, refered to as NODE.phy, NODE.up, BS.phy and BS.up, and execute `lora_dyn_node.py`, |
#### Default GTX | #### Default GTX | ||
- | First send a message with the default GTX on terminal | + | First send a message with the default GTX on terminal |
< | < | ||
Line 447: | Line 449: | ||
</ | </ | ||
- | You should now see the following answer on terminal | + | You should now see the following answer on terminal |
< | < | ||
Line 466: | Line 468: | ||
</ | </ | ||
- | And the following ones on terminal | + | And the following ones on terminal |
- | 16 - a | + | * BS.phy |
< | < | ||
Line 485: | Line 487: | ||
TX UDP : {" | TX UDP : {" | ||
</ | </ | ||
+ | |||
+ | * BS.up | ||
< | < | ||
Line 510: | Line 514: | ||
In this case, the SNR is higher than 90 so the base station GTX is set to 10 instead of 30. | In this case, the SNR is higher than 90 so the base station GTX is set to 10 instead of 30. | ||
- | The acknoledgment is still received correctly by the node as shown in terminal | + | The acknoledgment is still received correctly by the node as shown in terminal |
#### Simulate distance | #### Simulate distance | ||
- | In order to simulate a less ideal situation and reduce the SNR, you can set the node GTX to 5 in terminal | + | In order to simulate a less ideal situation and reduce the SNR, you can set the node GTX to 5 in terminal |
< | < | ||
Line 530: | Line 534: | ||
Look at the answers in the other terminals: | Look at the answers in the other terminals: | ||
- | * 14-a | + | |
+ | * NODE.phy | ||
< | < | ||
Line 548: | Line 553: | ||
</ | </ | ||
- | * 16-a | + | * BS.phy |
< | < | ||
Line 567: | Line 572: | ||
- | * 16-b | + | * BS.up |
< | < |
lora_dynamic_phy_layer_example.1624462715.txt.gz · Last modified: 2021/06/23 17:38 by pesteve