Web Gui error

Hey there,

I bought a DiddyBorg and i have done everything like they told me to let the Web Gui work but when i do:

sudo ~/diddyborg-web/diddyWeb.py

This pops up: https://gyazo.com/f4ec28cabe738f7758059bae286b036e

What do i do ?
I use a ps3 controller that is connected , i have no camera setup and no wifi stick .. so just the basic diddyborg.

Thanks for reading :)

Images: 
piborg's picture

The DiddyBorg Web UI expects to have the camera so it can display pictures.

The error you are getting is because the script cannot find the cv2 library, which is used for the image processing.

In order to use the script without a camera connected the code relating to the image display needs to be removed.

I have attached a copy of the script with all of the camera related lines commented out.
This script should work with a DiddyBorg that has no camera fitted.

Hello
Can you make a running script with the script attached?
I dont know how i can make this!
Thanks

piborg's picture

I am not sure what you need exactly, the script attached to the post above should be ready to go:

  1. Download the script to your Raspberry Pi into the standard DiddyBorg directory: ~/diddyborg
  2. Rename the script so it is called diddyWeb.py
  3. Open a terminal and use the command cd ~/diddyborg
  4. Make the script executable with the command chmod +x diddyWeb.py
  5. You can now run the script using sudo ./diddyWeb.py

i tried the above. the file is in the correct spot. i can open it and see the code but when i run it, i get back "file not found". any ideas what i'm doing wrong? i have the latest version of raspberian - 2018. thanks

piborg's picture

Does it work if you use the full path like this: sudo ~/diddyborg/diddyWeb.py

Hi,

When running the script diddy2Web.py I get the following error:
Found ThunderBorg at 15
...
Press CTRL+C to terminate the web-server
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 552, in __bootstrap_inner
self.run()
File "./diddy2Web.py", line 119, in run
retval, thisFrame = cv2.imencode('.jpg', flippedArray, [cv2.IMWRITE_JPEG_QUALITY, jpegQuality])
SystemError: error return without exception set

What is wrong here?

piborg's picture

This is not an error we have seen before, but it seems like it might be a problem with the Python library for OpenCV (source here).

It might be possible to fix the issue by ensuring that the cv2.IMWRITE_JPEG_QUALITY is actually the correct type before calling the cv2.imencode function.

Look for this line in the diddy2Web.py script:

retval, thisFrame = cv2.imencode('.jpg', flippedArray, [cv2.IMWRITE_JPEG_QUALITY, jpegQuality])

and change it to match this version instead:

retval, thisFrame = cv2.imencode('.jpg', flippedArray, [int(cv2.IMWRITE_JPEG_QUALITY), jpegQuality])

Hopefully that will get the Web UI working for you :)

It works, thanks :-)

Hey there,
i have Problem, i need Help !!!!

""Failed to open port 80
Make sure you are running the script with sudo permissions
Other problems include running another script with the same port
If the script was just working recently try waiting a minute first
"""
Thanks

Hey there,
i have Problem, i need Help !!!!

""Failed to open port 80
Make sure you are running the script with sudo permissions
Other problems include running another script with the same port
If the script was just working recently try waiting a minute first
"""
Thanks

Loading ThunderBorg on bus 1, address 15
Found ThunderBorg at 15
ThunderBorg loaded on bus 1
Setup camera
Setup the stream processing thread
Wait ...
Setup the watchdog
Start the stream using the video port

Failed to open port 80
Make sure you are running the script with sudo permissions
Other problems include running another script with the same port
If the script was just working recently try waiting a minute first

Press CTRL+C to terminate the web-server
Motors off
Exception in thread Thread-2:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
self.run()
File "./diddy2Web.py", line 142, in run
camera.capture_sequence(self.TriggerStream(), format='bgr', use_video_port=True)
File "/usr/lib/python2.7/dist-packages/picamera/camera.py", line 1518, in capture_sequence
encoder.start(outputs)
File "/usr/lib/python2.7/dist-packages/picamera/encoders.py", line 1166, in start
super(PiRawImageMixin, self).start(output)
File "/usr/lib/python2.7/dist-packages/picamera/encoders.py", line 375, in start
self._open_output(output)
File "/usr/lib/python2.7/dist-packages/picamera/encoders.py", line 1041, in _open_output
self._next_output(key)
File "/usr/lib/python2.7/dist-packages/picamera/encoders.py", line 1201, in _next_output
super(PiRawMultiImageEncoder, self)._next_output(key)
File "/usr/lib/python2.7/dist-packages/picamera/encoders.py", line 1049, in _next_output
super(PiMultiImageEncoder, self)._open_output(next(self._output_iter), key)
StopIteration

Web-server terminated.

piborg's picture

The first error means that the script cannot open port 80. The most likely cause is that you need to run the script using sudo, for example:
sudo ./diddy2Web.py

The camera error is because the script failed the first time. You can fix it by restarting the Raspberry Pi.

Subscribe to Comments for "Web Gui error"