Skip to content

Commit

Permalink
Add Vendor REDZ (#756)
Browse files Browse the repository at this point in the history
* 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
ali-ugur and Jaime-Trinidad authored Mar 12, 2024
1 parent cf71cf9 commit 5848c88
Show file tree
Hide file tree
Showing 13 changed files with 430 additions and 0 deletions.
8 changes: 8 additions & 0 deletions vendor/index.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2052,3 +2052,11 @@ vendors:
description: Lansitec is a technology-driven company providing cutting-edge active people and asset tracking products and services. i.e., trackers, gateways and bridges, beacons and tags, and related accessories like sensors.
logo: lansitec.png
website: https://www.lansitec.com/

- id: redz
name: REDZ Smart Communication
description: REDZ Smart Communication Technologies is a provider for industrial coomunication devices such as LoraWAN EndNode Modems, Electricity Meter Protocol to Modbus Protocol Gateways, LoRa RF Modems, Wireless Mbus Modems, Remote IO Devices, Serial to ETH Gateways, Industrial Unmanaged Switches with or without Broadband Powerline (BPL) connection and Energy Meter Reading Optical Probes.
logo: redz.png
website: https://www.redz-sc.com
social:
linkedin: https://www.linkedin.com/in/redz-smartcommunication
2 changes: 2 additions & 0 deletions vendor/redz/index.yaml
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
Binary file added vendor/redz/redz.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added vendor/redz/tlm-lw-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions vendor/redz/tlm-lw-codec.yaml
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
53 changes: 53 additions & 0 deletions vendor/redz/tlm-lw-profile-865.yaml
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
53 changes: 53 additions & 0 deletions vendor/redz/tlm-lw-profile-868.yaml
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
53 changes: 53 additions & 0 deletions vendor/redz/tlm-lw-profile-915.yaml
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
53 changes: 53 additions & 0 deletions vendor/redz/tlm-lw-profile-923.yaml
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
Binary file added vendor/redz/tlm-lw-sc01.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added vendor/redz/tlm-lw-sc02.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
58 changes: 58 additions & 0 deletions vendor/redz/tlm-lw.js
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;
}


Loading

0 comments on commit 5848c88

Please sign in to comment.