Efento NB-IoT sensors – CoAP loader integration

Efento CoAP loader

We have created a CoAP loader application which sets up a CoAP server on a machine, handles the communication with sensors and forwards the data over REST API to the selected endpoint.

In order to set up the application:

  1. Download Efento CoAP loader using this link
  2. Modify the settings in application.yml file, to match your setup:
    1. Endpoint – address of the REST endpoint where you want receive measurements from the CoAP loader
    2. appPort – coap loader application running port
    3. coapPort – port on which the CoAP loader listens to the messages from the sensors
  3. Run the application on the machine (go to the folder where the files are saved and type java -jar coapgateway.jar). Make sure that the machine on which the CoAP loader is running either has a public IP address or (if it is behind the NAT) has the CoAP port forwarded on the router.
  4. In the main directory (where the .jar file is located) a log file (log.log) will be created
  5. Configure the sensor to send the data to the server, on which the CoAP loader is running
    1. Download the app from Google Play, and select “Nearby devices” mode
    2. Enable “Power user mode” – open the application menu (menu icon in the upper left corner) and quickly tap 10 times on Efento Logo
    3. Wait for few seconds for the application to find the sensor over BLE interface
    4. Connect to the sensor and from the configuration menu (three dots in the upper right corner) choose “Server configuration”-> „Other”
    5. Enter the IP address of the server, on which the CoAP loader is running and the port number on which the machine is listening to CoAP packets
    6. Optionally, you can also change the transmission and measurement intervals
    7. Once the sensor sends the data to the server, you will see it in the command line
  6. CoAP loader will forward all the measurements over the REST API to the endpoint you set in the first step of the configuration. Make sure that your application response contains response status code 2xx (eg. 201, 204, 205).

REST communication CoAP Loader -> User’s platform

EFENTO Gateway API specification v.3.0
ENDPOINT /api/v3/measurements
METHOD POST
HEADERS Content-Type: application/json

charset=UTF-8

X-Api-Token:”optional api token

BODY
{

  "measurements" : [

  {

    "serial" : [string], // serial number of the sensor

    "response_handle":[number], // sensor number in response (optional)

    "battery" : [string], // battery level: ok/low

    "signal" : [number], // signal quality indicator based on RSSI. Values described below

    "measured_at" : [string], // UTC date

    "measurement_interval" : [number], // measurement interval in seconds

    "next_measurement_at" : [string], // next connection date

    "params" : [

      {

        "channel" : [number], // sensor channel number: 1/2/3

        "type" : [string], //  temperature/humidity/pressure/pressure_diff/open-close

        "value" : [string]

      }

    ]

  }

  ]

}

Example:

{

  "measurements" : [

  {

    "serial" : "282C024FFFB1",

    "response_handle": 1,

    "battery" : "ok",

    "signal" : 13,

    "measured_at" : "2018-10-12 15:28:21",

    "measurement_interval" : 180,

    "next_measurement_at" : "2018-10-12 18:28:21",

    "params" : [

      { "channel" : 1, "type" : "temperature", "value" : 6 }

    ]

  },

  {

    "serial" : "282C024FFFB2",

    "response_handle": 2,

    "battery" : "ok",

    "signal" : 21,

    "measured_at" : "2018-10-12 15:28:21",

    "measurement_interval" : 180,

    "next_measurement_at" : "2018-10-12 18:58:21",

    "params" : [

      { "channel" : 1, "type" : "temperature", "value" : 12},

      { "channel" : 2, "type" : "humidity", "value" : 51}

    ]

  },

  {

    "serial" : "282C024FFFB3",

    "response_handle": 3,

    "battery" : "ok",

    "signal" : 3,

    "measured_at" : "2018-10-12 15:28:21",

    "measurement_interval" : 180,

    "next_measurement_at" : "2018-10-12 20:28:21",

    "params" : [

      { "channel" : 1, "type" : "temperature", "value" : 50},

      { "channel" : 2, "type" : "humidity", "value" : 30},

      { "channel" : 3, "type" : "pressure_diff", "value" : 21 }

     ]

  },

  {

    "serial" : "282C024FFFB4",

    "response_handle": 4,

    "battery" : "ok",

    "signal" : 7,

    "measured_at" : "2018-10-12 15:28:21",

    "measurement_interval" : 180,

    "next_measurement_at" : "2018-10-12 16:28:21",

    "params" : [
 
      { "channel" : 1, "type" : "open-close", "value" : 0},

      { "channel" : 2, "type" : "open-close", "value" : 1},

      { "channel" : 3, "type" : "open-close", "value" : 1}

    ]

  }

 ]

}
CORRECT RESPONSE Response with response status code 2xx (e.g. 201, 204, 205).

Response body can be empty or can be used to send the new configuration to the sensor. Details of the new configuration settings are described in the next chapter.

INCORRECT RESPONSE All the other response status codes.

Signal quality indicator returns values based on the RSSI

Value RSSI [dBm] Interpretation
[0; 15] [-110; -95] Marginal
[16; 25] [-94; -85] OK
[26; 35] [-84; -75] Good
[36; 63] [-74; -48] Excellent

Changing sensor’s settings

Efento CoAP loader can be used to remotely change the sensor’s settings. To change the sensor’s settings, your application has to send a new configuration to the CoAP loader in the response body. All the sensor settings are described in the “Efento NB-IoT sensor User manual”, which can be found at getefento.com/support

REST communication User’s platform -> CoAP Loader

CORRECT RESPONSE Response with response status code 2xx (e.g. 201, 204, 205).

Response body can be empty or can be used to send the new configuration to the sensor. Details of the new configuration settings are described in the next chapter.

RESPONSE BODY
{

  "measurementPeriodBase":180,

  "measurementPeriodFactor":14,

  "transmissionInterval":10800,

  "ackInterval":1000,

  "ackIntervalMode":"VALUE",

  "bleTurnoffTimeout":3600,

  "bleTurnoffTimeoutMode":"VALUE",

  "requestDeviceInfo":false,

  "requestFirmwareUpdate":false,

  "disabledSendingConfig":false,

  "transferLimit":10,

  "transferLimitMode":"VALUE",

  "transferLimitTimer":1500,

  "transferLimitTimerMode":"VALUE",

  "serverDataIp":"52.22.22.22",

  "serverDataPort":5683,

  "apn":"nbiot.com",

  "apnMode":"VALUE",

  "plmn":123456,

  "plmnMode":"VALUE",

  "serverUpdateIp":"52.22.22.22",

  "serverUpdatePortCoap":5683,

  "serverUpdatePortUdp":50000,

  "detachRequest":100,

  "acceptWithoutTesting":true,

  "cloudToken":"c96f98ce-bccf-4413-8ac3-77dfd33cd07c",

  "cloudTokenConfig":"CLOUD_TOKEN_VALUE",

  "supervisionPeriod":180,

  "supervisionPeriodMode":"VALUE",

  "requestMemoryReset":false,

  "bands":[

    1

  ],

  "alarmRules":[

    {

      "slotNumbers":[

        0

      ],

    "condition":"HIGH_THRESHOLD",

    "action”: “TRIGGER_TRANSMISSION",

    "alarmRuleType":"TEMPERATURE",

    "threshold":8,

    "hysteresis":0.5,

    "averageMode":"MOVING_AVERAGE",

    "averageNumberOfSamples": 5

    }

  ]

}

Parameters values

Parameters sent in the response body (JSON) can have the following values:

measurementPeriodBase // number, 1 – 36000

measurementPeriodFactor // number, 1 – 100

transmissionInterval // number, 60 – 604800

ackInterval // number, 1 – 2592000

ackIntervalMode, // enum (string): “NOT_SEND”, “VALUE”, “ALWAYS_ACK”, “NEVER_ACK”

bleTurnoffTimeout // number, 60 – 604800

