Skip to content

skni-umcs/czujniki-admin

Repository files navigation

Administration Service for Sensors

This service is responsible for managing sensors and storing various technical information.

How to run and test

docker compose up -d 

locally, whole API can be seen here:

localhost:8000/docs#

What is used

MQTT

MQTT is used for a two-way communication between the API and gateway.

Valid MQTT messages received by service

Sensor Data

{
    "source_id": int,
    "cpu_temp": int,
    "noise": int,
    "free_heap": int,
    "raw_packet": str,
    "hop_data": [[int,int],...],
    "timestamp": time/str,
    "queue_fill": int
}

Right now, partially filled messages will not be processed.

MQTT messages send by service

New frequency for sensor

{
    "sensor_id": str,
    "new_frequency_temp": 0
}

.env file is required to run the service:

DB_HOST=[database host]
DB_PORT=[database port]
DB_USER=[database username]
DB_PASSWORD=[database user password]
DB_NAME= [database name]
ROOT_PATH=[root path for the service, should be set to '/']
KEYCLOAK_SERVER_URL=[keycloak server url]
KEYCLOAK_REALM=[keycloak realm]
KEYCLOAK_ALGO=[keycloak algorithm]
MQTT_CLIENT=[mqtt client id]
MQTT_BROKER=[mqtt broker url]
MQTT_PORT=[mqtt broker port]
MQTT_TOPIC_RECEIVE=[mqtt topic for receiving data]
MQTT_TOPIC_SEND=[mqtt topic for sending data]

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages