An open API service indexing awesome lists of open source software.

https://github.com/nubeio/rubix-point-server


https://github.com/nubeio/rubix-point-server

bac0 bacnet bacpypes flask pymodbus

Last synced: 4 months ago
JSON representation

Awesome Lists containing this project

README

          

# Rubix Point Server

## Running in development

- Use [`poetry`](https://github.com/python-poetry/poetry) to manage dependencies
- Simple script to install

```bash
./setup.sh
```

- Join `venv`

```bash
poetry shell
```

- Build local binary

```bash
poetry run pyinstaller run.py -n rubix-point --clean --onefile \
--add-data VERSION:. \
--add-data config:config
```

The output is: `dist/rubix-point`

## Docker build

### Build

```bash
./docker.sh
```

The output image is: `rubix-point:dev`

### Run

```bash
docker volume create rubix-point-data
docker run --rm -it -p 1515:1515 -v rubix-point-data:/data --name rubix-point rubix-point:dev
```

## Deploy on Production

- Download release artifact
- Review help and start

```bash
$ rubix-point -h
Usage: rubix-point [OPTIONS]

Options:
-p, --port INTEGER Port [default: 1515]
-g, --global-dir PATH Global dir
-d, --data-dir PATH Application data dir
-c, --config-dir PATH Application config dir
--prod Production mode
-s, --setting-file TEXT Rubix Point: setting json file
-l, --logging-conf TEXT Rubix Point: logging config file
--workers INTEGER Gunicorn: The number of worker processes for handling requests.
--gunicorn-config TEXT Gunicorn: config file(gunicorn.conf.py)
--log-level [FATAL|ERROR|WARN|INFO|DEBUG]
Logging level
-h, --help Show this message and exit.
```

## DOCS
___
### Config

#### Development
```bash
cp config/config.example.json config/config.json

python run.py -s config/config.json
```

### MQTT client

#### Topic structure:
```
//////rubix/points/value//...
//////rubix/points/value/cov////////
//////rubix/points/value/model//
```
```
COV:
//////rubix/points/value/cov/all///////

[optional] (value only)
//////rubix/points/value/cov/value///////

MODEL:
//////rubix/points/value/model//
```

Debug topic
```
//////rubix/points/debug
```

Debug topic example
```
+/+/+/+/+/+/rubix/points/debug
```

#### Example topics:

**COV:**
```
all points:
//////rubix/points/value/cov/all/#

all modbus rtu points:
//////rubix/points/value/cov/all/modbus/+/+/+/+/+/+

by point uuid:
//////rubix/points/value/cov/all/+/+/+/+/+//+

by point name:
//////rubix/points/value/cov/all/+/+//+//+/
```
**List:**
```
points list:
//////rubix/points/value/points

schedule list:
//////rubix/points/value/schedules
```

### Generic Points MQTT Listener

- All generic point values are updated over MQTT
- These COVs are then broadcast again over the normal MQTT clients as above

#### Topic structure:

```
///rubix/points/listen/cov/name///
///rubix/points/listen/cov/uuid/
```

### Schedule Value
```
///rubix/points/listen/schedules//
```