Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QingPing sensors sold by RAKwireless #817

Merged
merged 3 commits into from
Sep 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 62 additions & 0 deletions vendor/rakwireless/decoder-qingping.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
function Decoder(bytes, port) {

var i = 0;
var output = {};
var device_address = data[i++];
var function_code = data[i++];
var data_length = data[i++];
var data_type = data[i++];

// Parsing only real time data from sensor
if ((0x41 == function_code) && (0x01 == data_type)) {

// id
output.device = device_address;

// timestamp
output.timestamp = (data[i] << 24) + (data[i+1] << 16) + (data[i+2] << 8) + data[i+3];
i+=4;

// temperature
output.temperature = ((data[i] * 16) + (data[i+1] >> 4) - 500) / 10.0;
output.humidity = (256 * (data[i+1] & 0x0F) + data[i+2]) / 10.0;
output.co2 = (data[i+3] << 8) + data[i+4];
i+=5;

// battery
output.battery = data[i];

}

return output;

}

function bytesToHex(bytes) {

var hexArray = [];
for (var i = 0; i < bytes.length; i++) {
var hex = (bytes[i] & 0xff).toString(16).toUpperCase();
if (hex.length === 1) {
hex = '0' + hex;
}
hexArray.push(hex);
}
return hexArray.join('');

}

function decodeUplink(input) {

bytes = input.bytes;
fPort = input.fPort;

return {
data: Decoder(bytes, fPort),
warnings: [],
errors: []
};

}


2 changes: 2 additions & 0 deletions vendor/rakwireless/index.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ endDevices:
- wisblock-kit4
- rak2270
- rak2560
- qingping-t-h
- qingping-co2-t-h
48 changes: 48 additions & 0 deletions vendor/rakwireless/qingping-co2-t-h-868-profile.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# LoRaWAN MAC version: 1.0, 1.0.1, 1.0.2, 1.0.3, 1.0.4 or 1.1
macVersion: '1.0.3'
# 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: 'RP001-1.0.3-RevA'

# 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
48 changes: 48 additions & 0 deletions vendor/rakwireless/qingping-co2-t-h-915-profile.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# LoRaWAN MAC version: 1.0, 1.0.1, 1.0.2, 1.0.3, 1.0.4 or 1.1
macVersion: '1.0.3'
# 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: 'RP001-1.0.3-RevA'

# 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
2 changes: 2 additions & 0 deletions vendor/rakwireless/qingping-co2-t-h-codec.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
uplinkDecoder:
fileName: decoder-qingping.js
Binary file added vendor/rakwireless/qingping-co2-t-h.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
74 changes: 74 additions & 0 deletions vendor/rakwireless/qingping-co2-t-h.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: QingPing CO2 & Temperature & Humidity Monitor for LoRaWAN
description: The QingPing LoRaWAN CO2 monitor Sensor is a remote monitoring device that uses nondispersive infrared (NDIR) spectral analysis to accurately measure CO2 levels. Aside from CO2 levels, it also monitors temperature and relative humidity, providing a comprehensive overview of the indoor environment in real time.

# Hardware versions (optional, use when you have revisions)
hardwareVersions:
- version: '1.0'
numeric: 1

# Firmware versions (at least one is mandatory)
firmwareVersions:
- # Firmware version
version: '1.3.4'
numeric: 1
# Corresponding hardware versions (optional)
hardwareVersions:
- '1.0'

# LoRaWAN Device Profiles per region
# Supported regions are EU863-870, US902-928, AU915-928, AS923, CN779-787, EU433, CN470-510, KR920-923, IN865-867, RU864-870
profiles:
EU863-870:
id: qingping-co2-t-h-868-profile
lorawanCertified: false
codec: qingping-co2-t-h-codec
US902-928:
id: qingping-co2-t-h-915-profile
lorawanCertified: false
codec: qingping-co2-t-h-codec

sensors:
- temperature
- humidity
- co2

# Dimensions in mm (optional)
# Use width, height, length and/or diameter
dimensions:
width: 77
length: 77
height: 28

# Weight in grams (optional)
#weight: 10

operatingConditions:
temperature:
min: -10
max: 50

# Valid values are: none, read protected and secure element.
keySecurity: none

# Product and data sheet URLs (optional)
productURL: https://store.rakwireless.com/products/qingping-lorawan-co2-monitoring-sensor
dataSheetURL: https://downloads.rakwireless.com/IoT-Marketplace/Qingping/Indoor%20CO2%20Monitoring%20Solution/QingPing%20LoRaWAN%20CO2%20Sensor%20Datasheet.pdf

# Photos
photos:
main: qingping-co2-t-h.png
#videos:
# main: https://www.youtube.com/watch?v=XVRR7Akyy8M

# Regulatory compliances (optional)
#compliances:
# emc:
# - body: ETSI
# norm: EN
# standard: 301 489-1
# version: 2.2.3
# radio:
# - body: ETSI
# norm: EN
# standard: 300 220-2
# version: 3.2.1
48 changes: 48 additions & 0 deletions vendor/rakwireless/qingping-t-h-868-profile.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# LoRaWAN MAC version: 1.0, 1.0.1, 1.0.2, 1.0.3, 1.0.4 or 1.1
macVersion: '1.0.3'
# 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: 'RP001-1.0.3-RevA'

# 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
48 changes: 48 additions & 0 deletions vendor/rakwireless/qingping-t-h-915-profile.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# LoRaWAN MAC version: 1.0, 1.0.1, 1.0.2, 1.0.3, 1.0.4 or 1.1
macVersion: '1.0.3'
# 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: 'RP001-1.0.3-RevA'

# 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
2 changes: 2 additions & 0 deletions vendor/rakwireless/qingping-t-h-codec.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
uplinkDecoder:
fileName: decoder-qingping.js
Binary file added vendor/rakwireless/qingping-t-h.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading