View: 508|Reply: 6

PiCar Pro - Camera issue while running webServer.py

[Copy link]

1

Threads

2

Posts

7

Credits

Newbie

Rank: 1

Credits
7
Post time 2021-3-22 02:03:15 | Show all posts |Read mode
Hi,

Post installation when I tested pi-cam with Adeept robot HAT and Raspberry Pi 4 (running webServer.py) it worked perfectly fine.
But
When I plugged all servos, motors, ultrasonic and tracking components and re-run webServer.py, I am getting below error with camera.

Can you please help!

Error:
VIDEOIO ERROR: V4L2: Pixel format of incoming image is unsupported by OpenCV
Unable to stop the stream: Device or resource busy
VIDEOIO ERROR: V4L: can't open camera by index 0


Terminal Log:
---------------------------------------------------------------------------------------------------------------------------------------------------------------
pi:~ $ sudo python3 Robot/adeept_picarpro/server/webServer.py
......................pause..........................
mpu6050 connected, PT MODE ON
......................pause..........................
Starting camera thread.
VIDEOIO ERROR: V4L2: Pixel format of incoming image is unsupported by OpenCV
Unable to stop the stream: Device or resource busy
VIDEOIO ERROR: V4L: can't open camera by index 0
Exception in thread Thread-3:

Traceback (most recent call last):
  File "/usr/lib/python3.7/threading.py", line 917, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.7/threading.py", line 865, in run
    self._target(*self._args, **self._kwargs)
  File "/home/pi/Robot/adeept_picarpro/server/base_camera.py", line 94, in _thread
    for frame in frames_iterator:
  File "/home/pi/Robot/adeept_picarpro/server/camera_opencv.py", line 423, in frames
    raise RuntimeError('Could not start camera.')
RuntimeError: Could not start camera.


Reply

Use magic Report

1

Threads

11

Posts

37

Credits

Newbie

Rank: 1

Credits
37
Post time 2021-5-7 10:24:27 From the mobile phone | Show all posts
Could not start camera: there is no connection between pi and camera, so script stops. You might have either damaged the camera ribbon while rebuilding the board, or the cable sits loose in a connector (either on you board or on camera module) these ribbons are very fragile
Reply

Use magic Report

0

Threads

1

Posts

4

Credits

Newbie

Rank: 1

Credits
4
Post time 2021-6-2 00:25:41 | Show all posts
Was this issue resolved?
Reply

Use magic Report

0

Threads

3

Posts

10

Credits

Newbie

Rank: 1

Credits
10
Post time 2022-1-22 12:06:21 | Show all posts
Hey there, I'm having the same issue. I don't see any issues with the ribbon.
Reply

Use magic Report

0

Threads

3

Posts

10

Credits

Newbie

Rank: 1

Credits
10
Post time 2022-1-22 12:08:06 | Show all posts
Apparently, it's an error that's been popping up a lot on the Ubuntu forums.
Reply

Use magic Report

0

Threads

3

Posts

10

Credits

Newbie

Rank: 1

Credits
10
Post time 2022-1-22 12:27:30 | Show all posts
Odd, if I run `kill all python3` and then manually restart the wifi, it works (for the most part). I'm still having issues with alignment of the wheels.
Reply

Use magic Report

0

Threads

16

Posts

39

Credits

Administrator

Rank: 9Rank: 9Rank: 9

Credits
39
Post time 2022-5-5 17:43:59 | Show all posts
The Raspberry Pi will automatically run the program webServer.py when it is turned on. The webServer.py program will occupy the camera. If the program related to the camera is run again, the program will report an error. When you need to run the program manually, you need to stop the automatic running program.
On the Raspberry Pi command line enter:
sudo killall python3 (to abort the autorun program)
Reply

Use magic Report

You have to log in before you can reply Login | Sign Up

Points Rules