NRC1 #
NRC1 is a access controller for electronic locks.
Features:
- NB-IoT connectivity
- Bluetooth
- Supports a variety of electronic locks
- NFC reader
- Colour display
Modules #
NRC1 is assembled from four generic modules. None of them is specific to NRC1: each has its own repository, release cycle and version, and is shared with the other products that use it.
| Module | Role in NRC1 |
|---|---|
gw |
Gateway. The NB-IoT modem and cloud link, Bluetooth, the lock driver, and the MIB controller the other three answer to |
nfc |
The NFC reader |
dis |
The colour display |
sun |
The sensor unit |
The service table below does not line up one-to-one with this list — it names
six services across the modules and none of sun’s. Modules and services are
separate axes.
Services #
| Service | Description |
|---|---|
| access | Access control |
| battery | Battery monitoring |
| lock | Lock handling |
| modem | Cloud connectivity |
| nfc_uid_acl | NFC UID Access Control List |
| dis | Display handling |
Getting started #
Prerequisites:
- API key for api access
- A NRC1 device with it’s ID number printed on the back
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 NRC1:
curl -H "X-API-Key: <api key>" \
https://api.nr.iotready.no/api/v1/product/NRC1/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 Lock #
The default lock configuration is nolock, which disables all lock functionality.
Set lock to monostable type:
curl -H "X-API-Key: <api key>" -X PUT -d '{"enable":true,"monostable":{}}' \
https://api.nr.iotready.no/api/v1/device/<dev_id>/service/lock/config/value
Note: The new configuration will only be available on the devices after it has gone online due to an event.
Configure access control #
By default the access control allows any UID to open the lock. This can be disabled:
curl -H "X-API-Key: <api key>" -X PUT -d '{"enable":true,"open_access":false}' \
https://api.nr.iotready.no/api/v1/device/<dev_id>/service/access/config/value
Then set the access control list:
curl -H "X-API-Key: <api key>" -X PUT \
-d '{"enable":true,"uids":["12345678","ABCDEF00"]}' \
https://api.nr.iotready.no/api/v1/device/<dev_id>/service/nfc_uid_acl/config/value
Note: The new configuration will only be available on the devices after it has gone online due to an event.
Note: For long UID lists it will be synchronized in small chunks, so a full update will take some time. However, the synchronization mechanism uses delta updates, so any small updates will be fast in comparison.
Configure display #
If the device is mounted in a different orientation, you can rotate the display as needed:
curl -H "X-API-Key: <api key>" -X PUT -d '{"rotation":{"angle":270}}' \
https://api.nr.iotready.no/api/v1/device/<dev_id>/service/dis/config/value
Note: The new configuration will only be available on the devices after it has gone online due to an event.
Listen for events #
Events 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/#"
Events are namespaced by service in the MQTT topic and these are the important ones:
| Service | Event | Description |
|---|---|---|
| access | event | Access control events |
| battery | status | Battery status |
| modem | uestats | Modem connection information |
Errors #
The following error events can be reported: