-
Notifications
You must be signed in to change notification settings - Fork 388
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add Vendor REDZ * Vendor added REDZ * Vendor added REDZ * Add Vendor REDZ * validate fmt fix index, run validate fmt * fixed file names * files * fixes --------- Co-authored-by: Jaime Trinidad <[email protected]>
- Loading branch information
1 parent
cf71cf9
commit 5848c88
Showing
13 changed files
with
430 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
endDevices: | ||
- tlm-lw # look in tlm-lw.yaml for the end device definition |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Uplink decoder decodes binary data uplink into a JSON object (optional) | ||
# For documentation on writing encoders and decoders, see: https://www.thethingsindustries.com/docs/integrations/payload-formatters/javascript/ | ||
uplinkDecoder: | ||
fileName: tlm-lw.js | ||
|
||
# based on following payload | ||
#10 00036FFE 02 61703B0F 020201 4C4F52415F4C575F534552564552 | ||
examples: | ||
- description: TLM LW example frame decode | ||
input: | ||
fPort: 1 | ||
bytes: [0x10, 0x00, 0x03, 0x6F, 0xFE, 0x02, 0x61, 0x75, 0x31, 0x6F, 0x02, 0x02, 0x01, 0x4C, 0x4F, 0x52, 0x41, 0x5F, 0x4C, 0x57, 0x5F, 0x53, 0x45, 0x52, 0x56, 0x45, 0x52] | ||
|
||
output: | ||
data: | ||
deviceID: '0x36ffe' | ||
deviceName: 'LORA_LW_SERVER' | ||
deviceTime: '2024-3-11 21:5:47' | ||
firmwareVersion: '2.2.1' | ||
frameType: 'ModbusRTU' | ||
targetPort: 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# Vendor profile ID, can be freely issued by the vendor. NOTE: The vendor profile ID is different from the vendorID. | ||
# The vendor Profile ID should be an incremental counter for every unique device listed in the vendor's folder. | ||
# This vendor profile ID is also used on the QR code for LoRaWAN devices, see | ||
# https://lora-alliance.org/wp-content/uploads/2020/11/TR005_LoRaWAN_Device_Identification_QR_Codes.pdf | ||
vendorProfileID: 0 | ||
|
||
# LoRaWAN MAC version: 1.0, 1.0.1, 1.0.2, 1.0.3, 1.0.4 or 1.1 | ||
macVersion: '1.0.4' | ||
# LoRaWAN Regional Parameters version. Values depend on the LoRaWAN version: | ||
# 1.0: TS001-1.0 | ||
# 1.0.1: TS001-1.0.1 | ||
# 1.0.2: RP001-1.0.2 or RP001-1.0.2-RevB | ||
# 1.0.3: RP001-1.0.3-RevA | ||
# 1.0.4: RP002-1.0.0 or RP002-1.0.1 | ||
# 1.1: RP001-1.1-RevA or RP001-1.1-RevB | ||
regionalParametersVersion: 'RP002-1.0.4' | ||
|
||
# Whether the end device supports join (OTAA) or not (ABP) | ||
supportsJoin: true | ||
# If your device is an ABP device (supportsJoin is false), uncomment the following fields: | ||
# RX1 delay | ||
#rx1Delay: 5 | ||
# RX1 data rate offset | ||
#rx1DataRateOffset: 0 | ||
# RX2 data rate index | ||
#rx2DataRateIndex: 0 | ||
# RX2 frequency (MHz) | ||
#rx2Frequency: 869.525 | ||
# Factory preset frequencies (MHz) | ||
#factoryPresetFrequencies: [868.1, 868.3, 868.5, 867.1, 867.3, 867.5, 867.7, 867.9] | ||
|
||
# Maximum EIRP | ||
maxEIRP: 22 | ||
# Whether the end device supports 32-bit frame counters | ||
supports32bitFCnt: true | ||
|
||
# Whether the end device supports class B | ||
supportsClassB: false | ||
# If your device supports class B, uncomment the following fields: | ||
# Maximum delay for the end device to answer a MAC request or confirmed downlink frame (seconds) | ||
#classBTimeout: 60 | ||
# Ping slot period (seconds) | ||
#pingSlotPeriod: 128 | ||
# Ping slot data rate index | ||
#pingSlotDataRateIndex: 0 | ||
# Ping slot frequency (MHz). Set to 0 if the band supports ping slot frequency hopping. | ||
#pingSlotFrequency: 869.525 | ||
|
||
# Whether the end device supports class C | ||
supportsClassC: false | ||
# If your device supports class C, uncomment the following fields: | ||
# Maximum delay for the end device to answer a MAC request or confirmed downlink frame (seconds) | ||
#classCTimeout: 60 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# Vendor profile ID, can be freely issued by the vendor. NOTE: The vendor profile ID is different from the vendorID. | ||
# The vendor Profile ID should be an incremental counter for every unique device listed in the vendor's folder. | ||
# This vendor profile ID is also used on the QR code for LoRaWAN devices, see | ||
# https://lora-alliance.org/wp-content/uploads/2020/11/TR005_LoRaWAN_Device_Identification_QR_Codes.pdf | ||
vendorProfileID: 0 | ||
|
||
# LoRaWAN MAC version: 1.0, 1.0.1, 1.0.2, 1.0.3, 1.0.4 or 1.1 | ||
macVersion: '1.0.4' | ||
# LoRaWAN Regional Parameters version. Values depend on the LoRaWAN version: | ||
# 1.0: TS001-1.0 | ||
# 1.0.1: TS001-1.0.1 | ||
# 1.0.2: RP001-1.0.2 or RP001-1.0.2-RevB | ||
# 1.0.3: RP001-1.0.3-RevA | ||
# 1.0.4: RP002-1.0.0 or RP002-1.0.1 | ||
# 1.1: RP001-1.1-RevA or RP001-1.1-RevB | ||
regionalParametersVersion: 'RP002-1.0.4' | ||
|
||
# Whether the end device supports join (OTAA) or not (ABP) | ||
supportsJoin: true | ||
# If your device is an ABP device (supportsJoin is false), uncomment the following fields: | ||
# RX1 delay | ||
#rx1Delay: 5 | ||
# RX1 data rate offset | ||
#rx1DataRateOffset: 0 | ||
# RX2 data rate index | ||
#rx2DataRateIndex: 0 | ||
# RX2 frequency (MHz) | ||
#rx2Frequency: 869.525 | ||
# Factory preset frequencies (MHz) | ||
#factoryPresetFrequencies: [868.1, 868.3, 868.5, 867.1, 867.3, 867.5, 867.7, 867.9] | ||
|
||
# Maximum EIRP | ||
maxEIRP: 16 | ||
# Whether the end device supports 32-bit frame counters | ||
supports32bitFCnt: true | ||
|
||
# Whether the end device supports class B | ||
supportsClassB: false | ||
# If your device supports class B, uncomment the following fields: | ||
# Maximum delay for the end device to answer a MAC request or confirmed downlink frame (seconds) | ||
#classBTimeout: 60 | ||
# Ping slot period (seconds) | ||
#pingSlotPeriod: 128 | ||
# Ping slot data rate index | ||
#pingSlotDataRateIndex: 0 | ||
# Ping slot frequency (MHz). Set to 0 if the band supports ping slot frequency hopping. | ||
#pingSlotFrequency: 869.525 | ||
|
||
# Whether the end device supports class C | ||
supportsClassC: false | ||
# If your device supports class C, uncomment the following fields: | ||
# Maximum delay for the end device to answer a MAC request or confirmed downlink frame (seconds) | ||
#classCTimeout: 60 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# Vendor profile ID, can be freely issued by the vendor. NOTE: The vendor profile ID is different from the vendorID. | ||
# The vendor Profile ID should be an incremental counter for every unique device listed in the vendor's folder. | ||
# This vendor profile ID is also used on the QR code for LoRaWAN devices, see | ||
# https://lora-alliance.org/wp-content/uploads/2020/11/TR005_LoRaWAN_Device_Identification_QR_Codes.pdf | ||
vendorProfileID: 0 | ||
|
||
# LoRaWAN MAC version: 1.0, 1.0.1, 1.0.2, 1.0.3, 1.0.4 or 1.1 | ||
macVersion: '1.0.4' | ||
# LoRaWAN Regional Parameters version. Values depend on the LoRaWAN version: | ||
# 1.0: TS001-1.0 | ||
# 1.0.1: TS001-1.0.1 | ||
# 1.0.2: RP001-1.0.2 or RP001-1.0.2-RevB | ||
# 1.0.3: RP001-1.0.3-RevA | ||
# 1.0.4: RP002-1.0.0 or RP002-1.0.1 | ||
# 1.1: RP001-1.1-RevA or RP001-1.1-RevB | ||
regionalParametersVersion: 'RP002-1.0.4' | ||
|
||
# Whether the end device supports join (OTAA) or not (ABP) | ||
supportsJoin: true | ||
# If your device is an ABP device (supportsJoin is false), uncomment the following fields: | ||
# RX1 delay | ||
#rx1Delay: 5 | ||
# RX1 data rate offset | ||
#rx1DataRateOffset: 0 | ||
# RX2 data rate index | ||
#rx2DataRateIndex: 0 | ||
# RX2 frequency (MHz) | ||
#rx2Frequency: 869.525 | ||
# Factory preset frequencies (MHz) | ||
#factoryPresetFrequencies: [868.1, 868.3, 868.5, 867.1, 867.3, 867.5, 867.7, 867.9] | ||
|
||
# Maximum EIRP | ||
maxEIRP: 22 | ||
# Whether the end device supports 32-bit frame counters | ||
supports32bitFCnt: true | ||
|
||
# Whether the end device supports class B | ||
supportsClassB: false | ||
# If your device supports class B, uncomment the following fields: | ||
# Maximum delay for the end device to answer a MAC request or confirmed downlink frame (seconds) | ||
#classBTimeout: 60 | ||
# Ping slot period (seconds) | ||
#pingSlotPeriod: 128 | ||
# Ping slot data rate index | ||
#pingSlotDataRateIndex: 0 | ||
# Ping slot frequency (MHz). Set to 0 if the band supports ping slot frequency hopping. | ||
#pingSlotFrequency: 869.525 | ||
|
||
# Whether the end device supports class C | ||
supportsClassC: false | ||
# If your device supports class C, uncomment the following fields: | ||
# Maximum delay for the end device to answer a MAC request or confirmed downlink frame (seconds) | ||
#classCTimeout: 60 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# Vendor profile ID, can be freely issued by the vendor. NOTE: The vendor profile ID is different from the vendorID. | ||
# The vendor Profile ID should be an incremental counter for every unique device listed in the vendor's folder. | ||
# This vendor profile ID is also used on the QR code for LoRaWAN devices, see | ||
# https://lora-alliance.org/wp-content/uploads/2020/11/TR005_LoRaWAN_Device_Identification_QR_Codes.pdf | ||
vendorProfileID: 0 | ||
|
||
# LoRaWAN MAC version: 1.0, 1.0.1, 1.0.2, 1.0.3, 1.0.4 or 1.1 | ||
macVersion: '1.0.4' | ||
# LoRaWAN Regional Parameters version. Values depend on the LoRaWAN version: | ||
# 1.0: TS001-1.0 | ||
# 1.0.1: TS001-1.0.1 | ||
# 1.0.2: RP001-1.0.2 or RP001-1.0.2-RevB | ||
# 1.0.3: RP001-1.0.3-RevA | ||
# 1.0.4: RP002-1.0.0 or RP002-1.0.1 | ||
# 1.1: RP001-1.1-RevA or RP001-1.1-RevB | ||
regionalParametersVersion: 'RP002-1.0.4' | ||
|
||
# Whether the end device supports join (OTAA) or not (ABP) | ||
supportsJoin: true | ||
# If your device is an ABP device (supportsJoin is false), uncomment the following fields: | ||
# RX1 delay | ||
#rx1Delay: 5 | ||
# RX1 data rate offset | ||
#rx1DataRateOffset: 0 | ||
# RX2 data rate index | ||
#rx2DataRateIndex: 0 | ||
# RX2 frequency (MHz) | ||
#rx2Frequency: 869.525 | ||
# Factory preset frequencies (MHz) | ||
#factoryPresetFrequencies: [868.1, 868.3, 868.5, 867.1, 867.3, 867.5, 867.7, 867.9] | ||
|
||
# Maximum EIRP | ||
maxEIRP: 16 | ||
# Whether the end device supports 32-bit frame counters | ||
supports32bitFCnt: true | ||
|
||
# Whether the end device supports class B | ||
supportsClassB: false | ||
# If your device supports class B, uncomment the following fields: | ||
# Maximum delay for the end device to answer a MAC request or confirmed downlink frame (seconds) | ||
#classBTimeout: 60 | ||
# Ping slot period (seconds) | ||
#pingSlotPeriod: 128 | ||
# Ping slot data rate index | ||
#pingSlotDataRateIndex: 0 | ||
# Ping slot frequency (MHz). Set to 0 if the band supports ping slot frequency hopping. | ||
#pingSlotFrequency: 869.525 | ||
|
||
# Whether the end device supports class C | ||
supportsClassC: false | ||
# If your device supports class C, uncomment the following fields: | ||
# Maximum delay for the end device to answer a MAC request or confirmed downlink frame (seconds) | ||
#classCTimeout: 60 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
|
||
function decodeUplink(input) { | ||
switch (input.fPort) { | ||
case 1: | ||
return { | ||
// Decoded data | ||
data: { | ||
frameType: getFrameType([input.bytes[0] & 0x0F]), | ||
deviceID: '0x'+((input.bytes[1] << 24) + (input.bytes[2] << 16) + (input.bytes[3] << 8) + (input.bytes[4])).toString(16), | ||
targetPort: input.bytes[5], | ||
deviceTime: get_status_time((input.bytes[6] << 24) + (input.bytes[7] << 16) + (input.bytes[8] << 8) + (input.bytes[9])), | ||
firmwareVersion: `${input.bytes[10]}` +'.' + `${input.bytes[11]}` +'.' + `${input.bytes[12]}`, | ||
deviceName: getDeviceName(input.bytes), | ||
}, | ||
}; | ||
default: | ||
return { | ||
errors: ['unknown FPort'], | ||
}; | ||
} | ||
} | ||
|
||
function getFrameType(byte) { | ||
|
||
var frameTypes = ['ModbusRTU', 'ModbusTCP', 'Trasnparent']; | ||
|
||
if(byte >=0 && byte <=2) | ||
return frameTypes[byte]; | ||
else | ||
return 'Unknown Frame'; | ||
} | ||
|
||
function getDeviceName(bytes) { | ||
|
||
var deviceNameS=""; | ||
|
||
for(var i=13;i<bytes.length;i++) | ||
deviceNameS = deviceNameS + String.fromCharCode(bytes[i]); | ||
|
||
return deviceNameS; | ||
} | ||
|
||
function get_status_time(hex){ | ||
|
||
var hour= (((hex) >> 16) & 0x1F); | ||
var min= (((hex) >> 6) & 0x3F); | ||
var sec = ((hex) & 0x3F); | ||
|
||
|
||
var year= ((((hex) >> 26) & 0x3F) + 2000); | ||
var mon= (((hex) >> 12) & 0x0F); | ||
var day= (((hex) >> 21) & 0x1F); | ||
|
||
var time = year +'-'+ mon +'-'+ day +' '+ hour +':'+ min +':'+ sec; | ||
return time; | ||
} | ||
|
||
|
Oops, something went wrong.