Tutorial de Arduino: Dashboard de Node-RED y servidor web de Arduino

Cómo mostrar los datos de tu servidor web Arduino en un Dashboard de Node-RED con automatización industrial
3 de enero de 2022 por
Tutorial de Arduino: Dashboard de Node-RED y servidor web de Arduino
Boot & Work Corp. S.L., Fernandez Queralt Martinez

Introducción

In the previous post >vimos cómo crear un Servidor Web Arduino para leer los datos de los pines de entrada analógica al navegador con la automatización de Arduino.

En esta entrada del blog, vamos a mostrar esos datos en un Dashboard de Node-RED para hacerlo más legible y atractivo para el usuario con un PLC industrial Arduino.

Requisitos

Node-RED

Node-RED es una herramienta de programación para conectar dispositivos de hardware, APIs y servicios online de formas nuevas e interesantes.

Proporciona un editor basado en el navegador que facilita el cableado de flujos utilizando la amplia gama de nodos de la paleta que se puede desplegar a su tiempo de ejecución en un solo clic. 
 

Ahora, vamos a hacer lo siguiente para ejecutar Node-RED en nuestro portátil y poder leer los datos de nuestro controlador lógico programable Arduino con Ethernet:

1. Instalar git.

2. Instalar Node.js, npm y Node-RED.

3. Configurar Node-RED para que se inicie automáticamente en el arranque.

Instalar Git

Puede que necesites ejecutar el siguiente comando para asegurarte de que npm es capaz de obtener y construir cualquier módulo binario que necesite instalar:

sudo apt install build-essential git curl

Instalar Node.js, npm y Node-RED

Instala Node.js, npm y Node-RED utilizando este script que también se utiliza para actualizar una instalación existente cuando hay una nueva versión disponible.

bash <(curl -sL https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered)

Autostart en el arranque

Ejecuta el siguiente comando si quieres que Node-RED se ejecute cuando el PLC de código abierto se encienda, o se reinicie.

sudo systemctl enable nodered.service
sudo systemctl start nodered.service

Conoce más en el: sitio web de Node-RED >

Nodos del Dashboard de Node-RED

Asegúrate de que puedes acceder a Node-RED localmente. Abre el navegador y escribe:

http://localhost:1880/

Si es así, tienes que descargar los nodos de Node-RED Dashboard para poder hacer un Node-RED Dashboard fácilmente.

Por lo tanto, puedes descargarlos de dos maneras:

1. EO bien yendo al menú de Node-RED > Haciendo clic en Gestionar Paleta > Instalar > Tipo: node-red-dashboard > Instalar.

2. O yendo al directorio /home/$USER/.node-red:

cd /home/$USER/.node-red

e instalando el conjunto de nodos del dashboard para Node-RED.

npm install node-red-dashboard


Estos son los nodos que deberías ver  

Nodes - Node-RED Dashboard Nodes - Tutorial: Node-RED Dashboard and Arduino Web Server

Obtener datos de entrada del servidor

En la anterior entrada del blog, aprendimos cómo hacer un servidor web Arduino y comprobar los datos al navegador con números crudos. 
 

Pero, ¿qué pasaría si los valores de entrada se mostraran mejor en un tablero GUI Node-RED?

Para conseguirlo, vamos a enviar una petición GET al servidor para obtener los datos del PLC Arduino.

Luego, dividiremos la información de cada entrada, y la dividiremos para ver los valores de las entradas.

Obtener datos de entrada desde el servidor - Tutorial: Node-RED Dashboard y Arduino Web Server

Flows.json

1. Añade un nodo inject, y realiza la petición cada 1 segundo.

2. Conéctalo a un nodo de petición HTTP:

Method: GET
URL: http://10.10.10.30 (<- IP from Arduino based PLC or server)
Payload: Ignore
Return: a UTF-8 string

3. Añade un nodo split con los parámetros por defecto.

4. Añade un nodo de conmutación:

Property: msg.parts.index
== 0
== 1
== 2
== 3
== 4
== 5

5. Añade seis nodos de cambio, conéctalos a las salidas del nodo interruptor y haz lo mismo en todos ellos:

set msg.payload to (expression) $number($trim(payload))


6. Conecta seis nodos de calibre, uno para cada salida, y configúralos:
Group: Configure a group and tab.
Size: Set a size, like 4x3
Type: Gauge
Label: from I0.7 to input I0.12 in our case
Value format: {{value}}
Range: min 0 max 1024 
Y cambia los colores si quieres


Ve al menú Dashboard de la derecha > pasa el ratón por tu pestaña y grupo > Haz clic en layout > Y despliega los widgets como quieras.

Por último, ve al Tablero de Control, y ve tus datos gráficamente:

http://localhost:1880/ui


[{"id":"ed63f7fadb48e2f7","type":"tab","label":"Industrial Shields","disabled":false,"info":""},{"id":"c9d8f02d.c9424","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":true,"reset":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":60,"sy":60,"gx":6,"gy":6,"cx":6,"cy":6,"px":0,"py":0}}},{"id":"94e80e20.ee556","type":"ui_group","name":"Analog Inputs","tab":"","order":1,"disp":true,"width":"14","collapse":false,"className":""},{"id":"7db45a2e2009a112","type":"ui_group","name":"","tab":"61205cbe86e76b7a","order":1,"disp":true,"width":"14","collapse":false,"className":""},{"id":"a8a589c2bd8096fe","type":"ui_group","name":"","tab":"","order":1,"disp":true,"width":"14","collapse":false},{"id":"650178a94412516d","type":"ui_spacer","name":"spacer","group":"a8a589c2bd8096fe","order":2,"width":1,"height":1},{"id":"41520cc5c5debd27","type":"ui_spacer","name":"spacer","group":"a8a589c2bd8096fe","order":3,"width":1,"height":1},{"id":"d7384f9539eeb32f","type":"ui_spacer","name":"spacer","group":"a8a589c2bd8096fe","order":4,"width":1,"height":1},{"id":"ec214d0fcde739b3","type":"ui_spacer","name":"spacer","group":"a8a589c2bd8096fe","order":5,"width":1,"height":1},{"id":"8fda7675a3803028","type":"ui_spacer","name":"spacer","group":"a8a589c2bd8096fe","order":6,"width":1,"height":1},{"id":"ec92b79e411cce41","type":"ui_spacer","name":"spacer","group":"a8a589c2bd8096fe","order":7,"width":1,"height":1},{"id":"c1fdf85f7492cf0e","type":"ui_spacer","name":"spacer","group":"a8a589c2bd8096fe","order":8,"width":1,"height":1},{"id":"1f6695fb88e9a91b","type":"ui_spacer","name":"spacer","group":"a8a589c2bd8096fe","order":9,"width":1,"height":1},{"id":"fd86c3aceccb7a6f","type":"ui_group","name":"","tab":"","order":1,"disp":true,"width":14,"collapse":false},{"id":"e0bf4de3ab727c40","type":"ui_group","name":"","tab":"","order":1,"disp":true,"width":"14","collapse":false},{"id":"ce5f724377fd4a08","type":"ui_spacer","name":"spacer","group":"e0bf4de3ab727c40","order":8,"width":1,"height":1},{"id":"1621c08cda4a0daf","type":"ui_spacer","name":"spacer","group":"e0bf4de3ab727c40","order":12,"width":9,"height":1},{"id":"19420fd10c7c0b12","type":"ui_spacer","name":"spacer","group":"e0bf4de3ab727c40","order":19,"width":1,"height":1},{"id":"9a921db25413d077","type":"ui_spacer","name":"spacer","group":"fd86c3aceccb7a6f","order":5,"width":5,"height":1},{"id":"53a3c745b8cf7b46","type":"ui_spacer","name":"spacer","group":"fd86c3aceccb7a6f","order":9,"width":9,"height":1},{"id":"177c9bb488d91cd0","type":"ui_spacer","name":"spacer","group":"fd86c3aceccb7a6f","order":10,"width":9,"height":1},{"id":"4dcc45e902f01973","type":"ui_spacer","name":"spacer","group":"fd86c3aceccb7a6f","order":11,"width":9,"height":1},{"id":"d3c8b1a85b1a2695","type":"ui_spacer","name":"spacer","group":"fd86c3aceccb7a6f","order":16,"width":5,"height":1},{"id":"48e48dc621386c3a","type":"ui_spacer","name":"spacer","group":"fd86c3aceccb7a6f","order":18,"width":2,"height":1},{"id":"6c2eaf3a7ff65cc7","type":"ui_spacer","name":"spacer","group":"fd86c3aceccb7a6f","order":20,"width":1,"height":1},{"id":"69fef2625bcae797","type":"ui_group","name":"","tab":"","order":1,"disp":true,"width":14,"collapse":false},{"id":"f0995cba9faef49a","type":"ui_spacer","name":"spacer","group":"69fef2625bcae797","order":1,"width":6,"height":1},{"id":"8386499ed3985872","type":"ui_spacer","name":"spacer","group":"69fef2625bcae797","order":3,"width":6,"height":1},{"id":"88bfa93404bbb9e8","type":"ui_spacer","name":"spacer","group":"69fef2625bcae797","order":4,"width":2,"height":1},{"id":"8f993c0b0d1ca2c6","type":"ui_spacer","name":"spacer","group":"69fef2625bcae797","order":6,"width":2,"height":1},{"id":"31ac08fa29411053","type":"ui_spacer","name":"spacer","group":"69fef2625bcae797","order":7,"width":2,"height":1},{"id":"a085d999fd2f1543","type":"ui_spacer","name":"spacer","group":"69fef2625bcae797","order":8,"width":2,"height":1},{"id":"93875745799a1a7e","type":"ui_spacer","name":"spacer","group":"69fef2625bcae797","order":9,"width":2,"height":1},{"id":"09b81d9cd3b8a5e3","type":"ui_spacer","name":"spacer","group":"69fef2625bcae797","order":11,"width":2,"height":1},{"id":"fae59351e2c107e1","type":"ui_spacer","name":"spacer","group":"69fef2625bcae797","order":13,"width":2,"height":1},{"id":"16da015529de983e","type":"ui_spacer","name":"spacer","group":"69fef2625bcae797","order":15,"width":2,"height":1},{"id":"68d11f4888371f42","type":"ui_spacer","name":"spacer","group":"78426f95.8f95a","order":2,"width":1,"height":1},{"id":"c952f3843803ca3a","type":"ui_spacer","name":"spacer","group":"78426f95.8f95a","order":4,"width":2,"height":1},{"id":"d94fc37ef13fd5b5","type":"ui_spacer","name":"spacer","group":"78426f95.8f95a","order":6,"width":2,"height":1},{"id":"de6860d7e763ee1f","type":"ui_spacer","name":"spacer","group":"78426f95.8f95a","order":7,"width":2,"height":1},{"id":"b7dea1e1539fd361","type":"ui_spacer","name":"spacer","group":"78426f95.8f95a","order":8,"width":2,"height":1},{"id":"8a992f492da0c389","type":"ui_spacer","name":"spacer","group":"78426f95.8f95a","order":9,"width":2,"height":1},{"id":"59f579f16c8a79f0","type":"ui_spacer","name":"spacer","group":"78426f95.8f95a","order":10,"width":3,"height":1},{"id":"3c6760b2deeb8edc","type":"ui_spacer","name":"spacer","group":"78426f95.8f95a","order":12,"width":3,"height":1},{"id":"4304b47b5a38c1d3","type":"ui_spacer","name":"spacer","group":"78426f95.8f95a","order":13,"width":3,"height":1},{"id":"e7c76c6618406bfb","type":"ui_spacer","name":"spacer","group":"78426f95.8f95a","order":14,"width":3,"height":1},{"id":"1c73f99f95804e0c","type":"ui_spacer","name":"spacer","group":"78426f95.8f95a","order":15,"width":3,"height":1},{"id":"66cf106ea464b138","type":"ui_spacer","name":"spacer","group":"78426f95.8f95a","order":17,"width":3,"height":1},{"id":"f59e5331527d622c","type":"ui_spacer","name":"spacer","group":"78426f95.8f95a","order":18,"width":3,"height":1},{"id":"bd4188df3fba1217","type":"ui_spacer","name":"spacer","group":"78426f95.8f95a","order":19,"width":3,"height":1},{"id":"11149ae50462e712","type":"ui_group","name":"","tab":"","order":1,"disp":true,"width":"14","collapse":false},{"id":"d9eb35dfa1f56a6b","type":"ui_group","name":"","tab":"","order":1,"disp":true,"width":"14","collapse":false},{"id":"e68a8468aae12d7c","type":"ui_spacer","name":"spacer","group":"d9eb35dfa1f56a6b","order":2,"width":1,"height":1},{"id":"86350b8b09d87fc9","type":"ui_spacer","name":"spacer","group":"d9eb35dfa1f56a6b","order":3,"width":1,"height":1},{"id":"e695b989c88ca386","type":"ui_spacer","name":"spacer","group":"d9eb35dfa1f56a6b","order":4,"width":1,"height":1},{"id":"97b648f2295e61bf","type":"ui_spacer","name":"spacer","group":"d9eb35dfa1f56a6b","order":5,"width":1,"height":1},{"id":"48dff9f6e1890e7f","type":"ui_spacer","name":"spacer","group":"d9eb35dfa1f56a6b","order":6,"width":1,"height":1},{"id":"7db9106c3436c688","type":"ui_spacer","name":"spacer","group":"d9eb35dfa1f56a6b","order":7,"width":1,"height":1},{"id":"e2843b82cd077bd1","type":"ui_spacer","name":"spacer","group":"d9eb35dfa1f56a6b","order":8,"width":1,"height":1},{"id":"d00a0ea86f5dceb1","type":"ui_spacer","name":"spacer","group":"d9eb35dfa1f56a6b","order":9,"width":1,"height":1},{"id":"2c09e91cbc8e6e0f","type":"ui_group","name":"","tab":"","order":1,"disp":true,"width":14,"collapse":false},{"id":"c8cc23f922acf265","type":"ui_spacer","name":"spacer","group":"11149ae50462e712","order":7,"width":2,"height":1},{"id":"a60cdc5ae81ae940","type":"ui_spacer","name":"spacer","group":"11149ae50462e712","order":10,"width":1,"height":1},{"id":"1b7909ebb1ddaa8d","type":"ui_spacer","name":"spacer","group":"11149ae50462e712","order":12,"width":10,"height":1},{"id":"8f421b5598559b4b","type":"ui_spacer","name":"spacer","group":"11149ae50462e712","order":17,"width":1,"height":1},{"id":"ffbac30177906f95","type":"ui_spacer","name":"spacer","group":"11149ae50462e712","order":20,"width":1,"height":1},{"id":"905445bab20ca6db","type":"ui_group","name":"","tab":"","order":1,"disp":true,"width":"14","collapse":false},{"id":"d10c444b39eb2f1f","type":"ui_spacer","name":"spacer","group":"905445bab20ca6db","order":8,"width":1,"height":1},{"id":"c323326f7958830e","type":"ui_spacer","name":"spacer","group":"905445bab20ca6db","order":12,"width":9,"height":1},{"id":"4db3c8fac1af8b3e","type":"ui_spacer","name":"spacer","group":"905445bab20ca6db","order":19,"width":1,"height":1},{"id":"bf1952147b6b4ea5","type":"ui_spacer","name":"spacer","group":"2c09e91cbc8e6e0f","order":5,"width":5,"height":1},{"id":"0b2d7897709f6e5f","type":"ui_spacer","name":"spacer","group":"2c09e91cbc8e6e0f","order":9,"width":9,"height":1},{"id":"e22f5e922f6c9f71","type":"ui_spacer","name":"spacer","group":"2c09e91cbc8e6e0f","order":10,"width":9,"height":1},{"id":"588a23943d3785a2","type":"ui_spacer","name":"spacer","group":"2c09e91cbc8e6e0f","order":11,"width":9,"height":1},{"id":"321320e5a14098d7","type":"ui_spacer","name":"spacer","group":"2c09e91cbc8e6e0f","order":16,"width":5,"height":1},{"id":"a879bd0827b8f99e","type":"ui_spacer","name":"spacer","group":"2c09e91cbc8e6e0f","order":18,"width":2,"height":1},{"id":"33a76b8f9cf543bf","type":"ui_spacer","name":"spacer","group":"2c09e91cbc8e6e0f","order":20,"width":1,"height":1},{"id":"56f34e37a79c3d01","type":"ui_group","name":"","tab":"","order":1,"disp":true,"width":14,"collapse":false},{"id":"c73d7f014bfbe104","type":"ui_spacer","name":"spacer","group":"56f34e37a79c3d01","order":1,"width":6,"height":1},{"id":"b08448fdb52e2ca0","type":"ui_spacer","name":"spacer","group":"56f34e37a79c3d01","order":3,"width":6,"height":1},{"id":"29c5f2c2fcf37c02","type":"ui_spacer","name":"spacer","group":"56f34e37a79c3d01","order":4,"width":2,"height":1},{"id":"ceb8599438dad1cb","type":"ui_spacer","name":"spacer","group":"56f34e37a79c3d01","order":6,"width":2,"height":1},{"id":"3632ea435e54f9e5","type":"ui_spacer","name":"spacer","group":"56f34e37a79c3d01","order":7,"width":2,"height":1},{"id":"8150aa1bd8c37da2","type":"ui_spacer","name":"spacer","group":"56f34e37a79c3d01","order":8,"width":2,"height":1},{"id":"5c24e785e608aef0","type":"ui_spacer","name":"spacer","group":"56f34e37a79c3d01","order":9,"width":2,"height":1},{"id":"c41052ac2d6a9c02","type":"ui_spacer","name":"spacer","group":"56f34e37a79c3d01","order":11,"width":2,"height":1},{"id":"c0053c1b8fa16dcf","type":"ui_spacer","name":"spacer","group":"56f34e37a79c3d01","order":13,"width":2,"height":1},{"id":"4f967c426be1f3f4","type":"ui_spacer","name":"spacer","group":"56f34e37a79c3d01","order":15,"width":2,"height":1},{"id":"8e220e53f80e628c","type":"ui_spacer","name":"spacer","group":"78426f95.8f95a","order":2,"width":1,"height":1},{"id":"aad739631a5e8311","type":"ui_spacer","name":"spacer","group":"78426f95.8f95a","order":4,"width":2,"height":1},{"id":"b10241278cdf1b51","type":"ui_spacer","name":"spacer","group":"78426f95.8f95a","order":6,"width":2,"height":1},{"id":"e3068a6262e6d1ae","type":"ui_spacer","name":"spacer","group":"78426f95.8f95a","order":7,"width":2,"height":1},{"id":"4083fd49a7615e0c","type":"ui_spacer","name":"spacer","group":"78426f95.8f95a","order":8,"width":2,"height":1},{"id":"177012bcd681394b","type":"ui_spacer","name":"spacer","group":"78426f95.8f95a","order":9,"width":2,"height":1},{"id":"9817a7eb2bf22936","type":"ui_spacer","name":"spacer","group":"78426f95.8f95a","order":10,"width":3,"height":1},{"id":"9d51b7e1584b160b","type":"ui_spacer","name":"spacer","group":"78426f95.8f95a","order":12,"width":3,"height":1},{"id":"dd4489451a804064","type":"ui_spacer","name":"spacer","group":"78426f95.8f95a","order":13,"width":3,"height":1},{"id":"85100227f6f53f95","type":"ui_spacer","name":"spacer","group":"78426f95.8f95a","order":14,"width":3,"height":1},{"id":"2bea5b80189667a7","type":"ui_spacer","name":"spacer","group":"78426f95.8f95a","order":15,"width":3,"height":1},{"id":"9ad14fb540fa76b1","type":"ui_spacer","name":"spacer","group":"78426f95.8f95a","order":17,"width":3,"height":1},{"id":"935c7b5a3a899429","type":"ui_spacer","name":"spacer","group":"78426f95.8f95a","order":18,"width":3,"height":1},{"id":"c6aa85ea767fdbe5","type":"ui_spacer","name":"spacer","group":"78426f95.8f95a","order":19,"width":3,"height":1},{"id":"61205cbe86e76b7a","type":"ui_tab","name":"Industrial Shields","icon":"dashboard","disabled":false,"hidden":false},{"id":"ba772d42e664cd90","type":"ui_spacer","z":"ed63f7fadb48e2f7","name":"spacer","group":"7db45a2e2009a112","order":1,"width":1,"height":1},{"id":"c0735f1ee76f3748","type":"ui_spacer","z":"ed63f7fadb48e2f7","name":"spacer","group":"7db45a2e2009a112","order":5,"width":1,"height":1},{"id":"aee142501bcd83e3","type":"ui_spacer","z":"ed63f7fadb48e2f7","name":"spacer","group":"7db45a2e2009a112","order":6,"width":1,"height":1},{"id":"bb5ac2563e92535c","type":"ui_spacer","z":"ed63f7fadb48e2f7","name":"spacer","group":"7db45a2e2009a112","order":7,"width":1,"height":1},{"id":"9a8898e980f59840","type":"ui_spacer","z":"ed63f7fadb48e2f7","name":"spacer","group":"7db45a2e2009a112","order":8,"width":1,"height":1},{"id":"0f787dad2bf96808","type":"ui_spacer","z":"ed63f7fadb48e2f7","name":"spacer","group":"7db45a2e2009a112","order":9,"width":1,"height":1},{"id":"23f5663a77200ae4","type":"ui_spacer","z":"ed63f7fadb48e2f7","name":"spacer","group":"7db45a2e2009a112","order":10,"width":1,"height":1},{"id":"9ca625a1245efd1a","type":"ui_spacer","z":"ed63f7fadb48e2f7","name":"spacer","group":"7db45a2e2009a112","order":14,"width":1,"height":1},{"id":"541a2bc4a02a9cef","type":"ui_spacer","z":"ed63f7fadb48e2f7","name":"spacer","group":"7db45a2e2009a112","order":15,"width":1,"height":1},{"id":"13902e93ea7bc112","type":"ui_spacer","z":"ed63f7fadb48e2f7","name":"spacer","group":"7db45a2e2009a112","order":16,"width":1,"height":1},{"id":"ea7ce3b4be6ff258","type":"ui_spacer","z":"ed63f7fadb48e2f7","name":"spacer","group":"7db45a2e2009a112","order":17,"width":1,"height":1},{"id":"01656dbe4d841765","type":"ui_spacer","z":"ed63f7fadb48e2f7","name":"spacer","group":"7db45a2e2009a112","order":18,"width":1,"height":1},{"id":"7fe60e9738612ca8","type":"http request","z":"ed63f7fadb48e2f7","name":"","method":"GET","ret":"txt","paytoqs":"ignore","url":"http://10.10.10.30","tls":"","persist":false,"proxy":"","authType":"","x":450,"y":180,"wires":[["a6e424fbcc272a74"]]},{"id":"3fbc45d21eb1acf9","type":"inject","z":"ed63f7fadb48e2f7","name":"Make request every 1 second","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"1","crontab":"","once":true,"onceDelay":0.1,"topic":"","payloadType":"date","x":230,"y":180,"wires":[["7fe60e9738612ca8"]]},{"id":"a6e424fbcc272a74","type":"split","z":"ed63f7fadb48e2f7","name":"","splt":"\\n","spltType":"str","arraySplt":"1","arraySpltType":"len","stream":false,"addname":"","x":590,"y":180,"wires":[["5e115c65fefe747b"]]},{"id":"5e115c65fefe747b","type":"switch","z":"ed63f7fadb48e2f7","name":"switch parts","property":"parts.index","propertyType":"msg","rules":[{"t":"eq","v":"0","vt":"num"},{"t":"eq","v":"1","vt":"num"},{"t":"eq","v":"2","vt":"num"},{"t":"eq","v":"3","vt":"num"},{"t":"eq","v":"4","vt":"num"},{"t":"eq","v":"5","vt":"str"}],"checkall":"true","repair":false,"outputs":6,"x":730,"y":180,"wires":[["614d419359294ac9"],["4999f00b14dcec08"],["74b4c6705b660f4c"],["21f305ac14e8f2b1"],["473885451ef29861"],["7afdf96b3e18654e"]]},{"id":"614d419359294ac9","type":"change","z":"ed63f7fadb48e2f7","name":"from string to number","rules":[{"t":"set","p":"payload","pt":"msg","to":"$number($trim(payload))","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":980,"y":80,"wires":[["02e7cc7d9727f150"]]},{"id":"4999f00b14dcec08","type":"change","z":"ed63f7fadb48e2f7","name":"from string to number","rules":[{"t":"set","p":"payload","pt":"msg","to":"$number($trim(payload))","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":980,"y":120,"wires":[["3dd038cd1d681cb6"]]},{"id":"74b4c6705b660f4c","type":"change","z":"ed63f7fadb48e2f7","name":"from string to number","rules":[{"t":"set","p":"payload","pt":"msg","to":"$number($trim(payload))","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":980,"y":160,"wires":[["871f31d13f55a322"]]},{"id":"21f305ac14e8f2b1","type":"change","z":"ed63f7fadb48e2f7","name":"from string to number","rules":[{"t":"set","p":"payload","pt":"msg","to":"$number($trim(payload))","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":980,"y":200,"wires":[["9053e7b943fbcf37"]]},{"id":"473885451ef29861","type":"change","z":"ed63f7fadb48e2f7","name":"from string to number","rules":[{"t":"set","p":"payload","pt":"msg","to":"$number($trim(payload))","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":980,"y":240,"wires":[["0a64d39a890b89af"]]},{"id":"7afdf96b3e18654e","type":"change","z":"ed63f7fadb48e2f7","name":"from string to number","rules":[{"t":"set","p":"payload","pt":"msg","to":"$number($trim(payload))","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":980,"y":280,"wires":[["dcaa01d15253ebc9"]]},{"id":"dcaa01d15253ebc9","type":"ui_gauge","z":"ed63f7fadb48e2f7","name":"","group":"7db45a2e2009a112","order":13,"width":4,"height":3,"gtype":"gage","title":"I0.12","label":"","format":"{{value}}","min":0,"max":"1024","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","className":"twelve","x":1170,"y":280,"wires":[]},{"id":"0a64d39a890b89af","type":"ui_gauge","z":"ed63f7fadb48e2f7","name":"","group":"7db45a2e2009a112","order":12,"width":4,"height":3,"gtype":"gage","title":"I0.11","label":"","format":"{{value}}","min":0,"max":"1024","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","className":"eleven","x":1170,"y":240,"wires":[]},{"id":"9053e7b943fbcf37","type":"ui_gauge","z":"ed63f7fadb48e2f7","name":"","group":"7db45a2e2009a112","order":11,"width":4,"height":3,"gtype":"gage","title":"I0.10","label":"","format":"{{value}}","min":0,"max":"1024","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","className":"ten","x":1170,"y":200,"wires":[]},{"id":"871f31d13f55a322","type":"ui_gauge","z":"ed63f7fadb48e2f7","name":"","group":"7db45a2e2009a112","order":4,"width":4,"height":3,"gtype":"gage","title":"I0.9","label":"","format":"{{value}}","min":0,"max":"1024","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","className":"nine","x":1170,"y":160,"wires":[]},{"id":"3dd038cd1d681cb6","type":"ui_gauge","z":"ed63f7fadb48e2f7","name":"","group":"7db45a2e2009a112","order":3,"width":4,"height":3,"gtype":"gage","title":"I0.8","label":"","format":"{{value}}","min":0,"max":"1024","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","className":"eight","x":1170,"y":120,"wires":[]},{"id":"02e7cc7d9727f150","type":"ui_gauge","z":"ed63f7fadb48e2f7","name":"","group":"7db45a2e2009a112","order":2,"width":4,"height":3,"gtype":"gage","title":"I0.7","label":"","format":"{{value}}","min":0,"max":"1024","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","className":"seven","x":1170,"y":80,"wires":[]},{"id":"19c2de8d44a5c0ec","type":"comment","z":"ed63f7fadb48e2f7","name":"Data from M-Duino 21+ PLC","info":"","x":200,"y":80,"wires":[]}]
Industrial Shields Node-RED Dashboard - Tutorial: Node-RED Dashboard and Arduino Web Server

Buscar en nuestro blog

Tutorial de Arduino: Dashboard de Node-RED y servidor web de Arduino
Boot & Work Corp. S.L., Fernandez Queralt Martinez 3 de enero de 2022
Compartir

¿Estás buscando tu Controlador Lógico Programable ideal?

Echa un vistazo a esta comparativa de producto de varios controladores industriales basados en Arduino.

Comparamos entradas, salidas, comunicaciones y otras especificaciones con las de los equipos de otras marcas destacadas.


Industrial PLC comparison >>>