Problem, camera does not display

Good morning all.
I followed this tutorial to be able to control the robot via a web browser.

https://www.piborg.org/blog/yetiborg-v2-examples-web-ui

Everything works except the webcam display, here is a screen of my page:

https://i.imgur.com/EzAAVq2.png

Do you know where it comes from?

thank you

pi@raspberrypi:~/yetiborgv2 $ sudo ./yeti2Web.py
Loading ZeroBorg on bus 1, address 40
Found ZeroBorg at 40
ZeroBorg loaded on bus 1
Setup camera
Setup the stream processing thread
Wait ...
Start the stream using the video port
Setup the watchdog
Traceback (most recent call last):
File "./yeti2Web.py", line 376, in
httpServer = SocketServer.TCPServer(("0.0.0.0", webPort), WebServer)
File "/usr/lib/python2.7/SocketServer.py", line 420, in __init__
/usr/lib/python2.7/dist-packages/picamera/encoders.py:544: PiCameraResolutionRounded: frame size rounded up from 240x180 to 240x192
width, height, fwidth, fheight)))
self.server_bind()
File "/usr/lib/python2.7/SocketServer.py", line 434, in server_bind
self.socket.bind(self.server_address)
File "/usr/lib/python2.7/socket.py", line 228, in meth
return getattr(self._sock,name)(*args)
socket.error: [Errno 98] Address already in use

Images: 
piborg's picture

Unfortunately the error message you have shown is related to the network connection and would prevent the page loading at all - in other words it is not to do with the problem you are seeing :(

That error is usually caused by either running two copies of the script at the same time, or trying to start the script again too soon after it had been stopped.

Try rebooting the Raspberry Pi and running the script again - you should get a different error message if the script is having problems with the camera. If you have set the script to run at startup you will need to remove that first.

I don't really understand what's going on ...

Images: 
piborg's picture

This is a problem with the script, but it is easy to fix :)

Open yeti2Web.py in an editor and look for the line:

            if sendFrame != None:

and change it to:

            if sendFrame is not None:

Next look for the line:

            if captureFrame != None:

and change it to:

            if captureFrame is not None:

Save the script and try it again.

Thank you very much for your help Piborg.

Now I have another error message here ^^

Images: 
piborg's picture

This one is a little harder to understand, but easier to sort out.

The actual error is the mmal lines towards the top:

mmal: mmal_vc_port_enable: failed to enable port vc.null_sink:in:0(OPQV): ENOSPC
mmal: mmal_port_enable: failed to enable connected port (vc.null_sink:in:0(OPQV))0x1bec750 (ENOSPC)
mmal: mmal_connection_enable: output port couldn't be enabled

What they mean is that the camera is already in use. In this case it is because the previous run of the script did not turn the camera off properly because of the error.

To fix the problem simply restart the Raspberry Pi :)

A big thank you to you Piborg! It works !
Very good evening to you: D !!!!

Hello,
It's me again.
I formatted my raspberry and installed RASPAP to have a wifi hotspot.
Maybe the problem comes from there? Here is the error code:

pi@raspberrypi:~/yetiborgv2 $ sudo ./yeti2Web.py
Loading ZeroBorg on bus 1, address 40
Found ZeroBorg at 40
ZeroBorg loaded on bus 1
Setup camera
Setup the stream processing thread
Wait ...
Start the stream using the video port
Setup the watchdog
Traceback (most recent call last):
File "./yeti2Web.py", line 376, in
httpServer = SocketServer.TCPServer(("0.0.0.0", webPort), WebServer)
File "/usr/lib/python2.7/SocketServer.py", line 420, in __init__
self.server_bind()
File "/usr/lib/python2.7/SocketServer.py", line 434, in server_bind
self.socket.bind(self.server_address)
File "/usr/lib/python2.7/socket.py", line 228, in meth
return getattr(self._sock,name)(*args)
socket.error: [Errno 98] Address already in use
/usr/lib/python2.7/dist-packages/picamera/encoders.py:544: PiCameraResolutionRounded: frame size rounded up from 240x180 to 240x192
width, height, fwidth, fheight)))

piborg's picture

I suspect that the RASPAP software uses port 80 as well, meaning the Web UI cannot use port 80.

In the script look for this line:

webPort = 80      # Port number for the web-page, 80 is what web-pages normally use

and change the number to something else, such as 1000.

The script should now run, but you will need to change the address in your web browser to include the port number. For example http://192.168.0.198:1000

It's all good, I deleted the script, I have already downloaded again and made the appropriate modifications, everything works. Thanks again!

piborg's picture

Glad to hear you got everything working :)

Subscribe to Comments for " Problem, camera does not display"