Hi,
my new project "Door Bell",
it is a ESP32-Cam, this device take a Picture (.jpg ca. 100 bytes) when the Ring-Button is pressed and send it to a Raspi with NR over MQTT, with the command:
client.publish("door/photo", "FILE_PHOTO") as Payload in the ESP32 sketch;
in Node-Red:
- Node "mqtt in" (Topic: door/photo) / output: base64-coding string;
- Node "base64" converter
- and a Template (Dashboard)
on the Template the picture would not be displayed, the debug-list output of the base64 msg.payload show's the following:
door/photo : msg.payload buffer[10] [70,73,76,69,95,80,72,79,84,79] >>> "FILE_PHOTO"
flow:
{
"id": "7998f37f030d7fd9",
"type": "mqtt in",
"z": "81f9dc57e0d19d5e",
"name": "",
"topic": "door/photo",
"qos": "2",
"datatype": "base64",
"broker": "31b2666c956d6ef4",
"nl": false,
"rap": true,
"rh": 0,
"inputs": 0,
"x": 100,
"y": 100,
"wires": [
[
"1e3a16b617888cd7"
]
]
},
{
"id": "8d1deb059071d2c5",
"type": "ui_template",
"z": "81f9dc57e0d19d5e",
"group": "48fa5d97.39c614",
"name": "show image",
"order": 4,
"width": "6",
"height": "5",
"format": "<div>\n <img width=\"300px\" alt=\"esp32-cam test\" src=\"data:image/jpg;base64,{{msg.payload}}\" />\n</div>",
"storeOutMessages": true,
"fwdInMessages": true,
"resendOnRefresh": true,
"templateScope": "local",
"x": 750,
"y": 100,
"wires": [
[]
]
},
{
"id": "1e3a16b617888cd7",
"type": "base64",
"z": "81f9dc57e0d19d5e",
"name": "",
"action": "",
"property": "payload",
"x": 480,
"y": 100,
"wires": [
[
"8d1deb059071d2c5",
"e1fc8194866b05e9"
]
]
},
{
"id": "e1fc8194866b05e9",
"type": "debug",
"z": "81f9dc57e0d19d5e",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 640,
"y": 180,
"wires": []
},
{
"id": "31b2666c956d6ef4",
"type": "mqtt-broker",
"name": "DoorBell",
"broker": "localhost",
"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": "48fa5d97.39c614",
"type": "ui_group",
"name": "Door Bell",
"tab": "9f8151f3dee1b703",
"order": 1,
"disp": false,
"width": "6",
"collapse": false
},
{
"id": "9f8151f3dee1b703",
"type": "ui_tab",
"name": "DoorBell",
"icon": "dashboard",
"order": 6,
"disabled": false,
"hidden": false
}
]```
maybe a component there are missing (like a decoder?), I don't know...