Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TCP in Node auto respons [72,67,202,1,1,...] #4139

Closed
bjdaijun opened this issue Apr 17, 2023 · 5 comments
Closed

TCP in Node auto respons [72,67,202,1,1,...] #4139

bjdaijun opened this issue Apr 17, 2023 · 5 comments

Comments

@bjdaijun
Copy link

Current Behavior

And if I connect to tcp in node, It‘s will send back some bytes to client. But these data not from my configs.

Expected Behavior

Client do not receive any data when not send data by hand.

Steps To Reproduce

use this config, and node debug68 will receive these bytes repeatedly.

Example flow

[
    {
        "id": "19d8c6fadea93ef9",
        "type": "tab",
        "label": "tcp-test",
        "disabled": false,
        "info": "",
        "env": []
    },
    {
        "id": "1787daf384b3888d",
        "type": "tcp in",
        "z": "19d8c6fadea93ef9",
        "name": "",
        "server": "server",
        "host": "",
        "port": "28001",
        "datamode": "stream",
        "datatype": "buffer",
        "newline": "",
        "topic": "",
        "trim": false,
        "base64": false,
        "tls": "",
        "x": 240,
        "y": 160,
        "wires": [
            [
                "741ee8031febd4d5"
            ]
        ]
    },
    {
        "id": "ace10560e9081352",
        "type": "debug",
        "z": "19d8c6fadea93ef9",
        "name": "debug 67",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 420,
        "y": 160,
        "wires": []
    },
    {
        "id": "566014e0c80e8a46",
        "type": "tcp out",
        "z": "19d8c6fadea93ef9",
        "name": "",
        "host": "",
        "port": "",
        "beserver": "reply",
        "base64": true,
        "end": false,
        "tls": "",
        "x": 510,
        "y": 260,
        "wires": []
    },
    {
        "id": "741ee8031febd4d5",
        "type": "function",
        "z": "19d8c6fadea93ef9",
        "name": "function 21",
        "func": "",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 330,
        "y": 240,
        "wires": [
            [
                "566014e0c80e8a46"
            ]
        ]
    },
    {
        "id": "540233ccc27276ee",
        "type": "tcp in",
        "z": "19d8c6fadea93ef9",
        "name": "",
        "server": "client",
        "host": "iot.mapchang.com",
        "port": "28001",
        "datamode": "stream",
        "datatype": "buffer",
        "newline": "",
        "topic": "",
        "trim": false,
        "base64": false,
        "tls": "",
        "x": 280,
        "y": 380,
        "wires": [
            [
                "ccaa2e6ab665534b"
            ]
        ]
    },
    {
        "id": "ccaa2e6ab665534b",
        "type": "debug",
        "z": "19d8c6fadea93ef9",
        "name": "debug 68",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 560,
        "y": 380,
        "wires": []
    }
]

Environment

  • Node-RED version: 3.0.2
  • Node.js version:
  • npm version:
  • Platform/OS: ubuntu
  • Browser: chrome
@Steve-Mcl
Copy link
Contributor

Steve-Mcl commented Apr 17, 2023

And if I connect to tcp in node, It‘s will send back some bytes to client. But these data not from my configs.

Whatever device is on the end of iot.mapchang.com:28001, it is clearly sending this data:

image

Therefore the TCP node is working as expected.


If you need help using node-red, please head to the forum or slack as was displayed when you raised this issue.
This GitHub issue board is intended for reporting bugs.

Thanks, Steve.

@Steve-Mcl
Copy link
Contributor

Closing issue. Please re-open or comment if you still believe this to be a Node-RED problem.

@bjdaijun
Copy link
Author

bjdaijun commented Apr 18, 2023

Closing issue. Please re-open or comment if you still believe this to be a Node-RED problem.

image

Thank you for your reply. But I still can't got the point. As you see, The node TCP:28001 IS the device that the next node tcp:iot.mapchant.com:28001 (same as tcp:localhost:28001) ,connected to. And the data is send out by the tcp in node (TCP:28001) . But as you see, The Node TCP:28001 send nothing in the function node. But the Node(tcp:iot.mapchang.com:28001) received these data.

So why TCP:28001 send these data internally?

@hardillb
Copy link
Member

But the tcp node that is only connected to the debug node is NOT connecting to the tcp-in -> function -> tcp-out flow. This can be seen because there is not "connected 1" status under the tcp-in node.

This means that iot.mapchang.com is not resolving to the machine that Node-RED is running on. So what ever is listening on port 28001 on that machine is sending the data, not Node-RED.

If you change the hostname in the bottom tcp node to localhost you should see the connection and no data being sent

@bjdaijun
Copy link
Author

It turns out that in other flow ,there is a tcp-out-response node ,timerly activated and it send that data.
Like these
image

After remove it, all tcp nodes return clean status.

Thanks for help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants