mirror of
https://gitlab.com/fabinfra/fabaccess/fabfire_adapter.git
synced 2025-03-12 14:51:50 +01:00
Update README to reflect installation notes and general things
This commit is contained in:
parent
ab389ac2ed
commit
4e6674cd61
60
README.md
60
README.md
@ -1,13 +1,45 @@
|
|||||||
FabFire Adapter
|
FabFire Adapter
|
||||||
===
|
===
|
||||||
The FabFire adapter translates mqtt messages from the reader hardware to api calls to bffhd.
|
|
||||||
|
|
||||||
# Usage
|
The FabFire adapter translates MQTT messages from the FabReader hardware to API calls to bffhd.
|
||||||
## Configuration in `config.toml`
|
|
||||||
|
# Installation
|
||||||
|
|
||||||
|
## With python3-venv
|
||||||
|
|
||||||
|
Easy, native installation without overhead is possible with python3 virtual environment:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
cd /opt/fabinfra/adapters/
|
||||||
|
git clone https://gitlab.com/fabinfra/fabaccess/fabfire_adapter.git --recursive
|
||||||
|
cd fabfire_adapter/
|
||||||
|
python3 -m venv env
|
||||||
|
. env/bin/activate
|
||||||
|
pip3 install -r requirements.txt
|
||||||
|
```
|
||||||
|
|
||||||
|
## With the Dockerfile and Podman
|
||||||
|
|
||||||
|
You can also install the fabfire adapter using Docker or Podman:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
podman build -f Dockerfile -t fabinfra/fabfire_adapter
|
||||||
|
podman run localhost/fabinfra/fabfire_adapter:latest
|
||||||
|
|
||||||
|
#cleanup if required:
|
||||||
|
podman system prune
|
||||||
|
```
|
||||||
|
|
||||||
|
# Configuration
|
||||||
|
|
||||||
|
Edit the config file example provided in `config/config.toml`
|
||||||
|
|
||||||
1. Set `hostname` and `port` for your MQTT Broker and bffhd instance
|
1. Set `hostname` and `port` for your MQTT Broker and bffhd instance
|
||||||
2. Add your readers to the `[readers]` section. Every reader needs a unique subsection name:
|
|
||||||
```toml
|
2. Add your desired readers to the `[readers]` section. Every reader needs a unique subsection name:
|
||||||
[readers]
|
|
||||||
|
```toml
|
||||||
|
[readers]
|
||||||
[readers.REPLACEME]
|
[readers.REPLACEME]
|
||||||
id = "111"
|
id = "111"
|
||||||
machine = "urn:fabaccess:resource:Testmachine"
|
machine = "urn:fabaccess:resource:Testmachine"
|
||||||
@ -15,14 +47,16 @@ The FabFire adapter translates mqtt messages from the reader hardware to api cal
|
|||||||
[readers.REPLACEMETOO]
|
[readers.REPLACEMETOO]
|
||||||
id = "222"
|
id = "222"
|
||||||
machine = "urn:fabaccess:resource:Another"
|
machine = "urn:fabaccess:resource:Another"
|
||||||
```
|
```
|
||||||
|
|
||||||
|
# Running
|
||||||
|
|
||||||
|
1. Run the adapter:
|
||||||
|
|
||||||
|
2. ```shell
|
||||||
|
python3 main.py
|
||||||
|
```
|
||||||
|
|
||||||
## Running
|
|
||||||
1. Install the requirements with `pip install -r requirements.txt`
|
|
||||||
2. Run the adapter with at least python 3.7
|
|
||||||
```shell
|
|
||||||
python3 main.py
|
|
||||||
```
|
|
||||||
3. The adapter has to remain running for the readers to work
|
3. The adapter has to remain running for the readers to work
|
||||||
|
|
||||||
# Provisioning
|
# Provisioning
|
||||||
|
Loading…
x
Reference in New Issue
Block a user