TRW
Description of the device
The model TRW is a radio-based resistance thermometer for monitoring medium temperatures of all types. Resistance thermometers in this series can be installed directly into the process or combined with a large number of thermowell designs. It uses the licence-free LoRaWAN® and Bluetooth® radio standards and is used, for example, on mobile equipment and remote measuring points. Thanks to intelligent measurement and transmission control and a replaceable battery, the sensor can be operated for years without maintenance.
For more information see product site.
NETRIS1 Parser Quick Start
Parser API
All functions are pure (no global mutation) except setMeasurementRanges
which updates internal range configuration for subsequent decodes.
Types:
Input types:
interface UplinkInput {
fPort: number // LoRaWAN FPort
bytes: number[] // Raw payload as array of unsigned bytes (0-255)
recvTime?: string // Optional ISO timestamp (if your LNS provides it)
}
interface HexUplinkInput {
fPort: number // LoRaWAN FPort
bytes: string // Raw payload as hex-encoded string (case-insensitive, even length)
recvTime?: string // Optional ISO timestamp (if your LNS provides it)
}
Return type (shared by all decode helpers):
type Result = {
data: Record<string, any> // Parsed key/value pairs
warnings?: string[] // Non-fatal anomalies
} | {
errors: string[] // Fatal or structural issues only
}
To understand the data field, take a look at the examples and the schema definition.
Supported channels
to identify different sensors by:
// Is used in the returned data
type ChannelName = 'temperature'
Channels that support adjusting the measurement range:
type AdjustableChannelName = 'temperature'
decodeUplink(input)
function decodeUplink(input: UplinkInput): Result
decodeHexString(hexInput)
function decodeHexString(hexInput: HexUplinkInput): DecodeResult
bytes
must have even length; case-insensitive.
setMeasurementRanges(channel, range)
// Will throw on invalid channel name
function setMeasurementRanges(
channelName: AdjustableChannelName,
range: {
start: number
end: number
}
): void
Applies to future decodes only.
adjustRoundingDecimals(decimals)
// Smartly adjust number of decimals for rounded values
// Impacts all numeric values in all outputs
// Default is 4
function adjustRoundingDecimals(decimals: number): void
Applies to future decodes only.
Quick Start
Some network servers may not conform to the LoRaWAN codec specification. In this case, you need to create a small wrapper function.
Your device ranges might not be the default. Insert your desired ranges before decoding like this:
// Parser code...
// Quick start guide...
setMeasurementRanges('pressure', { start: 0, end: 100 })
NPM Module Inclusion
Device | Included | Factory function |
---|---|---|
TRW | ❌ | ❌ |