Payload WSLRW-AG | Firmware 2

1. Payload document is applied for the following products

Item code HW Version Firmware Version Remarks
WSLRW-AG 1 2  

2. Changes information in this version v.s previous version

Item Changes Changed by Changed Date Approved by Approved Date
2 Improve accuracy and resolution on FW 2 P.N.Diep 07-09-2022 N.V.Loc 07-09-2022
1 Initial version FW 1 P.N.Diep 01-06-2022 N.V.Loc 02-06-2022

The approved date is also the release date of this document.

3. Payload for Uplink messages

START_UP message
When? Purpose Wait for Downlink? LED color
This message will be sent once after 60 seconds from power-up the device To understand when the device was powered up YES

Blink

WHITE

Payload EVENT_ID HW_VERSION FW_VERSION CURRENT_CONFIGURATION
bits 4 4 8 64
value 0b0000 = 0 yes yes yes
PARAMETER_UPDATE message
When? Purpose Wait for Downlink? LED color

When the reed switch is activated by the magnet key.

How?

Move Magnet Key to the contact point of REED SWITCH.

Led blink SKY BLUE, hold Magnet Key 5s.

Led blink PURPLE, move Magnet Key away.

To send the new configuration to the device via downlink YES

Blink

PURPLE

Payload EVENT_ID HW_VERSION FW_VERSION CURRENT_CONFIGURATION
bits 4 4 8 64
value 0b0001 = 1 yes yes yes
FORCE_DATA message
When? Purpose Wait for Downlink? LED color

When the reed switch is activated by the magnet key.

How?

Move Magnet Key to the contact point of REED SWITCH.

Led blink SKY BLUE, move Magnet Key away.

To get the instant measured value from the device for calibration and validation. YES

Blink

SKY BLUE

Payload EVENT_ID SENSOR_ERROR reserved BATTERY_LEVEL reserved X_TILT_VALUE_X10 Y_TILT_VALUE_X10 Z_TILT_VALUE_X10
bits 4 1 5 2 4 16 16 16
value 0b0010 = 2 yes zeros yes zeros yes yes yes
CYCLIC_DATA message
When? Purpose Wait for Downlink? LED color
This message will be sent in the pre-defined cycle. To get the measured value from the device in the pre-defined cycle. YES

Blink

SKY BLUE

Payload EVENT_ID SENSOR_ERROR reserved BATTERY_LEVEL reserved X_TILT_VALUE_X10 Y_TILT_VALUE_X10 Z_TILT_VALUE_X10
bits 4 1 5 2 4 16 16 16
value 0b0011 = 3 yes zeros yes zeros yes yes yes

4. Payload Fields of Uplink

Below is an explanation of the payload fields in the uplink messages.

Data name

Description

Encoding or Possible values

Length

(in bits)

EVENT_ID

Unique ID identifying the device event

4-bit unsigned integer

0 = START_UP

1 = PARAMETERS_UPDATE

2 = FORCE_DATA

3 = CYCLIC_DATA

4

HW_VERSION

HW_VERSION = HW_VERSION value in EEPROM set in production
if the Value is unknown, the default value will be 0

4-bit unsigned integer

1..15

4

FW_VERSION

Indicate the FW version. Refer to the FW release note

8-bit unsigned integer

1..255

8

CURRENT_CONFIGURATION

The current configuration code of the device

64-bit encoded field

Refer to the Downlink section

64

SENSOR_ERROR

Indicate the sensor error or not

0b0 = no sensor's error

0b1 = sensor's error

1

BATTERY_LEVEL

Battery level

2-bit unsigned integer

0 to 3

0: 10%

1: 30%

2: 60%

3: 99%

2

X_TILT_VALUE_X10

X Tilt value

16-bit signed integer

X_TILT_VALUE = X_TILT_VALUE_X10 / 10

Range: -90.0 to 90.0

16

Y_TILT_VALUE_X10

Y Tilt value

16-bit signed integer

Y_TILT_VALUE = Y_TILT_VALUE_X10 / 10

Range: -90.0 to 90.0

16

Z_TILT_VALUE_X10

Z Tilt value

16-bit signed integer

Z_TILT_VALUE = Z_TILT_VALUE_X10 / 10

Range: -90.0 to 90.0

16

Users can use a downlink message to change the configuration of the device. There are 02 types of downlink messages:

Downlink-type-0-for-WSLRW-AG.jpg

Below is the table to explain in detail the meaning of each configuration parameter and its default value.

Parameters

Description

Possible values

Default values

Length

(in bits)

LED_BUZZER_ENABLE

