# How to experiment with LoRa PHY layer parameters?

**URL:** <https://www.thethingsnetwork.org/forum/t/how-to-experiment-with-lora-phy-layer-parameters/62472>\
**Category:** Application Development\
**Created:** [April 10, 2023, 1:23pm UTC](https://www.thethingsnetwork.org/forum/t/how-to-experiment-with-lora-phy-layer-parameters/62472 "2023-04-10T13:23:42Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![raghav1197](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/raghav1197/32/44765_2.png) [@raghav1197](https://www.thethingsnetwork.org/forum/u/raghav1197)\
**Post date:** [April 10, 2023, 1:23pm UTC](https://www.thethingsnetwork.org/forum/t/how-to-experiment-with-lora-phy-layer-parameters/62472/1 "2023-04-10T13:23:42Z")

</div>

Hey everyone, I am trying to test the effects of physical layer parameters on its packet reception performance. I am using The Things Uno board as end node and The Things Indoor Gateway.  
I want a general right direction on how to proceed with it, in terms of libraries to use if I want to code in Arduino IDE.  
Thanks in advance.

---

<div class="post-metadata">

**Author:** ![descartes](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/descartes/32/47220_2.png) [@descartes](https://www.thethingsnetwork.org/forum/u/descartes)\
**Post date:** [April 10, 2023, 2:28pm UTC](https://www.thethingsnetwork.org/forum/t/how-to-experiment-with-lora-phy-layer-parameters/62472/2 "2023-04-10T14:28:55Z")

</div>

> [@raghav1197](#):
>
> physical layer parameters on its packet reception

As different code bases have different levels of access to such things, which ones were you thinking of changing in particular?

---

<div class="post-metadata">

**Author:** ![raghav1197](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/raghav1197/32/44765_2.png) [@raghav1197](https://www.thethingsnetwork.org/forum/u/raghav1197)\
**Post date:** [April 10, 2023, 2:42pm UTC](https://www.thethingsnetwork.org/forum/t/how-to-experiment-with-lora-phy-layer-parameters/62472/3 "2023-04-10T14:42:51Z")

</div>

Hey, thanks for your response.  
I want to experiment with spreading factor (SF), coding rate and bandwidth in LoS and nLoS conditions. I have so far figured how to alter the SF using TheThingsNetwork library but I doubt it if I can access bandwidth and coding rate using the same library.

---

<div class="post-metadata">

**Author:** ![LoRaTracker](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/loratracker/32/48502_2.png) [@LoRaTracker](https://www.thethingsnetwork.org/forum/u/LoRaTracker)\
**Post date:** [April 10, 2023, 2:43pm UTC](https://www.thethingsnetwork.org/forum/t/how-to-experiment-with-lora-phy-layer-parameters/62472/4 "2023-04-10T14:43:02Z")

</div>

> [@raghav1197](#):
>
> I am trying to test the effects of physical layer parameters on its packet reception performance.

Eh?

You want to re-configure the LoRa physical layer parameters of the Gateway, to see how it affects its packet reception ?

Sounds more like you ought to be doing this on a LoRa point to point setup, not good to experiment with Gateways.

---

<div class="post-metadata">

**Author:** ![LoRaTracker](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/loratracker/32/48502_2.png) [@LoRaTracker](https://www.thethingsnetwork.org/forum/u/LoRaTracker)\
**Post date:** [April 10, 2023, 2:43pm UTC](https://www.thethingsnetwork.org/forum/t/how-to-experiment-with-lora-phy-layer-parameters/62472/5 "2023-04-10T14:43:45Z")

</div>

> [@raghav1197](#):
>
> I want to experiment with spreading factor (SF), coding rate and bandwidth in LoS and nLoS conditions. I have so far figured how to alter the SF using TheThingsNetwork library but I doubt it if I can access bandwidth and coding rate using the same library.

Bad idea to change Gateway settings like that, dont.

---

<div class="post-metadata">

**Author:** ![raghav1197](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/raghav1197/32/44765_2.png) [@raghav1197](https://www.thethingsnetwork.org/forum/u/raghav1197)\
**Post date:** [April 10, 2023, 2:45pm UTC](https://www.thethingsnetwork.org/forum/t/how-to-experiment-with-lora-phy-layer-parameters/62472/6 "2023-04-10T14:45:24Z")

</div>

no, not with the gateway, i want to configure the parameters at end nodes.

---

<div class="post-metadata">

**Author:** ![descartes](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/descartes/32/47220_2.png) [@descartes](https://www.thethingsnetwork.org/forum/u/descartes)\
**Post date:** [April 10, 2023, 2:45pm UTC](https://www.thethingsnetwork.org/forum/t/how-to-experiment-with-lora-phy-layer-parameters/62472/7 "2023-04-10T14:45:28Z")

</div>

> [@raghav1197](#):
>
> but I doubt it if I can access bandwidth and coding rate using the same library.

I can help you with the results - you will experience 100% packet loss if you change these as the gateway will not be able to hear you.

As @LoRaTracker says, this would really need P2P which isn’t something we discuss / support on this TTI funded forum for TTN

---

<div class="post-metadata">

**Author:** ![LoRaTracker](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/loratracker/32/48502_2.png) [@LoRaTracker](https://www.thethingsnetwork.org/forum/u/LoRaTracker)\
**Post date:** [April 10, 2023, 2:47pm UTC](https://www.thethingsnetwork.org/forum/t/how-to-experiment-with-lora-phy-layer-parameters/62472/8 "2023-04-10T14:47:57Z")

</div>

> [@raghav1197](#):
>
> no, not with the gateway, i want to configure the parameters at end nodes.

Plenty of libraries out there that support point to point LoRa setups.

You did say in the first post that you were using a Gateway, and you cannot, for this type of testing.

---

<div class="post-metadata">

**Author:** ![raghav1197](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/raghav1197/32/44765_2.png) [@raghav1197](https://www.thethingsnetwork.org/forum/u/raghav1197)\
**Post date:** [April 10, 2023, 2:51pm UTC](https://www.thethingsnetwork.org/forum/t/how-to-experiment-with-lora-phy-layer-parameters/62472/9 "2023-04-10T14:51:34Z")

</div>

okay, I had no idea that the gateway will not support this kind of testing.  
Thank you for your response. I appreciate it

---

<div class="post-metadata">

**Author:** ![raghav1197](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/raghav1197/32/44765_2.png) [@raghav1197](https://www.thethingsnetwork.org/forum/u/raghav1197)\
**Post date:** [April 10, 2023, 2:52pm UTC](https://www.thethingsnetwork.org/forum/t/how-to-experiment-with-lora-phy-layer-parameters/62472/10 "2023-04-10T14:52:43Z")

</div>

Got it. Thank you

---

<div class="post-metadata">

**Author:** ![LoRaTracker](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/loratracker/32/48502_2.png) [@LoRaTracker](https://www.thethingsnetwork.org/forum/u/LoRaTracker)\
**Post date:** [April 10, 2023, 2:54pm UTC](https://www.thethingsnetwork.org/forum/t/how-to-experiment-with-lora-phy-layer-parameters/62472/11 "2023-04-10T14:54:22Z")

</div>

> [@raghav1197](#):
>
> I had no idea that the gateway will not support this kind of testing.  
> Thank you for your response.

The TTN fair use policy limits the Gateway to sending 10 packets a day to the nodes, which would make meaningful testing kind of difficult anyway.

---

<div class="post-metadata">

**Author:** ![Jeff-UK](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/jeff-uk/32/35697_2.png) [@Jeff-UK](https://www.thethingsnetwork.org/forum/u/Jeff-UK)\
**Post date:** [April 10, 2023, 4:30pm UTC](https://www.thethingsnetwork.org/forum/t/how-to-experiment-with-lora-phy-layer-parameters/62472/12 "2023-04-10T16:30:07Z")

</div>

Also GW’s on TTN are required to follow the pre-defined frequency plans, channel bandwidth settings and FEC parameters,etc. for correct operation and if not to be disruptive to other users - do not attempt on TTN, thank you!.

---

<div class="post-metadata">

**Author:** ![umar05](https://www.thethingsnetwork.org/forum/letter_avatar_proxy/v4/letter/u/7ea924/32.png) [@umar05](https://www.thethingsnetwork.org/forum/u/umar05)\
**Post date:** [February 19, 2025, 2:10pm UTC](https://www.thethingsnetwork.org/forum/t/how-to-experiment-with-lora-phy-layer-parameters/62472/13 "2025-02-19T14:10:20Z")

</div>

I am working on my bachelor’s project in LoRaWAN. The idea is to add an ECC (Error-Correcting Code) before LoRaWAN’s own CRC check and see if it improves the SNR.

I would like to know if it is possible to access/download the PHY layer and then I coud add my ECC to it in Python/matlab.

---

<div class="post-metadata">

**Author:** ![descartes](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/descartes/32/47220_2.png) [@descartes](https://www.thethingsnetwork.org/forum/u/descartes)\
**Post date:** [February 19, 2025, 3:02pm UTC](https://www.thethingsnetwork.org/forum/t/how-to-experiment-with-lora-phy-layer-parameters/62472/14 "2025-02-19T15:02:39Z")

</div>

> [@umar05](#):
>
> see if it improves the SNR

No chance - improving the SNR would either be by turning off all the radios in the area or changing the laws of physics. Signal to Noise Ratio - the signal you want vs all the other signals that you don’t want.

> [@umar05](#):
>
> I would like to know if it is possible to access/download the PHY layer

Access yes, download not so much - it’s built in to the silicon.

> [@umar05](#):
>
> then I coud add my ECC to it in Python/matlab.

You could add ECC to the payload - you could then evaluate that - but I’d check to see what the likelihood of the CRC passing but the payload being corrupt is to see if this would be of any use.

The wording of your premise needs some more research to be correctly framed and you may benefit from reading more around the technology of LoRa and establishing what is available from the canon (official) resources.

We are happy to answer very focused, right at the edge questions for students but not point to readily available resources like data sheets, code bases linked to from all over the place but particularly from Semtech’s site etc etc.

PS, don’t double post, it splits the efforts of the volunteers answering.

---

<div class="post-metadata">

**Author:** ![LoRaTracker](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/loratracker/32/48502_2.png) [@LoRaTracker](https://www.thethingsnetwork.org/forum/u/LoRaTracker)\
**Post date:** [February 20, 2025, 10:44am UTC](https://www.thethingsnetwork.org/forum/t/how-to-experiment-with-lora-phy-layer-parameters/62472/15 "2025-02-20T10:44:18Z")

</div>

The LoRa PHY does already include forward error correction at from 4:5 to 4:8.

Whilst you could add additional ECC data to a payload you would need to process the payload after the packet has been received, I do not think that Semtech provide a mechanism for you to get inside the firmware that decodes packets.

By all means attempt the ‘improvement’ on a LoRa peer to peer setup which would likely be heaps easier than attempting to change the code on a Gateway.
