Configurando TCP Communication
- 28 Jul 2024
- Print
- PDF
Configurando TCP Communication
- Updated on 28 Jul 2024
- Print
- PDF
Article summary
Did you find this summary helpful?
Thank you for your feedback
La cámara puede funcionar con Node-RED y TCP para comunicarse con otros dispositivos. Es bastante sencillo; los pasos son:
Paso 1 :
-La dirección IP de la cámara debe estar en el mismo rango que el dispositivo con el que está interactuando.
Paso 2 :
- Se debe abrir un puerto de comunicación (TCP in), donde asignamos el puerto que estaremos escuchando.
Paso 3 :
- Para enviar una respuesta al puerto, debemos colocar un nodo TCP out, asignar la dirección IP del dispositivo con el que nos estamos comunicando y asignar un puerto libre.
Ejemplo:
Logica Node Red:
(Importa el texto)
[
{
"id": "85237e29b8e86d05",
"type": "tcp in",
"z": "c0ed903576d54694",
"name": "",
"server": "server",
"host": "",
"port": "49155",
"datamode": "stream",
"datatype": "utf8",
"newline": "",
"topic": "",
"trim": false,
"base64": false,
"tls": "",
"x": 780,
"y": 160,
"wires": [
[
"8aac7b8d6e607f2c"
]
]
},
{
"id": "f2652272e23aef9f",
"type": "inject",
"z": "c0ed903576d54694",
"name": "Part 1",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "",
"payloadType": "date",
"x": 190,
"y": 160,
"wires": [
[
"a93161abf53cadef"
]
]
},
{
"id": "8d1350846af1f18b",
"type": "debug",
"z": "c0ed903576d54694",
"name": "debug 2",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 520,
"y": 160,
"wires": []
},
{
"id": "a93161abf53cadef",
"type": "function",
"z": "c0ed903576d54694",
"name": "function 1",
"func": "msg.payload = \"....\";\nreturn msg;\n",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 340,
"y": 160,
"wires": [
[
"8d1350846af1f18b",
"6c867cbe2ea47239"
]
]
},
{
"id": "6c867cbe2ea47239",
"type": "tcp out",
"z": "c0ed903576d54694",
"name": "",
"host": "192.168.0.100",
"port": "49255",
"beserver": "client",
"base64": false,
"end": false,
"tls": "",
"x": 570,
"y": 220,
"wires": []
},
{
"id": "8aac7b8d6e607f2c",
"type": "debug",
"z": "c0ed903576d54694",
"name": "debug 6",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 960,
"y": 200,
"wires": []
}
]
Was this article helpful?