Flag to enable/disable LED and Buzzer interactions for action not triggered by the button.

0b0 = false, LEDs are OFF

0b1 = true, LEDs are ON

0b1 = true

1

MEASURE_PERIOD

Period for sensing module to wake up and take measurement

0b0000 = every 1s

0b0001 = every 2s

0b0010 = every 5s

0b0011 = every 10s

0b0100 = every 20s

0b0101 = every 30s

0b0110 = every 1min

0b0111 = every 2min

0b1000 = every 5min

0b1001 = every  10min

0b1010 = every 20min

0b1011 = every 30min

0b1100 = every 1h

0b1101 = every 2h

0b1110 = every 3h

0b1111 = every 6h

0b1001 = every 10min

4

CYCLIC_DATA_PERIOD

Period to send

CYCLIC_DATA

0b000 = every  10min

0b001 = every  30min

0b010 = every 1h

0b011 = every 2h

0b100 = every 3h

0b101 = every 6h

0b110 = every 12h

0b111 = every 24h

0b000 = every 10min

3

DEVICE_RESET

Once this parameter is set, the device shall restart after receiving the Downlink. After restarting, the value turns to 0b0000 automatically.

0b1010 = 0xA = Force device reset

others = do nothing

others = do nothing

4

DOWNLINK_TYPE

Downlink type

4-bit unsigned integer

0b0000

4

Parameter

Desired setting value

Setting Value (in binary)

Length

(in bits)

Reserved

0

00000000000000000000000000000000000000000000

44

LED_BUZZER_ENABLE

0b1 = enable LED and Buzzer

1

1

Reserved

0

 000

3

MEASURE_PERIOD

0b1011 = every 30min

1011

4

Reserved

0

 0

1

CYCLIC_DATA_PERIOD

0b001 = every 30min

001

3

DEVICE_RESET

0b0000 = do nothing

0000

4

DOWNLINK_TYPE

0b0000

0000

4

Then you will get the final configuration code as below:

0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 1000 1011 0001 0000 0000 = 000000000008B100

With this downlink, the user can write the configuration to any address on the device's memory map. Please refer to the device's memory map to understand what parameters can be written.

The length of the configuration parameter can be 1, 2 bytes, or 4 bytes, but the total length of the Downlink payload must equal 64 bits (8 bytes). Please see below the downlink format for both types.

Payload

PRM_ADDRESS

PRM_LENGTH

PRM_VALUE

reserved

DOWNLINK_TYPE

bits

8

8

16

28

4

Value

yes

0x02 = 2

yes

zeros

0b0101 = 5

Payload

PRM_ADDRESS

PRM_LENGTH

PRM_VALUE

reserved

DOWNLINK_TYPE

bits

8

8

32

12

4

Value

yes

0x04 = 4

yes

zeros

0b0101 = 5

Where:

  • PRM_ADDRESS: address of the configuration parameter in the memory map of the device;
  • PRM_LENGTH: is the length of that parameter, in bytes;
  • PRM_VALUE: is the value the user wants to write to that parameter;
  • reserved: a series of bits of zero to fulfill the downlink so that it has the total length = 64 bits (8 bytes)

Note: the total length of the downlink must be equal to 8 bytes

PARAMETER

DATA TYPE OF PARAMETER

PRM_ADDRESS

PRM_LENGTH

PRM_VALUE

DOWNLINK_TYPE

PAYLOAD OF DOWNLINK (IN HEXA)

(bytes)

 

1

1

4

2

8

ADAPTIVE DATA RATE

Uint16

0x40

0x02 = 2

0x00000001 = 1 0x0005

4002000000010005

5.3 Free online data conversion tools

6. Reed switches

The LoRaWAN sensor typically comes with at least one reed switch for user manipulation during commissioning or maintenance.

Some other versions come with 02 reed switches.

The WSLRW-AG comes with one reed switch; please find below the functions of this switch.

EVENT

PRE-CONDITION

ACTION

LED STATUS

ACTIVITIES

POST-CONDITION

FORCE_DATA

Any state

Move Magnet Key to the contact point of REED SWITCH.

Led blink SKY BLUE, move Magnet Key away.

Blink SKY BLUE

the device will send the uplink message FORCE_DATA

Back to the previous state

PARAMETERS_UPDATE

Any state

Move Magnet Key to the contact point of REED SWITCH.

Led blink SKY BLUE, hold Magnet Key 5s.

Led blink PURPLE, move Magnet Key away.

Blink PURPLE

the device will send the uplink message PARAMETER_UPDATE

Back to the previous state