What is fport used for when rx and tx

Hi,
I am still learning about Lorawan and I have successfully installed and received some data from a device into my own LoraServer.

I see in the received data a property fPort.

  1. What is this property and what is it used for?
  2. When sending a downlink message to the device do I need to use the
    same fPort value that was on the uplink message?

Thanks for any help.
Gary

2 Likes

According to the LoRaWAN specification

“FPort values 1…223 (0x01…0xDF) are application-specific. FPort values 224…255 (0xE0…0xFF) are reserved for future standardized application extensions.”

In other words, you are free to use values between 1-223 for any purpose you chose, and it is entirely up to you do decide what values your node and infrastructure software sets or looks for and what meaning (if any) it assigns to each value.

Given that airtime is a precious commodity, since you pay for these bits anyway you might as well try to use them to distinguish various types of messages your components send to each other, rather than spending yet more to put that in the payload of your messages. (Granted, given the multi-byte coding, adding an extra byte doesn’t always increase airtime until you bump over the next coding group threshold)

1 Like

Hi,

thanks for the quick response. I had read this on the spec also but still not sure what it is used for.

Do I have to decide that my nodes and application software will use a certain fport number?

If they are not the same what happenes ?
Gary

It is used for whatever you decide it is used for.

Do I have to decide that my nodes and application software will use a certain fport number?

That would be the general idea, yes. Start with 1 for your first packet type and extend from there as your needs grow.

If they are not the same what happenes ?

You probably might need to set a legal value for packets to be sent and correctly interpreted. 1 is a legal value.

Depending on what software you use in the node, you may need to ignore illegal values if they are delivered to you. It’s probably simpler to only act on expected values.

TL;DR set it to 1 and check for that.

Or any other legal number you like.

Uplink and downlink numbers are distinct, you can chose to make them match or not.

1 Like

And fPort 0 is for MAC commands only.

1 Like

Thanks Guys for your help on this.