Transfer images between 2 node red install ( pi - windows )

Hi!

I am looking for some advice.
I want to send an image from a windows pc to a pi both running node red.
Now i think about ftp to do the transfer or send the data file trough mqtt but i guess that is not ideal

What should you advice to do this? and why so i learn from it :wink:

You can use MQTT to send images (just tested it and it worked fine)

Depends how much and how often I guess. How large are the images, and at what frequency would you like to send it?

I send still images from Pi cameras using MQTT, which works well, though I agree MQTT is not an ideal channel for this. I push the raw image data through a Base-64 encode node before transmission which allows them to be directly displayed on a dashboard on the receiving end with a simple template node. Been doing it this way for a couple of years without any issues.

1 Like

serious? thats cool. Thought it would be to much for mqtt

Cool i am going to test it, thanks

The payload of the message is limited to 268,435,456 bytes. this is defined by the spec.

No problem unless you have some serious imagery :wink:

1 Like

can I get the flow of it?? I'm sending an image with base-64 encode but on receiving the same using base64 not able to get the image.

What does that mean? The data doesn't arrive at the MQTT broker? The data doesn't arrive in the 2nd node-red? The data arrives but you can't display it in dashboard?

I can get the data, Data from both MQTT send and receive have base64 node. At this moment I got the image successfully in the image preview node.

Now I'm not able to see it in the dashboard. I have used a template node for that. but not able to see the image

image
image

Thats probably something simple. See the flow in this post, grab the template and ui_template from that.

1 Like

Sure!

[
    {
        "id": "c6dd49c3.81e468",
        "type": "tab",
        "label": "Flow 1",
        "disabled": false,
        "info": ""
    },
    {
        "id": "9e351bee.6ede18",
        "type": "ui_template",
        "z": "c6dd49c3.81e468",
        "group": "aff659f4.4b64b",
        "name": "Camera 1",
        "order": 2,
        "width": "6",
        "height": "4",
        "format": "<img src=\"data:image/jpg;base64,{{msg.payload}}\" style=\"display: block; width: 100%;\" />",
        "storeOutMessages": true,
        "fwdInMessages": false,
        "resendOnRefresh": false,
        "templateScope": "local",
        "x": 240,
        "y": 120,
        "wires": [
            []
        ]
    },
    {
        "id": "b28e5d43.133d3",
        "type": "mqtt in",
        "z": "c6dd49c3.81e468",
        "name": "Camera 1",
        "topic": "cameras/1/capture",
        "qos": "2",
        "datatype": "auto",
        "broker": "e929bd47.f54968",
        "x": 80,
        "y": 120,
        "wires": [
            [
                "9e351bee.6ede18"
            ]
        ]
    },
    {
        "id": "79168c78.2df8e4",
        "type": "camerapi-takephoto",
        "z": "c6dd49c3.81e468",
        "filemode": "0",
        "filename": "",
        "filedefpath": "1",
        "filepath": "",
        "fileformat": "jpeg",
        "resolution": "2",
        "rotation": "180",
        "fliph": "0",
        "flipv": "0",
        "brightness": "50",
        "contrast": "0",
        "sharpness": "0",
        "quality": "",
        "imageeffect": "none",
        "exposuremode": "auto",
        "iso": "0",
        "agcwait": "1",
        "awb": "auto",
        "name": "Action",
        "x": 230,
        "y": 60,
        "wires": [
            [
                "2eb733dd.94a95c"
            ]
        ]
    },
    {
        "id": "2eb733dd.94a95c",
        "type": "base64",
        "z": "c6dd49c3.81e468",
        "name": "",
        "x": 380,
        "y": 60,
        "wires": [
            [
                "a0c49073.a2b71"
            ]
        ]
    },
    {
        "id": "a0c49073.a2b71",
        "type": "mqtt out",
        "z": "c6dd49c3.81e468",
        "name": "MQTT",
        "topic": "",
        "qos": "",
        "retain": "",
        "broker": "e929bd47.f54968",
        "x": 530,
        "y": 60,
        "wires": []
    },
    {
        "id": "2568cc5e.548584",
        "type": "inject",
        "z": "c6dd49c3.81e468",
        "name": "Capture",
        "props": [
            {
                "p": "timestamp",
                "v": "",
                "vt": "date"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "cameras/1/capture",
        "payloadType": "str",
        "x": 90,
        "y": 60,
        "wires": [
            [
                "79168c78.2df8e4"
            ]
        ]
    },
    {
        "id": "aff659f4.4b64b",
        "type": "ui_group",
        "z": "",
        "name": "Default",
        "tab": "bcbe7bf2.cf94c8",
        "order": 2,
        "disp": true,
        "width": "6",
        "collapse": false
    },
    {
        "id": "e929bd47.f54968",
        "type": "mqtt-broker",
        "z": "",
        "broker": "localhost",
        "port": "1883",
        "clientid": "",
        "usetls": false,
        "compatmode": true,
        "keepalive": "60",
        "cleansession": true,
        "birthTopic": "",
        "birthQos": "0",
        "birthPayload": "",
        "willTopic": "",
        "willQos": "0",
        "willPayload": ""
    },
    {
        "id": "bcbe7bf2.cf94c8",
        "type": "ui_tab",
        "z": "",
        "name": "Examples",
        "icon": "dashboard",
        "order": 1,
        "disabled": false,
        "hidden": false
    }
]
1 Like