bleTurnoffTimeoutMode // enum (string): “NOT_SEND”, “VALUE”, “ALWAYS_ON”

requestDeviceInfo // boolean, true or false

requestFirmwareUpdate // boolean, true or false

transferLimit // number, 1 – 65534

transferLimitMode // enum (string): “NOT_SEND”, “VALUE”, “DISABLE”

transferLimitTimer // number, 1 – 65534

transferLimitTimerMode // enum (string): “NOT_SEND”, “VALUE”, “DISABLE”

serverDataIp // string, correct ip address format NNN.NNN.NNN.NNN

serverDataPort // number, 1 – 65535

apn // string, length: 1 – 49

apnMode // enum (string): “NOT_SEND”, “VALUE”, “AUTO”

plmn // number, 10000 – 999999

plmnMode // enum (string): “NOT_SEND”, “VALUE”, “AUTO”

serverUpdateIp // string, correct ip address format NNN.NNN.NNN.NNN

serverUpdatePortCoap // number, 1 – 65534

serverUpdatePortUdp // number, 1 – 65534

detachRequest // number, 1 – 604800

acceptWithoutTesting // boolean, true or false

cloudToken // string, value: c96f98ce-bccf-4413-8ac3-77dfd33cd07c

cloudTokenConfig // enum (string): “CLOUD_TOKEN_VALUE”, “CLOUD_TOKEN_IMEI”, “CLOUD_TOKEN_SENDING_DISABLED”

supervisionPeriod // number, 180 – 5184000

supervisionPeriodMode // enum (string): “NOT_SEND”,  “VALUE”, “DISABLE”

requestMemoryReset // boolean, true or false

bands // array of integers, possible values: 1, 2, 3, 4, 5, 6, 8, 12, 13,17, 18, 19, 20, 25, 26, 28, 66, 71, 85

dataEndpoint // string, length: 1 – 16

configurationEndpoint // string, length: 1 – 16

deviceInfoEndpoint // string, length: 1 – 16

timeEndpoint // string, length: 1 – 16

cloudTokenCoapOption // number, 1 – 64999

cloudTokenCoapOptionMode // enum (string): “NOT_SEND”, “VALUE”, “SEND_IN_PAYLOAD”

payloadSignatureCoapOption // number, 1 – 64999

payloadSingatureCoapOptionMode // enum (string): “NOT_SEND”, “VALUE”, “NO_PAYLOAD”

dnsServerIp // array of 4 integers, possible values: 0 – 255

dnsTtlConfig // number, 1 – 864000

dnsTtlConfigMode // enum (string): “NOT_SEND”, “VALUE”, “ACCEPT”, “FAILED”

modemUpdateRequest // string, length: 1- 48

networkTroubleshooting // number, 1 – 2

encryptionKey // string, length: 1 – 16

encryptionKeyMode // enum (string): “NOT_SEND”, “VALUE”, “HEX_VALUE”, “DISABLED”

apnUserName // string, length: 1 – 31

apnUserNameMode // enum (string): “NOT_SEND”, “VALUE”, “AUTO”

apnPassword // string, length 1 – 31

apnPasswordMode // enum (string): “NOT_SEND”, “VALUE”, “AUTO”

ledConfig // array of integers, param of single 

     ledConfig[0] – green LED // Period of LEDs flashing (5-600 seconds in 5 seconds resolution):

     ledConfig[1] – red LED // Period of LEDs flashing (5-600 seconds in 5 seconds resolution):

// ledConfig[2] – ledConfig[7] Time from entering the normal state, after which the LED indicates is turned off (0-240 minutes in 1 minute resolution, or 255 for always turned on):

     ledConfig[2] – flashing red led on communication problem

     ledConfig[3] – flashing red led on a sensor problem

     ledConfig[4] – flashing red led on a low power

     ledConfig[5] – flashing green led on measurement

     ledConfig[6] – flashing green led on transmission 

     ledConfig[7] – flashing green led to indicate sensor’s proper operation

     ledConfig[8] – Blink duration ( 20 – 1000 ms in 5 ms resolution)

