Uploaded June 2021 | Updated September 2026, 2 weeks ago
If you like this video and want to support me, go this page for my donation Paypal or crypto addresses:
youtube.com/c/mobilefish/about
This is part 53 of the LoRa/LoRaWAN tutorial.
In this tutorial I will explain what fport is and a short refresher what a json object is.
I will also explain what payload formatters are and show you several Javascript payload formatters examples.
This presentation can be found at:
mobilefish.com/download/lora/lora_part53.pdf
All my LoRa/LoRaWAN tutorials and presentations can be found at:
mobilefish.com/developer/lorawan/lorawan_quickguide_tutorial.html
The LoRa packet comprises of three elements: Preamble, header (optional) and payload.
To create the Radio Frequency (RF) waterfall, a RTL-SDR (Software Define Radio) dongle is used.
More information:
youtu.be/bSAa2aOXpCc
The RTL-SDR dongle is nameless but has the following chipsets:
The radio tuner: Rafael Micro R820T2
The demodulator: RealTek RTL2832U
FPort means Frame Port.
FPort is 1 byte in size.
Allowed values: 1-223, except fports 200-203.
This byte is always sent, even if you use it or not.
My end device uses this Arduino sketch:
mobilefish.com/download/lora/ttn-otaa-pro-mini-sensors.ino.txt
This sketch uses the MCCI LoRaWAN LMIC library in my Arduino IDE (v1.8.10)
github.com/mcci-catena/arduino-lmic
In the sketch, change function LMIC_setTxData2 to change the fport value.
LMIC_setTxData2(fport, data, data_length, confirmed)
- There are LoRaWAN end devices where fports can not be changed.
These devices have fixed fport values.
- There are LoRaWAN end devices where fports can be changed programmatically (for example in an Arduino sketch) or with at-commands.
- There are LoRaWAN end devices where fports can only be changed by modifying, compiling and uploading the new firmware to the end device.
Payload formatters allow you to process data going to and from end devices.
When a binary payload is sent from end device to LoRaWAN network (uplink), the data can be converted using, for example, a Javascript payload formatter.
The data can be converted to human readable data.
When a message is sent from the LoRaWAN network to the end device (downlink), the message can be converted using, for example, a Javascript payload formatter.
The message can be converted from human readable data to binary data.
The payload formatters used in the V2 console can not be copy-and-pasted directly in the V3 console.
The V2 and V3 payload formatters are different.
For example, the function names and the function parameters are different.
In the V3 console several payload formatters can be used:
- Javascript payload formatters
thethingsindustries.com/docs/integrations/payload-formatters/javascript
- Cayenne Low Power Payload formatters
thethingsindustries.com/docs/integrations/payload-formatters/cayenne
- Device specific payload formatters
Device manufacturers may have payload formatters designed to work with their devices.
github.com/TheThingsNetwork/lorawan-devices
The V3 payload formatters can be applied to an entire application, or to a specific end device.
The payload formatter tester is only available on the device level and not on the application level.
The decodeUplink function has only one function parameter (input) which is a json object.
The encodeDownlink function has only one function parameter (input) which is a json object.
If you specify a downlink formatter the encodeDownlink function is required but not the decodeDownlink function.
The decodeDownlink formats the binary data “bytes” into human readable data, just like the decodeUplink function.
Check out all my other LoRa/LoRaWAN tutorial videos:
youtube.com/playlist?list=PLmL13yqb6OxdeOi97EvI8QeO8o-PqeQ0g
Subscribe to my YouTube channel:
youtube.com/channel/UCG5_CT_KjexxjbgNE4lVGkg?sub_confirmation=1
The presentation used in this video tutorial can be found at:
mobilefish.com/developer/lorawan/lorawan_quickguide_tutorial.html
#mobilefish #lora #lorawan
If you like this video and want to support me, go this page for my donation Paypal or crypto addresses:
youtube.com/c/mobilefish/about
This is part 53 of the LoRa/LoRaWAN tutorial.
In this tutorial I will explain what fport is and a short refresher what a json object is.
I will also explain what payload formatters are and show you several Javascript payload formatters examples.
This presentation can be found at:
mobilefish.com/download/lora/lora_part53.pdf
All my LoRa/LoRaWAN tutorials and presentations can be found at:
mobilefish.com/developer/lorawan/lorawan_quickguide_tutorial.html
The LoRa packet comprises of three elements: Preamble, header (optional) and payload.
To create the Radio Frequency (RF) waterfall, a RTL-SDR (Software Define Radio) dongle is used.
More information:
youtu.be/bSAa2aOXpCc
The RTL-SDR dongle is nameless but has the following chipsets:
The radio tuner: Rafael Micro R820T2
The demodulator: RealTek RTL2832U
FPort means Frame Port.
FPort is 1 byte in size.
Allowed values: 1-223, except fports 200-203.
This byte is always sent, even if you use it or not.
My end device uses this Arduino sketch:
mobilefish.com/download/lora/ttn-otaa-pro-mini-sensors.ino.txt
This sketch uses the MCCI LoRaWAN LMIC library in my Arduino IDE (v1.8.10)
github.com/mcci-catena/arduino-lmic
In the sketch, change function LMIC_setTxData2 to change the fport value.
LMIC_setTxData2(fport, data, data_length, confirmed)
- There are LoRaWAN end devices where fports can not be changed.
These devices have fixed fport values.
- There are LoRaWAN end devices where fports can be changed programmatically (for example in an Arduino sketch) or with at-commands.
- There are LoRaWAN end devices where fports can only be changed by modifying, compiling and uploading the new firmware to the end device.
Payload formatters allow you to process data going to and from end devices.
When a binary payload is sent from end device to LoRaWAN network (uplink), the data can be converted using, for example, a Javascript payload formatter.
The data can be converted to human readable data.
When a message is sent from the LoRaWAN network to the end device (downlink), the message can be converted using, for example, a Javascript payload formatter.
The message can be converted from human readable data to binary data.
The payload formatters used in the V2 console can not be copy-and-pasted directly in the V3 console.
The V2 and V3 payload formatters are different.
For example, the function names and the function parameters are different.
In the V3 console several payload formatters can be used:
- Javascript payload formatters
thethingsindustries.com/docs/integrations/payload-formatters/javascript
- Cayenne Low Power Payload formatters
thethingsindustries.com/docs/integrations/payload-formatters/cayenne
- Device specific payload formatters
Device manufacturers may have payload formatters designed to work with their devices.
github.com/TheThingsNetwork/lorawan-devices
The V3 payload formatters can be applied to an entire application, or to a specific end device.
The payload formatter tester is only available on the device level and not on the application level.
The decodeUplink function has only one function parameter (input) which is a json object.
The encodeDownlink function has only one function parameter (input) which is a json object.
If you specify a downlink formatter the encodeDownlink function is required but not the decodeDownlink function.
The decodeDownlink formats the binary data “bytes” into human readable data, just like the decodeUplink function.
Check out all my other LoRa/LoRaWAN tutorial videos:
youtube.com/playlist?list=PLmL13yqb6OxdeOi97EvI8QeO8o-PqeQ0g
Subscribe to my YouTube channel:
youtube.com/channel/UCG5_CT_KjexxjbgNE4lVGkg?sub_confirmation=1
The presentation used in this video tutorial can be found at:
mobilefish.com/developer/lorawan/lorawan_quickguide_tutorial.html
#mobilefish #lora #lorawan
