Skip to content

Commit

Permalink
Release 1.0.32
Browse files Browse the repository at this point in the history
  • Loading branch information
predix-adoption-bot committed Feb 3, 2019
1 parent 38dcefb commit b7e7151
Show file tree
Hide file tree
Showing 24 changed files with 213 additions and 25 deletions.
8 changes: 3 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ LABEL maintainer="Predix Builder Relations"
LABEL hub="https://hub.docker.com"
LABEL org="https://hub.docker.com/u/predixadoption"
LABEL repo="predix-edge-ref-app"
LABEL dockerImage="predixadoption/predix-edge-ref-app"
LABEL version="1.0.18"
LABEL version="1.0.32"
LABEL support="https://forum.predix.io"
LABEL license="https://github.com/PredixDev/predix-docker-samples/blob/master/LICENSE.md"

Expand All @@ -17,7 +16,8 @@ RUN npm config set strict-ssl false && \
WORKDIR /usr/src/edge-ref-app

#COPY config ./config
#COPY data ./data
RUN mkdir -p ./data
COPY data/compressor-specs.json ./data
COPY gulp_tasks ./gulp_tasks
COPY server ./server
COPY src ./src
Expand Down Expand Up @@ -48,8 +48,6 @@ RUN rm -rf ./server
RUN rm -rf ./src
RUN rm -rf ./images

#RUN rm -rf ./node_modules

COPY ./scripts/entry_point.sh .

EXPOSE 5000
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ chmod -R 777 data

Now start the edge-ref-app containers
```sh
docker stack deploy edge-ref-app -c docker-compose-local.yml
docker stack deploy --resolve-image never -c docker-compose-local.yml edge-ref-app
```

### Validate they started
Expand Down
6 changes: 6 additions & 0 deletions config/app-deadband/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
config-cloud-gateway.json
config-opcua.json
config-simulator.json
#if you need a specific settings.js remove this and change the script that creates the config.zip
settings.js
flows.json
8 changes: 8 additions & 0 deletions config/app-deadband/env
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#use bash format.
#ensure that 'source /config/env' is added to the container entry_point.sh file that needs it
#export MYENVVAR=VALUE

