Payload WSLRW-LPC | Firmware 1.0 1. Payload document is applied for the following products Item code HW Version Firmware Version Remarks WSLRW-LPC-11 1.0 1.0 2. Changes information in this version v.s previous version Item Changes Changed by Changed Date Approved by Approved Date 1 Initial version P.N.Diep 09-05-2022 N.V.Loc 28-05-2022 The approved date is also the release date of this document. 3. Payload for Uplink messages When? Purpose Wait for Downlink? LED color This message will be sent in the pre-defined cycle OR when the resettable counter passes the threshold To get the measured value from the device in the pre-defined cycle or when the counter passes the threshold NO Not applicable Uplink Payload structure: Payload Sensor type Battery level Hw_error reserved NRC_People_in NRC_People_out RC_People_in RC_People_out Dist_front_zone Dist_back_zone bits 8 2 2 4 16 16 8 8 16 16 Value yes yes yes zeros yes yes yes yes yes yes 4. Payload Fields of Uplink The length of the uplink payload is 12 bytes. Please refer below for an explanation. Data Size (byte) Bit Format Meaning Sensor type 1 all Uint8 Sensor type = 0x13 means LoRaWAN People Counter Status: battery level 1 Bit 7 and 6 Uint8 Battery capacity in 04 levels 11: battery level 4 (99%) 10: battery level 3 (60%) 01: battery level 2 (30%) 00: battery level 1 (10%) Status: sensor module error Bit 5 and 4 Status 01: sensor module error 00: no error with sensor module NRC_People_in 2 all Uint16 Non-resettable counter NRC_People_out 2 all Uint16 Non-resettable counter RC_People_in 1 all Uint8 Reset to 0 after sending to Gateway RC_People_out 1 all Uint8 Reset to 0 after sending to Gateway Dist_front_zone 2 all Uint16 Distance of front zone Dist_back_zone 2 all Uint16 Distance of back zone 5. Payload for Downlink messages Users can use a downlink message to change the configuration of the device. There are 02 types of downlink messages: Downlink type = 0: to write the configuration for the specific type of Sigfox-ready sensor. The format is fixed for each type of sensor. However, this FW version does not support type 0 configuration. It only supports type 5 as below. Downlink type = 5: to write a value to any address of configuration parameter of any Sigfox-ready sensor. This method is generic and can be applied to any type of Sigfox-ready sensor, the user just needs to know the memory map of the sensor. 5.1 Downlink type = 0 Not available in this FW version. 5.2 Downlink type = 5 With this downlink, the user can write the configuration to any address on the memory map of the device. Please refer to the memory map of the device 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. Downlink type 5 for the parameter of 2 bytes length: Payload PRM_ADDRESS PRM_LENGTH PRM_VALUE reserved DOWNLINK_TYPE bits 8 8 16 28 4 Value yes 0x02 = 2 yes zeros 0b0101 = 5 Downlink type 5 for the parameter of 4 bytes length: 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) EXAMPLE FOR DOWNLINK TYPE = 5Here is the list of parameters of WSLRW-LPC that can be configured via Downlink type = 5, and the examples of the payload of downlink on the right-most side column. It is the example value, not the default value of the device. Please check the memory map of the device for more detail about the parameters. Note: the total length of down link must be equal 8 bytes Parameter PRM_ADDRESS PRM_LENGTH PRM_VALUE DOWNLINK_TYPE Downlink Payload (bytes) 1 1 4 2 8 cycle_send_data 0x4E 0x04 = 4 0x00000E10 = 3600 0x0005 4E0400000E100005 sensor_sampling_rate 0x54 0x04 = 4 0x00000078 = 120 0x0005 5404000000780005 count_threshold 0x80 0x02 = 2 0x0014 = 20 0x0005 8002000000140005 dist_threshold 0x81 0x02 = 2 0x0640 = 1600 0x0005 8102000006400005 dist_hys 0x82 0x02 = 2 0x0064 = 100 0x0005 8202000000640005 inter_meas_period 0x83 0x02 = 2 0x0030 = 48 0x0005 8302000000300005 5.3 Free online data conversion tools To convert from Float to Hex and vice versa, users may use this free online tool: https://gregstoll.com/~gregstoll/floattohex/ To convert a decimal number to Hex, the user may use this free online tool: https://www.binaryhexconverter.com/decimal-to-hex-converter 6. Reed switches The Sigfox-ready sensor normally comes with at least 1 reed switch for user manipulation during commissioning or maintenance. Some other versions come with 02 reed switches. The WSSFC-AC comes with 1 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 and wait for a new downlink to get the new configuration Back to the previous state