From b3cfd8869b6566fce0c1213ca172453d0576338d Mon Sep 17 00:00:00 2001 From: Gerardo Marx Date: Thu, 11 Aug 2022 18:31:25 -0500 Subject: [PATCH] mosquito.conf minimal conf and Readme until process on Node --- README.md | 24 +++++++ flows.json | 187 +++++++++++++++++++++++++++++++++++++------------ mosquitto.conf | 25 +------ 3 files changed, 167 insertions(+), 69 deletions(-) diff --git a/README.md b/README.md index 9e9c354..8d6be9c 100644 --- a/README.md +++ b/README.md @@ -79,8 +79,32 @@ then, to get access to *node-RED* go to your web browser at `rasp-hostname.local ## A flow process in Node-RED +A basic process is implemented on *Node-RED* to test the mqtt protocol. Thus, add the next blocks: + +1. `mqtt in` from network group +2. `debug` from common +3. `text`from dashboard + +then, double-click on `mqtt-in` to open and edit the node: +![]() + +click on *Add new mqtt-brocker*, then, in the *Connection* tab: set *Name* to Rasp, point the server to the raspberry's ip or hostname and port 1883. Leave unchanged the *Security* and *Message* tabs and click on the **Add** button. + + + +Finally, set the topic to `data/esp32` and the output to `a String` in the mqtt properties' node: + +Next, click on the `Deploy` button to check if the process can connect to the Broker: + + + + +how to connect??? + + In the *Node-RED* App press the `import`button at the right-lower menu and upload the `flows.json` file in this repository. + ![Importar](./Imagenes/Import_Node_Red.png) Damos clic en el nodo de mqtt in (el morado con el texto prueba/xd), se desplegara un menu con las propiedades del nodo. diff --git a/flows.json b/flows.json index 725a012..30879b8 100644 --- a/flows.json +++ b/flows.json @@ -7,6 +7,148 @@ "info": "", "env": [] }, + { + "id": "48158789f72695a5", + "type": "mqtt-broker", + "name": "prueba", + "broker": "192.168.1.22", + "port": "1883", + "clientid": "", + "autoConnect": true, + "usetls": false, + "protocolVersion": "4", + "keepalive": "60", + "cleansession": true, + "birthTopic": "", + "birthQos": "0", + "birthPayload": "", + "birthMsg": {}, + "closeTopic": "", + "closeQos": "0", + "closePayload": "", + "closeMsg": {}, + "willTopic": "", + "willQos": "0", + "willPayload": "", + "willMsg": {}, + "userProps": "", + "sessionExpiry": "" + }, + { + "id": "85bb54548a670130", + "type": "ui_group", + "name": "xd", + "tab": "0b8b1c1183d48cf4", + "order": 1, + "disp": true, + "width": "6", + "collapse": false, + "className": "" + }, + { + "id": "0b8b1c1183d48cf4", + "type": "ui_tab", + "name": "Home", + "icon": "dashboard", + "disabled": false, + "hidden": false + }, + { + "id": "5abb9b0298fbf5d2", + "type": "ui_base", + "theme": { + "name": "theme-light", + "lightTheme": { + "default": "#0094CE", + "baseColor": "#0094CE", + "baseFont": "-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif", + "edited": false + }, + "darkTheme": { + "default": "#097479", + "baseColor": "#097479", + "baseFont": "-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif", + "edited": false + }, + "customTheme": { + "name": "Untitled Theme 1", + "default": "#4B7930", + "baseColor": "#4B7930", + "baseFont": "-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif" + }, + "themeState": { + "base-color": { + "default": "#0094CE", + "value": "#0094CE", + "edited": false + }, + "page-titlebar-backgroundColor": { + "value": "#0094CE", + "edited": false + }, + "page-backgroundColor": { + "value": "#fafafa", + "edited": false + }, + "page-sidebar-backgroundColor": { + "value": "#ffffff", + "edited": false + }, + "group-textColor": { + "value": "#1bbfff", + "edited": false + }, + "group-borderColor": { + "value": "#ffffff", + "edited": false + }, + "group-backgroundColor": { + "value": "#ffffff", + "edited": false + }, + "widget-textColor": { + "value": "#111111", + "edited": false + }, + "widget-backgroundColor": { + "value": "#0094ce", + "edited": false + }, + "widget-borderColor": { + "value": "#ffffff", + "edited": false + }, + "base-font": { + "value": "-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif" + } + }, + "angularTheme": { + "primary": "indigo", + "accents": "blue", + "warn": "red", + "background": "grey", + "palette": "light" + } + }, + "site": { + "name": "Node-RED Dashboard", + "hideToolbar": "false", + "allowSwipe": "false", + "lockMenu": "false", + "allowTempTheme": "true", + "dateFormat": "DD/MM/YYYY", + "sizes": { + "sx": 48, + "sy": 48, + "gx": 6, + "gy": 6, + "cx": 6, + "cy": 6, + "px": 0, + "py": 0 + } + } + }, { "id": "f4e118c014f799ab", "type": "mqtt in", @@ -61,50 +203,5 @@ "x": 350, "y": 200, "wires": [] - }, - { - "id": "48158789f72695a5", - "type": "mqtt-broker", - "name": "prueba", - "broker": "192.168.1.17", - "port": "1883", - "clientid": "", - "autoConnect": true, - "usetls": false, - "protocolVersion": "4", - "keepalive": "60", - "cleansession": true, - "birthTopic": "", - "birthQos": "0", - "birthPayload": "", - "birthMsg": {}, - "closeTopic": "", - "closeQos": "0", - "closePayload": "", - "closeMsg": {}, - "willTopic": "", - "willQos": "0", - "willPayload": "", - "willMsg": {}, - "sessionExpiry": "" - }, - { - "id": "85bb54548a670130", - "type": "ui_group", - "name": "xd", - "tab": "0b8b1c1183d48cf4", - "order": 1, - "disp": true, - "width": "6", - "collapse": false, - "className": "" - }, - { - "id": "0b8b1c1183d48cf4", - "type": "ui_tab", - "name": "Home", - "icon": "dashboard", - "disabled": false, - "hidden": false } ] \ No newline at end of file diff --git a/mosquitto.conf b/mosquitto.conf index a6fb471..3fbb5c7 100755 --- a/mosquitto.conf +++ b/mosquitto.conf @@ -1,29 +1,6 @@ -listener 1883 - persistence true - +listener 1883 persistence_location /var/lib/mosquitto/ - -persistence_file mosquitto.db - -log_dest syslog - -log_dest stdout - -log_dest topic - -log_type error - -log_type warning - -log_type notice - -log_type information - connection_messages true - -log_timestamp true - allow_anonymous true - password_file /etc/mosquitto/passwd