Skip to content

Commit

Permalink
Same as previous one
Browse files Browse the repository at this point in the history
  • Loading branch information
golfvert committed Sep 5, 2022
1 parent 588e600 commit bd43bd4
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 33 deletions.
25 changes: 8 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,11 @@ The repo has been cloned from the official NodeRed repository.

## How to use it ?

Download 2 files:
- publisher.env
Download
- docker-compose.yaml

and to edit:
and edit:

### Step 1: Edit publisher.env
This file contains the required information to connect to the Global Broker.
```
MQTT_PUB_HOST=GlobalBroker_IPAddr
MQTT_PUB_PORT=GlobalBroker_Port
MQTT_PUB_USER=
MQTT_PUB_PASSWD=
```

### Step 2: Edit docker-compose.yaml
Copy & Paste the subscriber_mqtt_1 to get one container per WIS2Node or other Global Brokers to subscribe to. Do NOT subscribe to the local Global Broker.
- Change the name of the container (make sure it is unique!)
- Change all MQTT_SUB_* to connect to the remote broker and to the topic from that source. In the example below `wis2/a/origin/FRA/#` will subscribe to all topic from France according to WIS2 agreed topic hierarchy.
Expand All @@ -47,11 +36,13 @@ Copy & Paste the subscriber_mqtt_1 to get one container per WIS2Node or other Gl
- ./publisher.env
environment:
- TZ=Europe/Paris
- MQTT_SUB_HOST=Broker_IPAddr # WIS2Node broker
- MQTT_SUB_PORT=Broker_Port
- MQTT_SUB_USER=
- MQTT_SUB_PASSWD=
- MQTT_SUB_BROKER=Broker_URL # WIS2Node URL broker such as mqtts://broker.example.com:8883 or wss://broker.example.com:443
- MQTT_SUB_USERNAME=
- MQTT_SUB_PASSWORDD=
- MQTT_SUB_TOPIC=Topic_to_sub # e.g. wis2/a/origin/FRA/#
- MQTT_PUB_BROKER=GlobalBroker_URL # Global Broker URL such as mqtts://globalbroker.site.com:8883 or wss://globalbroker.site.com:443
- MQTT_PUB_USERNAME=
- MQTT_PUB_PASSWORD=
ports:
- "1880:1880"
networks:
Expand Down
18 changes: 8 additions & 10 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,16 @@ version: "3.7"
services:
subscriber_mqtt_1:
container_name: subscriber_mqtt_1
# image: golfvert/wis2globalbrokernodered
# image: docker.io/library/testing:WIS2-GlobalBrokerAntiLoop
image: nodered/testing:node-red-build
env_file:
- ./publisher.env
image: golfvert/wis2globalbrokernodered
environment:
- TZ=Europe/Paris
- MQTT_SUB_HOST=Broker_IPAddr # WIS2Node broker
- MQTT_SUB_PORT=Broker_Port
- MQTT_SUB_USER=
- MQTT_SUB_PASSWD=
- MQTT_SUB_TOPIC=Topic_to_sub # e.g. wis/a/origin/FRA/#
- MQTT_SUB_BROKER=Broker_URL # WIS2Node URL broker such as mqtts://broker.example.com:8883 or wss://broker.example.com:443
- MQTT_SUB_USERNAME=
- MQTT_SUB_PASSWORDD=
- MQTT_SUB_TOPIC=Topic_to_sub # e.g. wis2/a/origin/FRA/#
- MQTT_PUB_BROKER=GlobalBroker_URL # Global Broker URL such as mqtts://globalbroker.site.com:8883 or wss://globalbroker.site.com:443
- MQTT_PUB_USERNAME=
- MQTT_PUB_PASSWORD=
ports:
- "1880:1880"
networks:
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "node-red-docker",
"version": "2.2.2",
"version": "3.0.2",
"description": "Low-code programming for event-driven applications",
"homepage": "http://nodered.org",
"license": "Apache-2.0",
Expand Down Expand Up @@ -31,7 +31,7 @@
"dependencies": {
"node-red-contrib-redis": "1.3.9",
"node-red-contrib-prometheus-exporter": "1.0.5",
"node-red": "2.2.2"
"node-red": "3.0.2"
},
"engines": {
"node": ">=12"
Expand Down
4 changes: 0 additions & 4 deletions publisher.env

This file was deleted.

0 comments on commit bd43bd4

Please sign in to comment.