You could use an exec node configured with the raspistill command, for testing purposes. Which node exactly is the one that takes the picture (the one in the middle in your screenshot) ?
Do you really need sudo to run raspistill?
You are creating an image file owned by root, so any further processing of it, housekeeping etc, will need sudo as well.
Hi, thanks for your feedback.
First I installed [node-red-contrib-camerapi ] from Node-Red manage palette, updated and run
sudo apt-get install python-picamera python3-picamera (according to instructions on: node-red-contrib-camerapi (node) - Node-RED and there is where I am now.
Now, what do you mean by not using sudo?
How I go back and repair it from where I am now?
Thanks
Just reinstalled the whole set:
Raspberry Pi, updated, Node-red, node-red-contrib-camerapi, updated again, sudo apt-get install python-picamera python3-picamera
Problem remains identical.
I must be missing something very simple, can't find a solution everywhere I looked.
A footnote on the instruction page I mention above says:
This node is tested on RASPBIAN (buster), Nodejs V12.x LTS and NPM 6.x on Node-Red 1.0.6
The script that installs Node-Red installed Nodejs v16.17.0
Installed NPM as well but no change.
You said "Now I tested the pi/camera from a pi terminal as below:"
sudo raspistill -o testshot.jpg
You used sudo to launch the command raspistill.
Apologies if you already know this but...
On the Bash command line you can run a command by just entering it's name.
For example the whoami command
pi@MyPi:~ $ whoami
pi
But sometimes the "pi"user does not have permission to use a command
So you can use sudo to run a command as the all powerfull "root" user
pi@MyPi:~ $ sudo whoami
root
Beginners occasionally think that they have to use sudo to run every command.
It is a really bad idea because your directories can get clogged up with files owned by root, whose presence can prevent normal operations.
Edit -
On your newly installed Pi run these commands:
cd
raspistill -o anothertest.jpg
echo $?
ls -l anothertest.jpg
In Node-red, use an Exec node to execute raspistill -o yetanothertest.jpg
Use a debug node to show the returned message (the first output) and any error (the second output)
pi@picamera:~ $ raspistill -o testshot.jpg
pi@picamera:~ $ ls
testshot.jpg
pi@picamera:~ $ ls -l
total 2104
-rw-r--r-- 1 pi pi 2154070 Oct 1 16:11 testshot.jpg
pi@picamera:~ $
When I performed this test before I uploaded the testshot.jpg and chcked the image and it corresponds to what was expected.
Sorry, I did not know ls -al and used ls -l (that I am used to) but checked the info about this specific file was the same.
pi@picamera:~ $ ls -l
total 4320
drwxr-xr-x 27 pi pi 4096 Oct 1 16:24 node_modules
-rw-r--r-- 1 pi pi 8338 Oct 1 16:24 package-lock.json
-rw-r--r-- 1 pi pi 2154070 Oct 1 16:11 testshot.jpg
-rw-r--r-- 1 pi pi 2251991 Oct 1 16:25 testshotNew.jpg
OK, it looks like the raspistill command doesn't give any useful success message - many Linux commands (deliberately) are silent if they succeed. So the empty output from the exec node isn't a sign of failure.
Probably the camerapi node actually calls raspistill, so it's blank output is not necessarily a bad sign either. But the node help does say this " msg.payload will give you the path and the filename including extension to the photo."
Has camerapi created an image file?
Just to double check, which Rasberry Pi OS have you installed ? As far as I know the picamera library (which the installed node seems to use) would not run on 64-bits. So far we know that your hardware os good and you can capture picture with raspstill, which is good.
-rw-r--r-- 1 pi pi 2154070 Oct 1 16:11 testshot.jpg ------->from terminal prompt
-rw-r--r-- 1 pi pi 2251991 Oct 1 16:25 testshotNew.jpg ---> From Node-Red exec
Camera not precisely positioned in the same place .