Hi Steve,
I moved the "domotica" folder at root level C:\ and edited the settings.js accordingly:
httpStatic: 'C:/domotica/'
restarted node-red and seen the correct Static path:
C:/domotica > /
where all content should be accessible from the "/" root
I verified that the SYSTEM user who owns the node.exe process has all privileges on domotica folder
and all contained files
I made a super simple flow with one inject and a template node with this code:
<div>
Test png
<img alt="Image not found" src ="/schemaloex.png" />
</div>
where "schemaloex.png" is one of the images inside "domotica"
I inject the timestamp to run the template node but, as you can see, the image is not found.
I enclose the flow so you can check if I have made some erroneous configuration:
[
{
"id": "6027b4bab948526f",
"type": "ui_template",
"z": "641efd2eb7d562cf",
"group": "63b3eeadbccc9412",
"name": "SchemaLOEX",
"order": 1,
"width": "7",
"height": "10",
"format": "<div> \n Test png\n <img alt=\"Image not found\" src =\"/schemaloex.png\" /> \n</div> \n",
"storeOutMessages": true,
"fwdInMessages": true,
"resendOnRefresh": true,
"templateScope": "local",
"className": "",
"x": 540,
"y": 1280,
"wires": [
[]
]
},
{
"id": "c51c11f3c74b761a",
"type": "inject",
"z": "641efd2eb7d562cf",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "",
"payloadType": "date",
"x": 240,
"y": 1280,
"wires": [
[
"6027b4bab948526f"
]
]
},
{
"id": "63b3eeadbccc9412",
"type": "ui_group",
"name": "Termoregolazioni nei Piani",
"tab": "9ebecd5c9ef57a7e",
"order": 2,
"disp": true,
"width": "7",
"collapse": false
},
{
"id": "9ebecd5c9ef57a7e",
"type": "ui_tab",
"name": "Comfort",
"icon": "dashboard",
"order": 4,
"disabled": false,
"hidden": false
}
]
I'm really desperate and frankly I don't know which other test/configuration I can make in order to be able to display images on template node via dashboard.
Two things have changed moving the project from NR 1.x on a Raspberry Pi:
- NR version from 1 to 3.2
- platform from Raspberry to Windows
but I don't know what to blame.
I would like to add that the only way I was able to see the image "schemaloex.png" was using a file node pointing to that image, converted to base64 and passed as msg.payload to the template using this flow:
[
{
"id": "76f9c28c.8d324c",
"type": "inject",
"z": "9519c5e5bc8dfe67",
"name": "",
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "",
"payloadType": "date",
"x": 300,
"y": 860,
"wires": [
[
"91ff3a3e.591a38"
]
]
},
{
"id": "696f92ca.600a9c",
"type": "ui_template",
"z": "9519c5e5bc8dfe67",
"group": "63b3eeadbccc9412",
"name": "",
"order": 1,
"width": "7",
"height": "8",
"format": "\n prova con base64\n <img width=\"100%\" height=\"100%\" alt=\"Image not found\" src=\"data:image/png;base64,{{msg.payload}}\" />\n",
"storeOutMessages": true,
"fwdInMessages": true,
"resendOnRefresh": false,
"templateScope": "local",
"className": "",
"x": 1030,
"y": 860,
"wires": [
[]
]
},
{
"id": "91ff3a3e.591a38",
"type": "file in",
"z": "9519c5e5bc8dfe67",
"name": "",
"filename": "C:\\domotica\\schemaloex.png",
"filenameType": "str",
"format": "",
"chunk": false,
"sendError": false,
"encoding": "none",
"allProps": false,
"x": 570,
"y": 860,
"wires": [
[
"e66563f4.00136"
]
]
},
{
"id": "e66563f4.00136",
"type": "base64",
"z": "9519c5e5bc8dfe67",
"name": "",
"action": "str",
"property": "payload",
"x": 850,
"y": 860,
"wires": [
[
"696f92ca.600a9c"
]
]
},
{
"id": "63b3eeadbccc9412",
"type": "ui_group",
"name": "Termoregolazioni nei Piani",
"tab": "9ebecd5c9ef57a7e",
"order": 2,
"disp": true,
"width": "7",
"collapse": false
},
{
"id": "9ebecd5c9ef57a7e",
"type": "ui_tab",
"name": "Comfort",
"icon": "dashboard",
"order": 4,
"disabled": false,
"hidden": false
}
]
At least we know that this image exists, is readable, but not thru the template node.
As you can well imagine I cannot pass all my images reading from them from file system, converting as base64 streams and passing as objects whereas before I just typed their name!
Do you personally use NR on a Windows 11 machine?
Please help!