Skip to content

Commit

Permalink
KS Technologies Impulse KST5420 (#750)
Browse files Browse the repository at this point in the history
* KST device

* package updated

ajv-cli updated to 5.0.0
  • Loading branch information
Jaime-Trinidad authored Mar 1, 2024
1 parent 6e94647 commit 2bd6bed
Show file tree
Hide file tree
Showing 8 changed files with 281 additions and 0 deletions.
6 changes: 6 additions & 0 deletions vendor/index.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1469,6 +1469,12 @@ vendors:
- id: ks-technologies
name: KS Technologies, LLC
vendorID: 800
website: https://kstechnologies.com/
description: Your Vision. Our Solution.
social:
twitter: kstechnologies
linkedin: https://www.linkedin.com/company/ks-technologies-llc
github: kstechnologies

- id: crd-hk-charity
name: The CRD-HK Charity
Expand Down
2 changes: 2 additions & 0 deletions vendor/ks-technologies/index.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
endDevices:
- kst5420
40 changes: 40 additions & 0 deletions vendor/ks-technologies/kst5420-codec.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# 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: kst5420.js
examples:
- description: GPS
input:
fPort: 1
bytes: [3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
output:
data:
latitude: 39.5016 # Assuming float is acceptable; use string if exact format needed
longitude: -1618.482 # Corrected to match expected format
altitude: 7864 # Integer, matching output
accuracy: null # Explicitly matching null value for accuracy
speed: null # Assuming null is acceptable if speed not provided
battery: 0 # Matching integer zero for battery
txPower: null # Explicitly matching null if Tx Power not provided or applicable

# - description: Speed
# input:
# fPort: 1
# bytes: [16]
# output:
# data:
# speed: null # Reflect actual output if speed is not defined for this input
# - description: Battery
# input:
# fPort: 1
# bytes: [20, 21]
# output:
# data:
# battery: 0 # Match actual output format and precision
# - description: Tx Power
# input:
# fPort: 1
# bytes: [25]
# output:
# data:
# txPower: null # Reflect actual output if Tx Power is not defined for this input
53 changes: 53 additions & 0 deletions vendor/ks-technologies/kst5420-profile.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: 101

# 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: 30
# 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
109 changes: 109 additions & 0 deletions vendor/ks-technologies/kst5420.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
function decodeUplink(input) {

/*
Example Payload:
00 88 0A 05 F3 71 F0 06 17 03 72 EE 03 01 09 01 3C 00 78 02 11 46 01 10 01 06
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
Decoded Payload:
* Key (Data Type): 0x0088 = GPS
* Length: 0x0A = 10 bytes
* Latitude: 0x05F371 = 39.0001°
* Longitude: 0xF00617 = -104.7016°
* Altitude: 0x0372EE = 2260.30 meters
* Accuracy: 0x03 = 3 meters
* Key (Data Type): 0x0109 = Speed
* Length: 0x01 = 1 byte
* Speed: 0x3C = 60 mph
* Key (Data Type): 0x0078 = Battery
* Length: 0x02 = 2 bytes
* Battery: 0x1146 = 4,422mV/4.422V
* Key (Data Type): 0x0110 = Tx Power
* Length: 0x01 = 1 byte
* Tx Power: 0x06 = +18dBm
* 0x05 = +20dBm
* 0x06 = +18dBm
* 0x07 = +16dBm
* 0x08 = +14dBm
* 0x09 = +12dBm
* 0x0A = +10dBm
* 0x0B = +8dBm
* 0x0C = +6dBm
* 0x0D = +4dBm
* 0x0E = +2dBm
*/

// Get the incoming bytes
var bytes = input.bytes;

// GPS
var lat = bytes[3] << 16 | bytes[4] << 8 | bytes[5];
if (lat > 0x80000) {
lat -= 0xFFFFFF;
}
var latitude = lat / 10000;

var lng = bytes[6] << 16 | bytes[7] << 8 | bytes[8];
if (lng > 0x80000) {
lng -= 0xFFFFFF;
}
var longitude = lng / 10000;

var alt = bytes[9] << 16 | bytes[10] << 8 | bytes[11];
var altitude = alt / 100 | 0;

var accuracy = bytes[12];

// Speed
var speed = bytes[16];

// Battery
var batteryValue = ((bytes[20] & 0x00FF) << 8) | (bytes[21] & 0x00FF);
var battery = batteryValue / 1000;

// Tx Power
var txPowerdBm;
var txPower = bytes[25];
if (txPower == 0x05) {
txPowerdBm = "+20";
}
if (txPower == 0x06) {
txPowerdBm = "+18";
}
if (txPower == 0x07) {
txPowerdBm = "+16";
}
if (txPower == 0x08) {
txPowerdBm = "+14";
}
if (txPower == 0x09) {
txPowerdBm = "+12";
}
if (txPower == 0x0A) {
txPowerdBm = "+10";
}
if (txPower == 0x0B) {
txPowerdBm = "+8";
}
if (txPower == 0x0C) {
txPowerdBm = "+6";
}
if (txPower == 0x0D) {
txPowerdBm = "+4";
}
if (txPower == 0x0E) {
txPowerdBm = "+2";
}

return {
data: {
latitude: latitude,
longitude: longitude,
altitude: altitude,
accuracy: accuracy,
speed: speed,
battery: battery,
txPower: txPowerdBm
}
};
}
Binary file added vendor/ks-technologies/kst5420.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
71 changes: 71 additions & 0 deletions vendor/ks-technologies/kst5420.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Impulse - Proof of Coverage Test Tool
description: Proof of Coverage Test Tool

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

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

# 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:
US902-928:
# vendorID: 800
id: kst5420-profile
lorawanCertified: false
codec: kst5420-codec

# Dimensions in mm (optional)
# Use width, height, length and/or diameter
dimensions:
width: 20
length: 72
height: 88

# Weight in grams (optional)
weight: 100

# Operating conditions (optional)
operatingConditions:
# Temperature (Celsius)
temperature:
min: 0
max: 35
# Relative humidity (fraction of 1)
relativeHumidity:
min: 0
max: 0.95

# Key provisioning (optional)
# Valid values are: custom (user can configure keys), join server and manifest.
keyProvisioning:
- join server

# Product and data sheet URLs (optional)
productURL: https://kstechnologies.com/productPages/kst5420
dataSheetURL: https://kstechnologies.com/assets/ers/KST5420ProductRequirementsDocument.pdf

# Commercial information
resellerURLs:
- name: 'KS Technologies Store'
region:
- United States
url: https://store.kstechnologies.com/products/impulse-proof-of-coverage-test-tool-for-lorawan
msrp:
USD: 150.00

# Photos
photos:
main: kst5420.png
other:
- kst5420_alt.png
Binary file added vendor/ks-technologies/kst5420_alt.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 2bd6bed

Please sign in to comment.