Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Consider a table like this.

Number of events since last counter update message transmission

Elapsed time since last counter update message transmission

0

1200

1

300

2

200

5

100

10

60

The table describes a threshold in 2D space that defines if a counter update message must be sent. If a point lies left from the curve the message must be sent.

...

  • the minimum period between messages. In this case, it is 60 seconds and no matter how many cars passed after the last message a new message will be sent not earlier than 60 seconds after the last message.

  • the minimum number of events necessary to send the next message. In this case, it is 0, and even if there were no new passing cars after the last message the new one will be sent in 1200 seconds after the last message.

Another example.

Number of events since last counter update message transmission

Elapsed time since last counter update message transmission

2

200

5

100

10

60

...

Here the minimum number of new events is 2, so if after the last message there were none or only 1 event there will be no new counter update message ever.

...

Here is a table showing the expected lifespan in years of the device vs the number of messages per day and configured data rate(or actual data rate in case of ADR enabled).

Data rate\Number of messages per day

10

20

50

100

200

500

DR0(SF12)

7.4

7.2

6.6

5.9

4.8

3.1

DR1(SF11)

7.5

7.4

7.0

6.5

5.7

4.2

DR2(SF10)

7.5

7.5

7.3

7.0

6.5

5.4

DR3(SF9)

7.6

7.5

7.5

7.3

7.0

6.3

DR4(SF8)

7.6

7.6

7.5

7.4

7.3

6.8

DR5(SF7)

7.6

7.6

7.6

7.5

7.4

7.2

4.2 Uplink messages


Uplink messages are those sent from the sensor to the network.

...


Counter update message uses port 1 and is not confirmed with 0 repetitions by default. It may be configured as confirmed or unconfirmed with repetitions (see downlink messages).

Byte

Name

0

Counter value -

Low Byte

bits 15..8

1

Counter value -

High Byte

bits 7..0

Only 16 least significant bits of the counter are sent in this message, the server must take care of possible overflows. It is also important to notice, that counter information is not stored in nonvolatile memory and so it is lost in case of reboot and the counter resets to 0. The server can correctly process reboot by processing the Startup message(if Reset cause is not equal to 0, there was reboot and the counter was reset to 0).

...


The heartbeat message uses port 2 and it is always confirmed. The heartbeat message is sent every 24 hours (by default).

Byte

Bits

Name

0

4..0

Error Mask

7..5

Reserved

1

7..0

Battery voltage - the last value

2

7..0

Battery voltage - the mean value(last 24 hours)

Heartbeat messages allow the device’s health monitoring using Error Mask, where all zeros values which are not hardware issues were detected.

...


The startup message uses port 3 and it is always confirmed. It will be sent after every startup/reboot /(re-)join event:

Byte

Name

0

Major part of version number

1

Minor part of version number

2

Micro part of version number

3

Reset cause

0x00 No reset ( Startup message after re-joining LoRaWAN network)

0x01: Watchdog reset

0x02: Power On Reset

0x03: User Request Reset

0x06 - Brownout Reset

0x07 - Others

4.2.4 Debug messages


The Debug messages use port 6 and they are always unconfirmed. By default, these messages are enabled and have no repetitions, but they may be disabled or increased by the number of repetitions used (see downlink messages). These messages do not have a fixed length as their payload depends on the type of debug message.

...


DataRate configuration uses port 52. The default value is DR2 (0x02) The selected configuration is persistent unless overwritten in the join procedure. Higher DataRates increases the battery lifetime of the sensor but may reduce the reliability of the reception of messages by the Gateway. This is especially the case for unconfirmed messages.

Byte

Bits

Name

Default value

0

0..2

DataRate configuration

2 (DR2)

3

Enable ADR(Adaptive Data Rate):

  • 0 - Disabled, data rate is determined by DataRate configuration

  • 1 - Enabled, data rate is determined by ADR mechanism, value of DataRate configuration is used as initial value

0

4..6

Counter update confirmation configuration

1(Unconfirmed with 1 uplink message(0 repetitions))

7

Reserved

0

DataRate configuration value

DataRate(Spreading Factor)

0

DR0 (SF12)

1

DR1 (SF11)

2

DR2 (SF10)

3

DR3 (SF9)

4

DR4 (SF8)

5

DR5 (SF7)

6

Reserved

7

Reserved

Counter update confirmation configuration

Description

0

Confirmed(up to 8 repetitions)

1

Unconfirmed with 1 uplink message(0 repetitions)

2

Unconfirmed with 2 uplink messages(up to 1 repetition)

3

Unconfirmed with 3 uplink messages(up to 2 repetitions)

4

Unconfirmed with 4 uplink messages(up to 3 repetitions)

4.3.2 Update transmission threshold configuration

Update transmission threshold configuration uses port 53. The configuration selected is persistent. The configuration is a table where every record represents a point of the counter update threshold curve. If elapsed time of a record is equal to 0xFFF, this record is not used.

Byte

Bits

Name

0

4..7

Record 1 - Number of events

3..0

Record 1 - Elapsed time, seconds(bits 11..8)

1

7..0

Record 1 - Elapsed time, seconds(bits 7..0)

2

4..7

Record 2 - Number of events

3..0

Record 2 - Elapsed time, seconds(bits 11..8)

3

7..0

Record 2 - Elapsed time, seconds(bits 7..0)

4

4..7

Record 3 - Number of events

3..0

Record 3 - Elapsed time, seconds(bits 11..8)

5

7..0

Record 3 - Elapsed time, seconds(bits 7..0)

6

4..7

Record 4 - Number of events

3..0

Record 4 - Elapsed time, seconds(bits 11..8)

7

7..0

Record 4 - Elapsed time, seconds(bits 7..0)

8

4..7

Record 5 - Number of events

3..0

Record 5 - Elapsed time, seconds(bits 11..8)

9

7..0

Record 5 - Elapsed time, seconds(bits 7..0)

The default counter update message transmission policy table described below.

Number of events since last counter update message transmission

Elapsed time since last counter update message transmission, seconds

0

3600

1

60

2

40

X

0xFFF - not used

X

0xFFF - not used

There is also a feature that allows you to set only used(defined) records of the policy table. So, for example, if you send just 2 bytes they will be interpreted as 1 record of the table and other records will be set as not used.

...


Heartbeat frequency uses port 55. The default value is 23 what is equal to 24 hours. The configuration selected is persistent.

Byte

Name

0

Heartbeat interval configuration

Interval = (value+1)hours

4.3.4 Debug configuration

...


Heartbeat NACK limit configuration uses port 72 and is used to specify how many heartbeat messages may be unacknowledged without initiating re-join procedure. The selected configuration is persistent. Default value is 3. 15 (0xF) and it is a special value that disables re-join functionality completely

Byte

Bits

Name

Default value

0

0..3

Heartbeat NACK limit

3

4..7

Reserved

0

4.3.6 Command

Command uses port 71 and it is used to initiate different commands mainly for debugging.

...