diff --git a/node-red/README.md b/node-red/README.md new file mode 100644 index 0000000..d6694d4 --- /dev/null +++ b/node-red/README.md @@ -0,0 +1,8 @@ +# NodeRed + +To launch the installation of node red, be sure to have `nodejs` installed, and launch the following commands: +```bash +sudo npm install -g --unsafe-perm node-red +node-red +``` +Once all setup you can import the `.json` ! diff --git a/node-red/mqtt_boilerplate.json b/node-red/mqtt_boilerplate.json new file mode 100644 index 0000000..ffa8563 --- /dev/null +++ b/node-red/mqtt_boilerplate.json @@ -0,0 +1,187 @@ +[ + { + "id": "198746f833af26ca", + "type": "tab", + "label": "Flow 1", + "disabled": false, + "info": "", + "env": [] + }, + { + "id": "4c9b06ffad932f89", + "type": "debug", + "z": "198746f833af26ca", + "name": "debug 1", + "active": true, + "tosidebar": false, + "console": true, + "tostatus": false, + "complete": "payload", + "targetType": "msg", + "statusVal": "", + "statusType": "auto", + "x": 1230, + "y": 220, + "wires": [] + }, + { + "id": "5833c1785f0d5c12", + "type": "inject", + "z": "198746f833af26ca", + "name": "Toto timestamp", + "props": [ + { + "p": "payload" + }, + { + "p": "topic", + "vt": "str" + } + ], + "repeat": "", + "crontab": "", + "once": false, + "onceDelay": 0.1, + "topic": "toto", + "payload": "Hello, world!", + "payloadType": "str", + "x": 860, + "y": 160, + "wires": [ + [ + "cfba9dafbd28ba79" + ] + ] + }, + { + "id": "cfba9dafbd28ba79", + "type": "mqtt out", + "z": "198746f833af26ca", + "name": "", + "topic": "toto", + "qos": "", + "retain": "", + "respTopic": "", + "contentType": "", + "userProps": "", + "correl": "", + "expiry": "", + "broker": "3c830ca801586f46", + "x": 1070, + "y": 160, + "wires": [] + }, + { + "id": "644016f53bdf47c7", + "type": "mqtt in", + "z": "198746f833af26ca", + "name": "", + "topic": "toto", + "qos": "2", + "datatype": "auto-detect", + "broker": "211ac90c1df2c2b0", + "nl": false, + "rap": true, + "rh": 0, + "inputs": 0, + "x": 890, + "y": 220, + "wires": [ + [ + "4c9b06ffad932f89" + ] + ] + }, + { + "id": "3c830ca801586f46", + "type": "mqtt-broker", + "name": "", + "broker": "https://srv-chirpstack.insa-toulouse.fr", + "port": "1883", + "tls": "baca35e28f5a3a27", + "clientid": "", + "autoConnect": true, + "usetls": true, + "protocolVersion": "4", + "keepalive": "60", + "cleansession": true, + "autoUnsubscribe": true, + "birthTopic": "", + "birthQos": "0", + "birthRetain": "false", + "birthPayload": "", + "birthMsg": {}, + "closeTopic": "", + "closeQos": "0", + "closeRetain": "false", + "closePayload": "", + "closeMsg": {}, + "willTopic": "", + "willQos": "0", + "willRetain": "false", + "willPayload": "", + "willMsg": {}, + "userProps": "", + "sessionExpiry": "" + }, + { + "id": "211ac90c1df2c2b0", + "type": "mqtt-broker", + "name": "", + "broker": "https://srv-chirpstack.insa-toulouse.fr", + "port": "1883", + "tls": "2909ad4e1ca13619", + "clientid": "", + "autoConnect": true, + "usetls": true, + "protocolVersion": "4", + "keepalive": "60", + "cleansession": true, + "autoUnsubscribe": true, + "birthTopic": "", + "birthQos": "0", + "birthRetain": "false", + "birthPayload": "", + "birthMsg": {}, + "closeTopic": "", + "closeQos": "0", + "closeRetain": "false", + "closePayload": "", + "closeMsg": {}, + "willTopic": "", + "willQos": "0", + "willRetain": "false", + "willPayload": "", + "willMsg": {}, + "userProps": "", + "sessionExpiry": "" + }, + { + "id": "baca35e28f5a3a27", + "type": "tls-config", + "name": "", + "cert": "", + "key": "", + "ca": "", + "certname": "", + "keyname": "", + "caname": "ca_certificate.txt", + "servername": "", + "verifyservercert": true, + "alpnprotocol": "" + }, + { + "id": "2909ad4e1ca13619", + "type": "tls-config", + "name": "", + "cert": "", + "key": "", + "ca": "", + "certname": "", + "keyname": "", + "caname": "ca_certificate.txt", + "servername": "", + "verifyservercert": true, + "alpnprotocol": "" + } +] \ No newline at end of file diff --git a/node-red/nodered_test_mqtt.png b/node-red/nodered_test_mqtt.png new file mode 100644 index 0000000..f8da0c4 Binary files /dev/null and b/node-red/nodered_test_mqtt.png differ