https://github.com/thin-edge/tedge-mapping-service
This is a sample service to map from a custom json format to tedge json format
https://github.com/thin-edge/tedge-mapping-service
Last synced: about 1 year ago
JSON representation
This is a sample service to map from a custom json format to tedge json format
- Host: GitHub
- URL: https://github.com/thin-edge/tedge-mapping-service
- Owner: thin-edge
- License: apache-2.0
- Created: 2024-06-04T12:08:06.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-06-06T15:50:42.000Z (about 2 years ago)
- Last Synced: 2025-01-30T12:19:41.671Z (over 1 year ago)
- Language: Python
- Size: 26.4 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# tedge-mapping-service
Thin-edge.io can be extended with plugins or operations. This is a sample how to add a custom service that performs some business logic.
In this case the service maps from a custom json format to tedge json format.
Publish custom measurement:
```
tedge mqtt pub custom/signal '{"value":90}'
```
This measurement is converted to:
```
{ "temperature": {"value": 180 } }
```
and published on the topic: `te/device/main///m/c8y_Temperature`
## Requirements
- Ubuntu >= 22.04 or Debian >= 11.0
- Python >= 3.8, including [paho-mqtt](https://pypi.org/project/paho-mqtt/)
- systemd
- for operations support: thin-edge.io >= 1.1.0
## Build
A package of the service, can be build with nfpm. To build the packages locally, make sure to install nfpm first.
The package requires a python3 installation on your device.
To create the packages, you need to install nfpm first:
[Install nfpm](https://nfpm.goreleaser.com/install/)
### Debian package
After installing, you can build the Debian package with:
nfpm pkg --packager deb --target /tmp/
## Deployment
### As deb file
Run `sudo dpkg -i tedge-mapping-service--.deb`