calibrationParametersRequest // object (calibrationParametersRequest), param of objects, described below

alarmRules // array of object (alarmRule), param of single alarm rule, described below

calendars // array of object (calendar), param of single calendar object, described below

outputControls // array of object (output control), param of single object, described below

 

CALIBRATION PARAMETERS REQUEST PARAMETERS

calibrationRequest // number, 1 – 6

channelAssignment // number, possible hex values: 0x0, 0x1, 0x4, 0x6, 0x8, 0x9,

0xA, 0xB, 0xC, 0xD, 0xE, 0x10,

0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19,

0x1A, 0x1B, 0x1C, 0x1E, 0x1F, 0x20,

0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 

0x29, 0x2A, 0x2B, 0x2C, 0x30,

0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38,

0x39, 0x3A, 0x3B, 0x3C, 0x3D, 0x3E, 0x3F, 0x40,

0x41

parameters // array of integers, max size = 8

 

ALARM RULE PARAMETERS

slotNumbers // array of integers, possible values: 0 – 5

condition // enum (string), non-null, values:

“DISABLED”

“HIGH_THRESHOLD”

“LOW_THRESHOLD”

“DIFF_THRESHOLD”

“BINARY_CHANGE_STATE”

action //enum (string)

“TRIGGER_TRANSMISSION”

“NO_ACTION”

“TRIGGER_TRANSMISSION_WITH_ACK”

alarmRuleType // enum (string):

“TEMPERATURE”

“HUMIDITY”

“ATMOSPHERIC_PRESSURE”,

“DIFFERENTIAL_PRESSURE”,

“PULSE_CNT”,

“ELECTRICITY_METER”,

“WATER_METER”,

SOIL_MOISTURE”,

“CO_GAS”,

“NO2_GAS”,

“H2S_GAS”,

“AMBIENT_LIGHT”,

“PM_1_0”,

“PM_2_5”,

“PM_10_0”,

“NOISE_LEVEL”,

“NH3_GAS”,

“CH4_GAS”,

“HIGH_PRESSURE”,

“DISTANCE_MM”,

“WATER_METER_ACC_MINOR”,

“WATER_METER_ACC_MAJOR”,

“HUMIDITY_ACCURATE”,

“STATIC_IAQ”,

“C02_EQUIVALENT”,

“BREATH_VOC”,

PERCENTAGE”,

“VOLTAGE”,

“CURRENT”,

“PULSE_CNT_ACC_MINOR”,

“PULSE_CNT_ACC_MAJOR”,

“ELEC_METER_ACC_MINOR”,

“ELEC_METER_ACC_MAJOR”,

“PULSE_CNT_ACC_WIDE_MINOR “,

“PULSE_CNT_ACC_WIDE_MAJOR”,

“CURRENT_PRECISE”

threshold // number

hysteresis // number

averageMode // enum (string): “MOVING_AVERAGE”, “WINDOW_MODE”, “CONSECUTIVE_SAMPLES”

averageNumberOfSamples // number, 1 – 10

logicOperator // enum (string): “AND”, “OR”

selectedRules // array of integers, possible values: 1 – 12

negatedRules // array of integers, possible values: values included in selectedRules

actionDelay // number, 0 – 8640010

returnDelay // number, 0 – 8640001, max parameter value disables action triggering on rule deactivation

numberOfMeasurementsToEverySend // number, 1 – 500

Param sets depend on the non-null condition param!

  • DISABLED
    • other fields set null (slotNumbers, alarmRuleType, threshold, hysteresis, averageMode, averageNumberOfSamples)

  • HIGH_THRESHOLD and LOW_THRESHOLD
    • set slotNumbers
    • set action
    • set alarmRuleType
    • set threshold
    • set hysteresis
    • set averageMode
    • set averageNumberOfSamples

  • DIFF THRESHOLD
    • set slotNumbers
    • set action
    • set alarmRuleType
    • set threshold
    • set averageMode
    • set averageNumberOfSamples
    • other fields set null (hysteresis)

  • BINARY_CHANGE_STATE
    • set slotNumbers
    • set action
    • other fields set null (alarmRuleType, threshold, hysteresis, averageMode, averageNumberOfSamples)
  • LOGIC_OPERATOR
      • set logicOperator
      • set action
      • set selectedRules
      • set negatedRules
      • set actionDelay
      • set returnDelay
      • other fields set null 
  • ON_MEASUREMENT
    • set numberOfMeasurementsToEverySend
    • set action
    • set selectedRules (optional, choose only one number)
    • set negatedRules (optional)
    • other fields set null

 

Range and resolution of threshold param depend on the alarmRuleType param!

  • TEMPERATURE
    • range: -273.2 – 4000.0
      • resolution: 0.1
  • HUMIDITY
    • range: 0 – 100
    • resolution: 1
  • IAQ
    • range: 0 – 500
    • resolution: 1
  • ATMOSPHERIC_PRESSURE
    • range: 1.0 – 2000.0
      • resolution: 0.1
  • DIFFERENTIAL_PRESSURE
    • range: -10000.0 – 10000.0
      • resolution: 1
  • PULSE_CNT
    • range: 0 – 8000000
    • resolution: 1
  • ELECTRICITY_METER
    • range: 0 – 8000000
      • resolution:  1
  • WATER_METER
    • range: 0 – 8000000
    • resolution: 1
  • SOIL_MOISTURE
    • range: -1000 – 0
    • resolution: 1
  • CO_GAS
    • range:0 – 1000000
    • resolution: 1
  • NO2_GAS
    • range:0 – 1000000
    • resolution: 1
  • H2S_GAS
    • range:0 – 80000.00
    • resolution: 0.01
  • AMBIENT_LIGHT
    • range:-0 – 100000.0
    • resolution: 0.1
  • PM_1_0
    • range:0 – 1000
    • resolution: 1
  • PM_2_5
    • range:0 – 1000
    • resolution: 1
  • PM_10_0
    • range:0 – 200
    • resolution: 1
  • NOISE_LEVEL
    • range:0 – 8000000.0
    • resolution: 0.1
  • NH3_GAS
    • range:0 – 1000000
    • resolution: 1
  • CH4_GAS
    • range:0 – 1000000
    • resolution: 1
  • HIGH_PRESSURE
    • range: 1 – 200000
    • resolution: 1
  • DISTANCE_MM
    • range: 1 – 100000
    • resolution: 1
  • WATER_METER_ACC_MINOR
    • range: 1 – 1000000
    • resolution: 1
  • WATER_METER_ACC_MAJOR
    • range: 1 – 1000000
    • resolution: 1
  • CO2_GAS
    • range: 1 – 1000000
    • resolution: 1
  • HUMIDITY_ACCURATE
    • range: 0.1 – 100.0
    • resolution: 0.1
  • STATIC_IAQ
    • range :1 – 10000
    • resolution: 1
  • C02_EQUIVALENT
    • range: 1 – 1000000
    • resolution: 1
  • BREATH_VOC
      • range: 0 – 100 000
      • resolution: 1
  • PERCENTAGE
      • range: 0 – 100.00
      • resolution: 0.01
  • VOLTAGE
      • range: 0 – 100 000
      • resolution: 0.1
  • CURRENT
      • range: 0 – 10 000
      • resolution: 0.01
  • PULSE_CNT_ACC_MINOR
      • range: 0 – 1 000 000
      • resolution: 1
  • PULSE_CNT_ACC_MAJOR
      • range: 0 – 1 000 000 000
      • resolution: 1
  • ELEC_METER_ACC_MINOR
      • range: 0 – 1 000 000 
      • resolution: 1
  • ELEC_METER_ACC_MAJOR
      • range: 0 – 1 000 000 000
      • resolution: 1
  • PULSE_CNT_ACC_WIDE_MINOR
      • range: 0 – 999 999
      • resolution: 1
  • PULSE_CNT_ACC_WIDE_MAJOR
      • range: 0 – 999 999 000 000
      • resolution: 1
  • CURRENT_PRECISE
    • range: 0 – 8 000
    • resolution: 0.001

Range and resolution of hysteresis param depend on the alarmRuleType param!

  • TEMPERATURE
    • range: 0.1 – 4273.2
      • resolution: 0.1
  • HUMIDITY
    • range: 1 – 100
    • resolution: 1
  • IAQ
    • range: 1 – 500
    • resolution: 1
  • ATMOSPHERIC_PRESSURE
    • range: 0.1 – 1999.0
      • resolution: 0.1
  • DIFFERENTIAL_PRESSURE
    • range: 1 – 20000.0
      • resolution: 1
  • PULSE_CNT
    • range: 1 – 8000000
    • resolution: 1
  • ELECTRICITY_METER
    • range: 1 – 8000000
      • resolution:  1
  • WATER_METER
    • range:1 – 8000000
    • resolution: 1
  • SOIL_MOISTURE
    • range:1 – 1000
    • resolution: 1
  • CO_GAS
    • range:1 – 1000000
    • resolution: 1
  • NO2_GAS
    • range:1 – 1000000
    • resolution: 1
  • H2S_GAS
    • range:0.01 – 80000.00
    • resolution: 0.01
  • AMBIENT_LIGHT
    • range:-0.1 – 100000.0
    • resolution: 0.1
  • PM_1_0
    • range:1 – 1000
    • resolution: 1
  • PM_2_5
    • range:1 – 1000
    • resolution: 1
  • PM_10_0
    • range:1 – 200
    • resolution: 1
  • NOISE_LEVEL
    • range:0.1 – 8000000.0
    • resolution: 0.1
  • NH3_GAS
    • range:1 – 1000000
    • resolution: 1
  • CH4_GAS
    • range:1 – 1000000
    • resolution: 1
  • HIGH_PRESSURE
    • range: 1 – 200000
    • resolution: 1
  • DISTANCE_MM
    • range: 1 – 100000
    • resolution: 1
  • WATER_METER_ACC_MINOR
    • range: 1 – 1000000
    • resolution: 1
  • WATER_METER_ACC_MAJOR
    • range: 1 – 1000000
    • resolution: 1
  • CO2_GAS
    • range: 1 – 1000000
    • resolution: 1
  • HUMIDITY_ACCURATE
    • range: 0.1 – 100.0
    • resolution: 0.1
  • STATIC_IAQ
    • range :1 – 10000
    • resolution: 1
  • C02_EQUIVALENT
    • range: 1 – 1000000
    • resolution: 1
  • VOLTAGE
      • range: 0.1 – 100 000
      • resolution: 0.1
  • CURRENT
    • range: 0.01 – 10 000
    • resolution: 0.01
  • PULSE_CNT_ACC_MINOR
      • range: 1 – 1 000 000
      • resolution: 1
  • PULSE_CNT_ACC_MAJOR
      • range: 1 – 1 000 000 000
      • resolution: 1
  • ELEC_METER_ACC_MINOR
      • range: 1 – 1 000 000 
      • resolution: 1
  • ELEC_METER_ACC_MAJOR
      • range: 1 – 1 000 000 000
      • resolution: 1
  • PULSE_CNT_ACC_WIDE_MINOR
      • range: 1 – 999 999
      • resolution: 1|
  • PULSE_CNT_ACC_WIDE_MAJOR
      • range: 1 – 999 999 000 000
      • resolution: 1
  • CURRENT_PRECISE
      • range: 0.001 – 8 000
      • resolution: 0.001

CALENDAR PARAMETERS

enableRules // array of integers, possible values 1 – 12, max length = 12

type // enum (string): “DISABLED”, “WEEK”

days // array of integers, max length = 7 possible values: 0 – 6  ( 0 – Sunday … 6 – Saturday)  