export HIGHHIGH="4"
export HIGH="3.5"
export LOW="2.5"
export LOWLOW="2"
1 change: 1 addition & 0 deletions config/app-deadband/flows-app-deadband.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[{"id":"b2e192e7.2ec24","type":"tab","label":"M+M+Demo+Flow","disabled":false,"info":""},{"id":"9e4f5511.a28c98","type":"subflow","name":"Subflow 2","info":"","in":[],"out":[]},{"id":"1b9b7e8f.439c61","type":"subflow","name":"Subflow 3","info":"1. Opens the OPC Adapter Config file\n2. Grabs the MQTT config info\n3. Sends it to the Debug Window\n","in":[],"out":[]},{"id":"490c44b7.a0bf0c","type":"mqtt-broker","z":"","name":"","broker":"mqtt-tcp://predix-edge-broker","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""},{"id":"5b0e890d.8c6228","type":"file in","z":"9e4f5511.a28c98","name":"ConfigIn","filename":"/config/config-cloud-gateway.json","format":"utf8","chunk":false,"sendError":false,"x":300,"y":60,"wires":[["718ccce4.faa1e4"]]},{"id":"58c0f78e.a320b8","type":"debug","z":"9e4f5511.a28c98","name":"debug","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":690,"y":60,"wires":[]},{"id":"718ccce4.faa1e4","type":"function","z":"9e4f5511.a28c98","name":"GetMQTTSection","func":"var config = JSON.parse(msg.payload);\nmsg.payload = config.blocks.time_series_sender.config.mqtt;\nreturn msg;\n","outputs":1,"noerr":0,"x":510,"y":60,"wires":[["58c0f78e.a320b8"]]},{"id":"dc44d76f.e9ce78","type":"inject","z":"9e4f5511.a28c98","name":"TriggerFlow","topic":"","payload":"","payloadType":"date","repeat":"15","crontab":"","once":true,"onceDelay":0.1,"x":130,"y":60,"wires":[["5b0e890d.8c6228"]]},{"id":"40b61585.53378c","type":"debug","z":"1b9b7e8f.439c61","name":"debug","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":710,"y":40,"wires":[]},{"id":"f9ec0b4e.f7b878","type":"function","z":"1b9b7e8f.439c61","name":"GetMQTTSection","func":"var config = JSON.parse(msg.payload);\nmsg.payload = config.blocks.mqtt.config;\nreturn msg;\n","outputs":1,"noerr":0,"x":490,"y":40,"wires":[["40b61585.53378c"]]},{"id":"89c44c60.b489c","type":"file in","z":"1b9b7e8f.439c61","name":"ConfigIn","filename":"/config/config-opcua.json","format":"utf8","chunk":false,"sendError":false,"x":300,"y":40,"wires":[["f9ec0b4e.f7b878"]]},{"id":"3010433f.7353fc","type":"inject","z":"1b9b7e8f.439c61","name":"TriggerFlow","topic":"","payload":"","payloadType":"date","repeat":"15","crontab":"","once":true,"onceDelay":0.1,"x":130,"y":40,"wires":[["89c44c60.b489c"]]},{"id":"c29d3e42.6f54d","type":"mqtt in","z":"b2e192e7.2ec24","name":"From OPCUA Adapter","topic":"app_data","qos":"2","broker":"490c44b7.a0bf0c","x":140,"y":180,"wires":[["321280bb.a13ec"]]},{"id":"a72237c7.469d38","type":"mqtt out","z":"b2e192e7.2ec24","name":"To Cloud Gateway","topic":"timeseries_data","qos":"","retain":"","broker":"490c44b7.a0bf0c","x":650,"y":180,"wires":[]},{"id":"1a04e44.042991c","type":"subflow:9e4f5511.a28c98","z":"b2e192e7.2ec24","name":"CloudGatewayConfig","x":120,"y":100,"wires":[]},{"id":"14aca965.485a97","type":"debug","z":"b2e192e7.2ec24","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":210,"y":280,"wires":[]},{"id":"7bd7b6de.3adf38","type":"subflow:1b9b7e8f.439c61","z":"b2e192e7.2ec24","name":"OPCUAAdapterConfig","x":120,"y":60,"wires":[]},{"id":"321280bb.a13ec","type":"function","z":"b2e192e7.2ec24","name":"Deadband Filter","func":"//read the message into a json object\n var item = JSON.parse(msg.payload);\n var HIGHHIGH = context.global.process.env.HIGHHIGH;\n var HIGH = context.global.process.env.HIGH;\n var LOW = context.global.process.env.LOW;\n var LOWLOW = context.global.process.env.LOWLOW;\n //scale up the value by 1000 and put it back on the broker topic to be sent to Predix Time Series\n for ( var i=0;i<item.body.length;i++)\n {\n var tagName = item.body[i].name;\n var value = item.body[i].datapoints[0][1];\n\n var scaled_item = JSON.stringify(item);\n msg.payload = scaled_item\n\n \n if ( value < HIGHHIGH && value > LOWLOW ) {\n return msg\n }\n else {\n return null; \n }\n\n //publish the tag back to the broker on the topic the cloud-gateway\n //container is subscribing to\n\n return msg;\n }\n","outputs":1,"noerr":0,"x":400,"y":180,"wires":[["a72237c7.469d38"]]}]
6 changes: 6 additions & 0 deletions config/app-deadband/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": "node-red-project",
"description": "A Node-RED Project",
"version": "0.0.1",
"private": true
}
Binary file not shown.
3 changes: 3 additions & 0 deletions config/env
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#use bash format.
#ensure that 'source /config/env' is added to the container entry_point.sh file that needs it
#export MYENVVAR=VALUE
1 change: 1 addition & 0 deletions config/flows-app-deadband.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[{"id":"b2e192e7.2ec24","type":"tab","label":"M+M+Demo+Flow","disabled":false,"info":""},{"id":"9e4f5511.a28c98","type":"subflow","name":"Subflow 2","info":"","in":[],"out":[]},{"id":"1b9b7e8f.439c61","type":"subflow","name":"Subflow 3","info":"1. Opens the OPC Adapter Config file\n2. Grabs the MQTT config info\n3. Sends it to the Debug Window\n","in":[],"out":[]},{"id":"490c44b7.a0bf0c","type":"mqtt-broker","z":"","name":"","broker":"mqtt-tcp://predix-edge-broker","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""},{"id":"5b0e890d.8c6228","type":"file in","z":"9e4f5511.a28c98","name":"ConfigIn","filename":"/config/config-cloud-gateway.json","format":"utf8","chunk":false,"sendError":false,"x":300,"y":60,"wires":[["718ccce4.faa1e4"]]},{"id":"58c0f78e.a320b8","type":"debug","z":"9e4f5511.a28c98","name":"debug","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":690,"y":60,"wires":[]},{"id":"718ccce4.faa1e4","type":"function","z":"9e4f5511.a28c98","name":"GetMQTTSection","func":"var config = JSON.parse(msg.payload);\nmsg.payload = config.blocks.time_series_sender.config.mqtt;\nreturn msg;\n","outputs":1,"noerr":0,"x":510,"y":60,"wires":[["58c0f78e.a320b8"]]},{"id":"dc44d76f.e9ce78","type":"inject","z":"9e4f5511.a28c98","name":"TriggerFlow","topic":"","payload":"","payloadType":"date","repeat":"15","crontab":"","once":true,"onceDelay":0.1,"x":130,"y":60,"wires":[["5b0e890d.8c6228"]]},{"id":"40b61585.53378c","type":"debug","z":"1b9b7e8f.439c61","name":"debug","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":710,"y":40,"wires":[]},{"id":"f9ec0b4e.f7b878","type":"function","z":"1b9b7e8f.439c61","name":"GetMQTTSection","func":"var config = JSON.parse(msg.payload);\nmsg.payload = config.blocks.mqtt.config;\nreturn msg;\n","outputs":1,"noerr":0,"x":490,"y":40,"wires":[["40b61585.53378c"]]},{"id":"89c44c60.b489c","type":"file in","z":"1b9b7e8f.439c61","name":"ConfigIn","filename":"/config/config-opcua.json","format":"utf8","chunk":false,"sendError":false,"x":300,"y":40,"wires":[["f9ec0b4e.f7b878"]]},{"id":"3010433f.7353fc","type":"inject","z":"1b9b7e8f.439c61","name":"TriggerFlow","topic":"","payload":"","payloadType":"date","repeat":"15","crontab":"","once":true,"onceDelay":0.1,"x":130,"y":40,"wires":[["89c44c60.b489c"]]},{"id":"c29d3e42.6f54d","type":"mqtt in","z":"b2e192e7.2ec24","name":"From OPCUA Adapter","topic":"app_data","qos":"2","broker":"490c44b7.a0bf0c","x":140,"y":180,"wires":[["321280bb.a13ec"]]},{"id":"a72237c7.469d38","type":"mqtt out","z":"b2e192e7.2ec24","name":"To Cloud Gateway","topic":"timeseries_data","qos":"","retain":"","broker":"490c44b7.a0bf0c","x":650,"y":180,"wires":[]},{"id":"1a04e44.042991c","type":"subflow:9e4f5511.a28c98","z":"b2e192e7.2ec24","name":"CloudGatewayConfig","x":120,"y":100,"wires":[]},{"id":"14aca965.485a97","type":"debug","z":"b2e192e7.2ec24","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":210,"y":280,"wires":[]},{"id":"7bd7b6de.3adf38","type":"subflow:1b9b7e8f.439c61","z":"b2e192e7.2ec24","name":"OPCUAAdapterConfig","x":120,"y":60,"wires":[]},{"id":"321280bb.a13ec","type":"function","z":"b2e192e7.2ec24","name":"Deadband Filter","func":"//read the message into a json object\n var item = JSON.parse(msg.payload);\n var HIGHHIGH = context.global.process.env.HIGHHIGH;\n var HIGH = context.global.process.env.HIGH;\n var LOW = context.global.process.env.LOW;\n var LOWLOW = context.global.process.env.LOWLOW;\n //scale up the value by 1000 and put it back on the broker topic to be sent to Predix Time Series\n for ( var i=0;i<item.body.length;i++)\n {\n var tagName = item.body[i].name;\n var value = item.body[i].datapoints[0][1];\n\n var scaled_item = JSON.stringify(item);\n msg.payload = scaled_item\n\n \n if ( value < HIGHHIGH && value > LOWLOW ) {\n return msg\n }\n else {\n return null; \n }\n\n //publish the tag back to the broker on the topic the cloud-gateway\n //container is subscribing to\n\n return msg;\n }\n","outputs":1,"noerr":0,"x":400,"y":180,"wires":[["a72237c7.469d38"]]}]
4 changes: 2 additions & 2 deletions data/settings.js → config/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ module.exports = {
// following property can be used to identify a directory of static content
// that should be served at http://localhost:1880/.
//httpStatic: '/home/nol/node-red-static/',
httpStatic: '/data',

// The maximum size of HTTP request that will be accepted by the runtime api.
// Default: 5mb
Expand Down Expand Up @@ -205,7 +204,8 @@ module.exports = {
// context.global.os

functionGlobalContext: {
// os:require('os'),
os:require('os'),
process:process
// jfive:require("johnny-five"),
// j5board:require("johnny-five").Board({repl:false})
},
Expand Down
1 change: 0 additions & 1 deletion data/flows-deadband.json

This file was deleted.

Loading

0 comments on commit b7e7151

Please sign in to comment.