Hi, I’ve been trying to get the surveillance camera up and running as per the instructions included with the home automation course and ran into a problem.
When I go to the camera page, clicking start does not work. I go back and look at the debug window and it says:
sudo: start: command not found
{“code”:1,”message”:”Command failed: /usr/bin/sudo start Python3 rpi_camera_surveillance_system.py\nsudo: start: command not found\n”}
Similar errors if I push the stop button.
I’m fairly certain that I got everything done as it describes.I’ve also search the internet for a while before asking here but couldn’t find anything to help.
Thanks for any help,
Bob
Hi Bob.
When you tested the Video Streaming (page 8), were you able to see the video ?
Regards,
Sara
Hi Sara,
Yes that does work. I just tested it again, works fine there. I went to see if it was showing up in the node red page and it wasn’t so I clicked start and nothing happened. I then checked the debug window and it showed all of this:
mmal: mmal_vc_port_enable: failed to enable port vc.null_sink:in:0(OPQV): ENOSPCmmal: mmal_port_enable: failed to enable connected port (vc.null_sink:in:0(OPQV))0x1ca43b0 (ENOSPC)mmal: mmal_connection_enable: output port couldn’t be enabledTraceback (most recent call last): File “rpi_camera_surveillance_system.py”, line 84, in <module> with picamera.PiCamera(resolution=’640×480′, framerate=24) as camera: File “/usr/lib/python3/dist-packages/picamera/camera.py”, line 433, in __init__ self._init_preview() File “/usr/lib/python3/dist-packages/picamera/camera.py”, line 513, in _init_preview self, self._camera.outputs[self.CAMERA_PREVIEW_PORT]) File “/usr/lib/python3/dist-packages/picamera/renderers.py”, line 558, in __init__ self.renderer.inputs[0].connect(source).enable() File “/usr/lib/python3/dist-packages/picamera/mmalobj.py”, line 2212, in enable prefix=”Failed to enable connection”) File “/usr/lib/python3/dist-packages/picamera/exc.py”, line 184, in…
Maybe that will make sense to you guys? lol
Thanks for the help so far,
Bob
Hello Bob,
If you have the your ptyhon script named rpi_camera_surveillance_system.py located exactly where I mention:
pi@raspberrypi:~ $ nano rpi_camera_surveillance_system.py
Then, if you have Exec nodes as described in pages 14 and 15, this error looks like your server is already running:
Failed to enable connection
Can you restart your Raspberry Pi board, then wait a few seconds and open Node-RED. Then, click the START button in Node-RED once?
Does it print the same error in the debug window?
Hi Rui,
I did as you asked, I went to node red, clicked start and nothing showed up but a broken image icon. I checked the debug window and there was nothing there. Under the Python3 exec node, it’s showing pid:2692 (that number changes if I restart and test this all over again which I did 3 times, same results different numbers)
I rechecked and the file is in the correct spot and the exec nodes are exactly as the instructions have.
Just for fun I retested as per Sara’s reply above and the camera is still working if I start it in the terminal and go to the :8000 test page. Nothing wrong there anyhow.
Thanks,
Bob
So, when exactly does that error happen (that you’ve posted in your previous image)?
The error seems to mean that the Python script is already running (so, it can’t call the camera twice).
If you click the START button, what happens when you try to visit this URL?
http://YOUR_RPI_IP_ADDRESS:8000/stream.mjpg
I just found another oddity. I start all over, reboot, then go to my dashboard and click start. Nothing happens and no errors in debug window. Now… If I click refresh on the browser, the camera shows up as it should and is working.
I then went further, I pushed stop and it does stop the camera with no errors showing. I then click start and nothing again.. If I hit refresh on the browser, the camera is there again and working.
Might be a browser issue? I’m using Firefox for all of this.
I then tried this in IE and the refresh trick does not work there. I only get the broken image icon.
Next I tried it on an Android tablet running Firefox and the refresh trick doesn’t work there, same broken image.
Hope that all makes sense,
Thanks,
Bob
Can you try it on Google Chrome instead? I’m not sure if Firefox or an extra extension might be blocking the image embedded. That’s definitely related to the browser not updating the image properly
Just tested this on google chrome on my android and the camera showed up as it should.
I’m a Firefox guy so hopefully there is a fix so I can keep using it. Worst case is I’ll have to hit refresh. 🙁
Thanks,
Bob
Unfortunately I’m not sure if it’s some browser limitation that doesn’t detect the new image when it first starts or it doesn’t push the new image (requires a refresh). I’ll have to check it in more detail, but I’m not sure if I’ll be able to find a solution…
Regards,
Rui
Thanks for your help. I’ll do some google searching, I doubt I’m the only one with this issue.
At least I can use it. That’s good enough at this point. 🙂
Bob
Just wanted to add some info to this thread: There is no need to refresh the browser, I can right click on the image area and click “reload image” and it appears.
Just as a complete aside “pid” stands for Process ID. Everything you start in *nix gets a pid. Generally not helpful unless you need to kill a process. That’s why it’s different every time you restart the Pi.