Mainflux.mainflux/lora
Mirko Teodorovic 39a649c1bb
MF-1342 - Use environment variables in docker-compose to use tagged version of image (#1343)
* add MF_RELEASE_TAG

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* update readme file for MF_RELEASE_TAG

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* update readme file for MF_RELEASE_TAG

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix explanation, space

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix bad search/replace

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix bad search/replace

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* minor changes

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* fix readme

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* improve explanation for tag

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* replace snippet with link to code section

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* improve explanation for tag

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* replace snippet with link to code section

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>

* remove MF_RELEASE_TAG from service readme

Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
2021-02-02 16:26:02 +01:00
..
api MF-886 - Add OPC-UA adapter (#878) 2019-10-22 17:44:19 +02:00
redis MF-1129 - Use snake_case for Lora and OPC-UA metadata fields (#1130) 2020-04-21 17:49:17 +02:00
README.md MF-1342 - Use environment variables in docker-compose to use tagged version of image (#1343) 2021-02-02 16:26:02 +01:00
adapter.go MF-1190 - Add pkg for library packages (#1191) 2020-06-03 15:16:19 +02:00
message.go NOISSUE - Fix lora-adapter Object decode (#610) 2019-02-22 15:30:37 +01:00
routemap.go MF-788 - Remove date and minimize copyright comments (#876) 2019-10-07 16:14:47 +02:00

README.md

LoRa Adapter

Adapter between Mainflux IoT system and LoRa Server.

This adapter sits between Mainflux and LoRa server and just forwards the messages from one system to another via MQTT protocol, using the adequate MQTT topics and in the good message format (JSON and SenML), i.e. respecting the APIs of both systems.

LoRa Server is used for connectivity layer and data is pushed via this adapter service to Mainflux, where it is persisted and routed to other protocols via Mainflux multi-protocol message broker. Mainflux adds user accounts, application management and security in order to obtain the overall end-to-end LoRa solution.

Configuration

The service is configured using the environment variables presented in the following table. Note that any unset variables will be replaced with their default values.

Variable Description Default
MF_LORA_ADAPTER_HTTP_PORT Service HTTP port 8180
MF_LORA_ADAPTER_LOG_LEVEL Service Log level error
MF_NATS_URL NATS instance URL nats://localhost:4222
MF_LORA_ADAPTER_MESSAGES_URL LoRa Server MQTT broker URL tcp://localhost:1883
MF_LORA_ADAPTER_ROUTE_MAP_URL Route-map database URL localhost:6379
MF_LORA_ADAPTER_ROUTE_MAP_PASS Route-map database password
MF_LORA_ADAPTER_ROUTE_MAP_DB Route-map instance 0
MF_THINGS_ES_URL Things service event source URL localhost:6379
MF_THINGS_ES_PASS Things service event source password
MF_THINGS_ES_DB Things service event source DB 0
MF_LORA_ADAPTER_EVENT_CONSUMER Service event consumer name lora

Deployment

The service itself is distributed as Docker container. Check the lora-adapter service section in docker-compose to see how service is deployed.

To start the service outside of the container, execute the following shell script:

# download the latest version of the service
git clone https://github.com/mainflux/mainflux

cd mainflux

# compile the lora adapter
make lora

# copy binary to bin
make install

# set the environment variables and run the service
MF_LORA_ADAPTER_LOG_LEVEL=[Lora Adapter Log Level] MF_NATS_URL=[NATS instance URL] MF_LORA_ADAPTER_MESSAGES_URL=[LoRa Server mqtt broker URL] MF_LORA_ADAPTER_ROUTE_MAP_URL=[Lora adapter routemap URL] MF_LORA_ADAPTER_ROUTE_MAP_PASS=[Lora adapter routemap password] MF_LORA_ADAPTER_ROUTE_MAP_DB=[Lora adapter routemap instance] MF_THINGS_ES_URL=[Things service event source URL] MF_THINGS_ES_PASS=[Things service event source password] MF_THINGS_ES_DB=[Things service event source password] MF_OPCUA_ADAPTER_EVENT_CONSUMER=[LoRa adapter instance name] $GOBIN/mainflux-lora

Using docker-compose

This service can be deployed using docker containers. Docker compose file is available in <project_root>/docker/addons/lora-adapter/docker-compose.yml. In order to run Mainflux lora-adapter, execute the following command:

docker-compose -f docker/addons/lora-adapter/docker-compose.yml up -d

Usage

For more information about service capabilities and its usage, please check out the Mainflux documentation.