NRC2

NRC2 #

NRC2 is a fill level sensor.

Features:

  • NB-IoT connectivity
  • Bluetooth
  • Time-of-Flight (ToF) multi-zone sensor. 8x8 matrix with 63° diagonal FoV
  • Movement sensor
  • Magnetic proximity sensor

Config #

Config json schema available on api/v1/device/<dev_id>/config/schema:

curl -H "X-API-Key: <api key>" \
    https://api.nr.iotready.no/api/v1/device/<dev_id>/config/schema
Field Type Description
modem object modem configuration
modem.interval int Interval in seconds between scheduled connection
ran object object
ran.enable bool Enable range sensor
ran.interval_s int Interval in seconds between range measurements
imug object Inertial Measurement Unit configuration
imug.motion object Motion detection configuration
imug.motion.enable bool Enable motion detection
mag object Magnetic configuration
mag.enable bool Enable detection

Example config object:

{
    "modem": {
        "interval": 64800
    },
    "ran": {
        "enable": true,
        "interval_s": 43200,
    },
    "imug": {
        "motion": {
            "enable": true
        }
    },
    "mag": {
        "enable": true,
    }
}

Messages #

Service Name Description
battery status Battery status
imug event Inerital Measurement Unit (IMU) events
mag event Magnetic detector events
modem uestats Modem connection information
ran event Range events

Getting started #

Prerequisites:

  • API key for api access
  • A NRC2 device with it’s ID number printed on the casing

Claim access to device: #

The device is only available after it has been claimed:

curl -H "X-API-Key: <api key>" -X PUT \
    https://api.nr.iotready.no/api/v1/device/<dev_id>

Then it will be available in bulk operation for NRC2:

curl -H "X-API-Key: <api key>" \
    https://api.nr.iotready.no/api/v1/product/NRC2/devices

And also directly:

curl -H "X-API-Key: <api key>" https://api.nr.iotready.no/api/v1/device/<dev_id>

Optionally it’s possible to set your own metadata in order to avoid having your own database:

curl -H "X-API-Key: <api key>" -X PUT -H "Content-Type: application/json" \
    -d '{"customer":"customer1","group":"group1"}' \
    https://api.nr.iotready.no/api/v1/device/<dev_id>/external

Configure #

Configure to default (18h) modem interval and 12h range sampling interval.

curl -H "X-API-Key: <api key>" -X PUT \
    -d '{"modem":{"interval":64800},"ran":{"enable":true,"interval_s":43200}}' \
    https://api.nr.iotready.no/api/v1/device/<dev_id>/config/value
Note: The new configuration will only be available on the devices after it has gone online due to an event.

Listen for messages #

Messages can be subscribed to over MQTT:

mosquitto_sub -v --capath /etc/ssl/certs \
    -L "mqtts://X-API-Key:<api key>@api.nr.iotready.no/v1/upstream/#"