Trying to store some images on the PI and then show the images using the html template.
There was some mention of setting the 'httpStatic' to point to where the files will be stored.
But I am having bit of problem of locating the settings.js file that was mentioned.
Here is screen shot . Can not see any settings.js file.
If you start node-red from the command line it will tell you which settings.js it is using and the path to it.
On the Command Line, I ran :
node-red-stop ( to stopped Node Red because Node Red was running already)
Then I saw the path to the path to the settings.js
I am sure this will be handy for others.
Where is it? It should be in .node-red
Hi Uk Moose,
I changed the httpStatic to : httpStatic: ' home/pi/personal/ ',
Put the image in the home/pi/personal directory
Inserted a html template with the following but the image is not pulling up.
No need to address your query to one person, as there's lots of people here who can give advice.
Your image didn't make it ..
And as Colin said, if you had already run Node-RED it should have been where you were looking. so where was it?
Aside from the precise location of the settings file, which is important to confirm, when you say:
httpStatic: ' home/pi/personal/ ',
did you mean:
'/home/pi/personal/' - the slash at the front is quite important.
Also, you need to restart Node-RED whenever you edit the settings file.
Hi Nick and rest of team.
0. The location of the settings.js file was:
I manuevered to that location and did a sudo nano settings.js
Attached is image of the settings.js file
Note: changed it to '/home/pi/sweetwater/',
Then typed in ctrl + o then ctrl + x
Then created a html template node . But the .jpg file does not show.
Back to some basic questions
- What version of NR and node.js are you running? You can get them from the node-red log when you start node-red manually using
- How did you install node-red on the Pi?
- have you ever run the bash script located here: https://nodered.org/docs/hardware/raspberrypi
If not, I suggest you backup your
flows_raspberrypi_cred.json files and then run the script. Then see if the settings.js is in the .node-red folder.
1.running node red V0.18.4
2.running PI Raspian. Installed from the 'NOOB' which included the Node Red.
3. the /home/nol line ( that was commented out //)
Run the bash <(curl script in the raspbian install instructions . That should give you an up to date node red environment with everything in the right place.
The settings.js in the /usr dir is the template one that gets copied over to your user directory on first run. You should only edit the one in your users directory (typically /home/pi/.node-red on a pi etc)
Ceejay if you read the thread, it wasn’t copied over and Node-RED was picking up the other one.
And aren’t you supposed to be on vacation?
In the very early days of Node-RED, before we had the concept of a user data directory, you would edit the settings file in the install directory of Node-RED.
We then added the user data directory to keep things separate. However we needed to not break existing users - so the code checks the modified timestamp of the settings file in the install directory. If that has been edited, and one doesn't exist in the user directory, we'll use the one in the install directory rather than copy over to the user directory.
So it is possible to get into this state.