Skip to content

Commit

Permalink
Add elspina vendor and em-elst01 device (#668)
Browse files Browse the repository at this point in the history
* Add elspina vendor and em-elst01 device

* fixed function decodeUplink

* codec fix

codec file fixed

* fixes

complete fixes

---------

Co-authored-by: Jaime Trinidad <[email protected]>
Co-authored-by: Jaime Trinidad <[email protected]>
  • Loading branch information
3 people authored Feb 29, 2024
1 parent 3bfef64 commit 89b02e6
Show file tree
Hide file tree
Showing 10 changed files with 319 additions and 0 deletions.
Binary file added vendor/elspina/elspina_logo.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/elspina/em-elst01-3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 26 additions & 0 deletions vendor/elspina/em-elst01-codec.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
uplinkDecoder:
fileName: em-elst01.js
examples:
- description: Device to capture state changes through its accelerometer and switch sensor.
input:
fPort: 2
bytes: [0x0D, 0x48, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF5, 0xFF, 0xC6, 0x03, 0x9D, 0x01, 0x00]
output:
data:
ALARM: 0
Bat: 3.4
LDOD: 0
TNOMD: 0
TODE: 0
X: '-0.10'
Y: '-0.57'
Z: '9.25'
status: 0
temp_ds: '25.6'

# - description: Unknown FPort
# input:
# fPort: 42
# bytes: [0x0D, 0x48, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF5, 0xFF, 0xC6, 0x03, 0x9D, 0x01, 0x00]
# output:
# errors: ["unknown FPort"]
Binary file added vendor/elspina/em-elst01-e.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/elspina/em-elst01-i.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
52 changes: 52 additions & 0 deletions vendor/elspina/em-elst01-profile.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Vendor profile ID, can be freely issued by the vendor
# This vendor profile ID is also used on the QR code for LoRaWAN devices, see
# https://lora-alliance.org/sites/default/files/2020-10/LoRa_Alliance_Vendor_ID_for_QR_Code.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.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: 20
# 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
81 changes: 81 additions & 0 deletions vendor/elspina/em-elst01.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
function decodeUplink(input) {
// Decode an uplink message from a buffer
// (array) of bytes to an object of fields.
var port = input.fPort;
var bytes = input.bytes;
var switch_status = (bytes[0]>>4)&0xFF;
var value=(bytes[0]<<8 | bytes[1]) & 0x0FFF;
var batV=value/1000;//Battery,units:V

if(bytes.length == 4)
{
var tnomd = (bytes[2]<<8 | bytes[3]) & 0xFFFF;
return {
status:switch_status,
Bat:batV ,
TNOMD:tnomd,
};
}
else if(bytes.length == 9)
{
var tode = (bytes[2]<<16 | bytes[3]<<8 | bytes[4]) & 0xFFFFFF;
var ldod = (bytes[5]<<16 | bytes[6]<<8 | bytes[7]) & 0xFFFFFF;
var alarm = bytes[8];
return {
status:switch_status,
Bat:batV ,
TODE:tode,
LDOD:ldod,
ALARM:alarm,
};
}
else if(bytes.length == 19)
{
var tode1 = (bytes[2]<<16 | bytes[3]<<8 | bytes[4]) & 0xFFFFFF;
var ldod1 = (bytes[5]<<16 | bytes[6]<<8 | bytes[7]) & 0xFFFFFF;
var alarm1 = bytes[8];
var tnomd1 = (bytes[9]<<8 | bytes[10]) & 0xFFFF;

value=bytes[11]<<8 | bytes[12];
var X = 0;
if(bytes[11]>>4 == 0x0F)
X=((value-0xFFFF)/100).toFixed(2);
else
X=(value/100).toFixed(2);

value=bytes[13]<<8 | bytes[14];
var Y=0;
if(bytes[13]>>4 == 0x0F)
Y=((value-0xFFFF)/100).toFixed(2);
else
Y=(value/100).toFixed(2);

value=bytes[15]<<8 | bytes[16];
var Z=0;
if(bytes[15]>>4 == 0x0F)
Z=((value-0xFFFF)/100).toFixed(2);
else
Z=(value/100).toFixed(2);

value=bytes[17]<<8 | bytes[18];
var temp_DS18B20=0;//DS18B20,temperature,units:°C
if(bytes[17]>>4 == 0x0F)
temp_DS18B20=((value-0xFFFF)/10).toFixed(1);
else
temp_DS18B20=(value/10).toFixed(1);
return {
data:{
status:switch_status,
Bat:batV ,
TODE:tode1,
LDOD:ldod1,
ALARM:alarm1,
TNOMD:tnomd1,
X:X,
Y:Y,
Z:Z,
temp_ds:temp_DS18B20
},
};
}
}
147 changes: 147 additions & 0 deletions vendor/elspina/em-elst01.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
name: EM-ELST01
description: Device to capture state changes through its accelerometer and switch sensor.
# 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.6.3'
numeric: 1
# Corresponding hardware versions (optional)
hardwareVersions:
- '1.0'

# Firmware features (optional)
# Valid values are: remote rejoin (trigger a join from the application layer), transmission interval (configure how
# often the device sends a message).
features:
- remote rejoin
- transmission interval

# 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:
AS923:
# Optional identifier of the vendor of the profile. When you specify the vendorID, the profile is loaded from
# the vendorID's folder. This allows you to reuse profiles from module or LoRaWAN end device stack vendors.
# If vendorID is empty, the current vendor ID is used. In this example, the vendorID is the current vendor ID,
# which is verbose.
#vendorID: elspina
# Identifier of the profile (lowercase, alphanumeric with dashes, max 36 characters)
id: em-elst01-profile
lorawanCertified: true
codec: em-elst01-codec

# Sensors that this device features (optional)
# Valid values are:
# 4-20 ma, accelerometer, altitude, analog input, auxiliary, barometer, battery, button, bvoc, co, co2, conductivity,
# current, digital input, dissolved oxygen, distance, dust, energy, gps, gyroscope, h2s, humidity, iaq, level, light,
# lightning, link, magnetometer, moisture, motion, no, no2, o3, particulate matter, ph, pir, pm2.5, pm10, potentiometer,
# power, precipitation, pressure, proximity, pulse count, pulse frequency, radar, rainfall, rssi, smart valve, snr, so2,
# solar radiation, sound, strain, surface temperature, temperature, tilt, time, tvoc, uv, vapor pressure, velocity,
# vibration, voltage, water potential, water, weight, wifi ssid, wind direction, wind speed.
sensors:
- accelerometer
- conductivity
- temperature

# Additional radios that this device has (optional)
# Valid values are: ble, nfc, wifi, cellular.
# additionalRadios:
# - ble
# - cellular

# Bridge interfaces (optional)
# Valid values are: modbus, m-bus, can bus, rs-485, sdi-12, analog.
# bridgeInterfaces:
# - m-bus
# - rs-485

# Dimensions in mm (optional)
# Use width, height, length and/or diameter
dimensions:
width: 140
length: 70
height: 50

# Weight in grams (optional)
weight: 200

# Battery information (optional)
battery:
replaceable: true
type: Li/SOCl2

# Operating conditions (optional)
operatingConditions:
# Temperature (Celsius)
temperature:
min: -40
max: 85

# IP rating (optional)

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

# Key programming (optional)
# Valid values are: bluetooth, nfc, wifi, serial (when the user has a serial interface to set the keys)
# and firmware (when the user should change the firmware to set the keys).
keyProgramming:
- serial
- firmware

# Key security (optional)
# Valid values are: none, read protected and secure element.
keySecurity: none

# Firmware programming (optional)
# Valid values are: serial (when the user has a serial interface to update the firmware), fuota lorawan (when the device
# supports LoRaWAN FUOTA via standard interfaces) and fuota other (other wireless update mechanism).
firmwareProgramming:
- serial
# - fuota lorawan

# Product and data sheet URLs (optional)
productURL: https://docs.elspina.space/products/em-elst01
dataSheetURL: https://docs.elspina.space/products/em-elst01/ELmote_EM-ELST01_OL.pdf

# Commercial information
resellerURLs:
- name: 'ELSPINA VEINZ Inc.'
region:
- Japan
url: https://elspina.veinz.tech/

# Photos
photos:
main: em-elst01-e.jpg
other:
- em-elst01-i.jpg
- em-elst01-3.jpg
# Youtube or Vimeo Video (optional)
# videos:
# main: https://www.youtube.com/

# Regulatory compliances (optional)
# compliances:
# safety:
# - body: IEC
# norm: EN
# standard: 62368-1
# radioEquipment:
# - body: ETSI
# norm: EN
# standard: 301 489-1
# version: 2.2.0
# - body: ETSI
# norm: EN
# standard: 301 489-3
# version: 2.1.0
6 changes: 6 additions & 0 deletions vendor/elspina/index.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# This example contains just one end device: windsensor. It is referenced here in the index.

endDevices:
# Unique identifier of the end device (lowercase, alphanumeric with dashes, max 36 characters)
- em-elst01 # look in windsensor.yaml for the end device definition

7 changes: 7 additions & 0 deletions vendor/index.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1998,6 +1998,13 @@ vendors:
website: https://open-boat-projects.org
logo: obp_logo.png

- id: elspina
name: Elspina VEINZ Inc.
website: https://elspina.veinz.tech/
logo: elspina_logo.png
social:
linkedin: https://www.linkedin.com/company/elspinaveinz/

- id: watteco
name: WATTECO
vendorID: 296
Expand Down

0 comments on commit 89b02e6

Please sign in to comment.