https://github.com/hello-nrfcloud/kartverket-vasstand
Publishes the seawater levels from https://www.kartverket.no/ as custom devices on hello.nrfcloud.com/map
https://github.com/hello-nrfcloud/kartverket-vasstand
aws cdk cellular-iot hello-nrfcloud map nordicsemiconductor
Last synced: 2 months ago
JSON representation
Publishes the seawater levels from https://www.kartverket.no/ as custom devices on hello.nrfcloud.com/map
- Host: GitHub
- URL: https://github.com/hello-nrfcloud/kartverket-vasstand
- Owner: hello-nrfcloud
- License: bsd-3-clause
- Created: 2024-04-17T12:47:55.000Z (about 2 years ago)
- Default Branch: saga
- Last Pushed: 2026-04-05T10:00:14.000Z (3 months ago)
- Last Synced: 2026-04-05T11:24:53.316Z (3 months ago)
- Topics: aws, cdk, cellular-iot, hello-nrfcloud, map, nordicsemiconductor
- Language: TypeScript
- Homepage: https://hello.nrfcloud.com/map/#id:flashing-entozoic-filatory!s:model:kartverket-vasstandsdata!m:4.257012404239944:65.99607475371971,16.771625841773357!t:describe-model:di;14230;0
- Size: 3.13 MB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Custom sensor data on `hello.nrfcloud.com/map`
[](https://github.com/hello-nrfcloud/kartverket-vasstand/actions/workflows/test-and-release.yaml)
[](https://github.com/semantic-release/semantic-release)
[](https://renovatebot.com)
[](https://github.com/conventional-changelog/commitlint/tree/master/@commitlint/config-conventional)
[](https://github.com/prettier/prettier/)
[](https://github.com/typescript-eslint/typescript-eslint)
Publishes the seawater levels from [kartverket.no](https://www.kartverket.no/)
as custom devices on
[hello.nrfcloud.com/map](https://hello.nrfcloud.com/map/#id:flashing-entozoic-filatory!s:model:kartverket-vasstandsdata!m:4.257012404239944:65.99607475371971,16.771625841773357!t:describe-model:di;14230;0).
This project serves as an example of how arbitrary device data can be visualized
on `hello.nrfcloud.com/map` by leveraging LwM2M data objects.
To describe the seawater level readings, the object
[`14230`](https://github.com/hello-nrfcloud/proto-map/blob/v5.3.0/lwm2m/14230.xml)
has been registered in the
[protocol repository](https://github.com/hello-nrfcloud/proto-map/).
In addition, the device has been described in the model definition
[`kartverket-vasstandsdata`](https://github.com/hello-nrfcloud/proto-map/tree/v5.3.0/models/kartverket-vasstandsdata)
in the same repository.
For each water level station (e.g. `BGO` or `TRD`) a device has been
[registered](https://hello.nrfcloud.com/map/#add-device).
Using the credentials created during the registration process, the code in this
repository now connects to the
[API for water level data](https://vannstand.kartverket.no/tideapi_en.html) and
fetches the most recent measurements.
The measurements are then converted to the LwM2M object `14230`, serialized as
[SenML](https://datatracker.ietf.org/doc/html/rfc8428) and published on the
[nRF Cloud MQTT API](https://docs.nordicsemi.com/bundle/nrf-cloud/page/APIs/MQTT/MQTTOverview.html).
The `hello.nrfcloud.com/map` backend
[converts](https://github.com/hello-nrfcloud/map-backend/blob/v1.3.3/features/SenMLMQTTIngest.feature.md)
these messages then back to LwM2M object so it can be
[displayed on the map](https://hello.nrfcloud.com/map/#id:flashing-entozoic-filatory!s:model:kartverket-vasstandsdata!m:4.257012404239944:65.99607475371971,16.771625841773357!t:describe-model:di;14230;0).
## Installation in your AWS account
### Setup
[Provide your AWS credentials](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-authentication.html).
Install the dependencies:
```bash
npm ci
```
### Deploy
```bash
npx cdk bootstrap # if this is the first time you use CDK in this account
npx cdk deploy
```
### Configure
Configure the nRF Cloud team ID:
```bash
aws ssm put-parameter --name /${STACK_NAME:-kartverket-vasstand}/nrfcloud/account/accountId --type String --value ""
```
Configure the station credentials:
```bash
aws ssm put-parameter --name /${STACK_NAME:-kartverket-vasstand}/credentials//deviceId --type String --value ""
aws ssm put-parameter --name /${STACK_NAME:-kartverket-vasstand}/credentials//certificate --type String --value ""
aws ssm put-parameter --name /${STACK_NAME:-kartverket-vasstand}/credentials//privateKey --type String --value ""
```
#### Station IDs
| Station ID |
| ---------- |
| `ANX` |
| `BGO` |
| `BOO` |
| `BRJ` |
| `HFT` |
| `HAR` |
| `HEI` |
| `HRO` |
| `HVG` |
| `KAB` |
| `KSU` |
| `LEH` |
| `MSU` |
| `MAY` |
| `NVK` |
| `NYA` |
| `OSC` |
| `OSL` |
| `RVK` |
| `SBG` |
| `SIE` |
| `SOY` |
| `SVG` |
| `TRG` |
| `TOS` |
| `TRD` |
| `TAZ` |
| `VAW` |
| `VIK` |
| `AES` |
## Continuous Deployment using GitHub Actions
After deploying the stack manually once,
- configure a GitHub Actions environment named `production`
- create the secret `AWS_ROLE` with the value
`arn:aws:iam:::role/-cd` and a variable (use the
`cdRoleArn` stack output)
- create the variable `AWS_REGION` with the value `` (your region)
- create the variable `STACK_NAME` with the value `` (your stack
name)
to enable continuous deployment.