fromTime // number, 0 – 1439 (minutes from midnight)

toTime // number, 0 – 1439 (minutes from midnight)

timezone // number, -48 – 56 (encoded as number of 15 minutes octets, example: UTC+1 -> timezone = 4)

 

OUTPUT CONTROL

channelNumber // integer, possible values 1 – 6

state // integer, possible values 0 – 1, (0 – OFF 1 – ON)

Examples

New settings Response body (JSON)
Set:

  • measurement period to 5 minutes (300s)
  • transmission interval to 1 hour (3600s)
{

  "measurementPeriodBase":300,

  "measurementPeriodFactor":1,

  "transmissionInterval":3600

}
Set:

  • APN to value “nbiot.com”
{

  "apn":"nbiot.com",

  "apnMode":"VALUE"

}

Set:

  • Server address to “45.45.45.45”
  • Server port to “1212”
  • Cloud token to “IMEI”
{

  "serverDataIp":"45.45.45.45",

  "serverDataPort":1212,

    "cloudTokenConfig":"CLOUD_TOKEN_IMEI"

}
Set:

  • Alarm rule “if the temperature on slot 0 is over 5 C, trigger the transmission”
  • Alarm rule “if the humidity on slot 1 is below 50%, trigger the transmission”
  • Alarm rule “if the change of the temperature on slot 0 is over 0.5C, trigger the transmission”
{

  "alarmRules":[

  {

    "slotNumbers":[

      0

    ],

    "condition":"HIGH_THRESHOLD",
    
    "action": "TRIGGER_TRANSMISSION"

    "alarmRuleType":"TEMPERATURE",

    "threshold":5,

    "hysteresis":0,

    "averageMode":"MOVING_AVERAGE",

    "averageNumberOfSamples": 1

  },

  {

    "slotNumbers":[

      1

    ],

    "condition":"LOW_THRESHOLD",

    "action": "TRIGGER_TRANSMISSION"

    "alarmRuleType":"HUMIDITY",

    "threshold":50,

    "hysteresis":0,

    "averageMode":"MOVING_AVERAGE",

    "averageNumberOfSamples": 1

  },

  {

    "slotNumbers":[

      0

    ],

    "condition":"DIFF_THRESHOLD",

    "action": "TRIGGER_TRANSMISSION"

    "alarmRuleType":"TEMPERATURE",

    "threshold":0.5,

    "hysteresis":0,

    "averageMode":"MOVING_AVERAGE",

    "averageNumberOfSamples": 1

    }

 ]

}
  • Remove alarm rules 0,1,2,4,5,6,7,8,9,10,11 from the sensor
  • Set rule 3 to “if the temperature on slot 0 is below 15 C, trigger the transmission”
  • Set rule 4 to “if the temperature on slot 0 is over 25 C, trigger the transmission”
  • Set rule 6 to “trigger transmission every 10 measurement if rule 4 is not activated”
  • Set rule 7 to “if rule 4 or 6 is active, trigger transmission after 1s, triggering after deactivation disabled”
  • Set calendar 2 to “enable rule 1, 8 and 12 every Sunday, Thursday and Saturday between 1:00 and 3:00 in UTC-2”
  • Remove calendar 1,3,4,5,6 from the sensor

Sensors can store up to 12 rules, with ids 0-11. Settings of each rule are sent in an array in JSON. All rules are equally important – there is no difference on which slot the rule is kept.

Sensors can store up to 6 calendars. Settings of each calendar are sent in an array in JSON. All calendars are equally important – there is no difference on which slot the calendar is kept.

{
        "alarmRules":[
                 {
                     "condition":"DISABLED"
                 },
                  {
                     "condition":"DISABLED"
                 },
                 {
                    "slotNumbers":[
                       0
                    ],
                    "condition":"LOW_THRESHOLD",
                    "action": "TRIGGER_TRANSMISSION",
                    "alarmRuleType":"TEMPERATURE",
                    "threshold":15,
                    "hysteresis":0,
                    "averageMode":"MOVING_AVERAGE",
                    "averageNumberOfSamples": 1
                },
                 {
                     "slotNumbers":[
                        0
                     ],
                     "condition":"HIGH_THRESHOLD",
                     "action": "TRIGGER_TRANSMISSION",
                     "alarmRuleType":"TEMPERATURE",
                     "threshold":25,
                     "hysteresis":0,
                     "averageMode":"MOVING_AVERAGE",
                     "averageNumberOfSamples": 1
                 },
                {
                     "condition":"DISABLED"
                 },
                 {
                    "condition":"ON_MEASUREMENT",
                    "action": "TRIGGER_TRANSMISSION",
                    "selectedRules": [4],
                    "negatedRules": [4],
                    "numberOfMeasurementsToEverySend": 10
                },
                  {
                     "condition":"LOGIC_OPERATOR",
                     "action":"TRIGGER_TRANSMISSION",
                     "logicOperator": "OR",
                     "selectedRules":[4,6],
                     "negatedRules":[],
                     "actionDelay": 1,
                     "returnDelay": 864001,
                 },
                  {
                     "condition":"DISABLED"
                 },
                 {
                     "condition":"DISABLED"
                 },
                  {
                     "condition":"DISABLED"
                 },
                  {
                     "condition":"DISABLED"
                 },
                  {
                     "condition":"DISABLED"
                 }
        ],
        "calendars":[
                 
                {
                     "type":"DISABLED",
                 },
                {
                     "enableRules": [1 ,8, 12],
                     "type":"WEEK",
                     "days": [0,4,6],
                     "fromTime": 60,
                     "toTime": 180,
                     "timezone": -8,
                 },
                {
                     "type":"DISABLED",
                 },
                {
                     "type":"DISABLED",
                 },
                {
                     "type":"DISABLED",
                 },
                {
                     "type":"DISABLED",
                 }
      
        ]
      } 

 

Troubleshooting

Issue: Server does not receive the data from the sensor

Check the cellular connection. Please download Efento mobile application for Android, connect to the sensor -> three dots in the upper right corner -> Cellular status

Supported technologies: [NBIOT]

Current technology: NBIOT

Registration status: REGISTERED

Registration reject cause: 0 0

Signal strength: 2

Communication status: OK

IMEI: 357518080647613

ICCID: 89470800190416017838

Sim card status: OK

Ip address: 10.81.172.63

ECL: LEVEL_1

Cell id: 02120f1c

Tracking area code: 0ce6

Last communication timestamp: 2020-11-23 08:52:13 UTC +01:00

Last status check timestamp: 2020-11-23 08:59:32 UTC +01:00

Seconds since last reset: 86800

If the Registration status is REGISTERED, ECL has any value (LEVEL_0, LEVEL_1, LEVEL_2) and Cell id also has a value, it means that the sensor is registered in the network and the issue is on the integration side.

Please check:

  • IP address of the server
  • Server port
  • APN settings – this has to be checked with your mobile network operator

If all of the points above are correct, the issue is probably in the integration.

Issue: Sensor is registered in the network, my application receives always the same data (retransmissions), “Communication status” shows “MISMATCH”

Your application (the one to which Efento CoAP loader forwards the data) responds with the wrong response status code. The response status code sent by your server must be 2xx.

To make sure that your application responds with the proper status code, send a JSON with measurements using any REST testing application (e.g. POSTMAN) to it. The response status code should be e.g. “201 CREATED”

Issue: Sensor is registered in the network, server does not receive the data, “Communication status” shows “TIMEOUT”

If the IP address, server port, APN are set correctly and APN allows you to access the server, most probably the issue is in the response body sent by your application (the one to which Efento CoAP loader forwards the data) to Efento CoAP loader – the response status code is not 2xx.

Issue: Sensor is registered in the network, but is not able to communicate with the server. My server responds with proper response code and body

Please raise a ticket at help.efento.io. Please attach all the information from the “Cellular status”