Greetings,
I’m new. I’m a novice, too. Pi5 + picar-x ai cam. I’ve followed the sunfounder tutorials, but have run into serious problems.
So, I’ve already done a new image and reinstall which came back to the same issue. As I’ve gone through the python tutorials, I hit a wall when I run example 7 with the camera. My first install, I actually had my controller app connect and fail to work with the camera. Anyways, I saw this forum thread…
There seems to be typos causing some troubles in the code. I checked my picarx.py file and found the same “_flie” error. Fixing the 3-4 typos in that file didn’t make the core problem go away in itself. I am not sure exactly what the next steps are here.
I need help.
I’m eager to both get the camera working and also see the sunfounder app work properly, so that I can move onto new projects. Any tips?
Here’s the log from running ~/picar-x//example/7.display.py
sudo python3 7.display.py
vilib 0.3.9 launching ...
picamera2 0.3.22
Local display failed, because there is no gui.
Web display on:
http://192.168.1.22:9000/mjpg
Starting web streaming ...
Input key to call the function!
q: Take photo
1: Color detect : red
2: Color detect : orange
3: Color detect : yellow
4: Color detect : green
5: Color detect : blue
6: Color detect : purple
0: Switch off Color detect
r: Scan the QR code
f: Switch ON/OFF face detect
s: Display detected object information
* Serving Flask app 'vilib.vilib'
* Debug mode: off
[1:08:28.344452443] [2811] ERROR RPI pipeline_base.cpp:1364 Camera frontend has timed out!
[1:08:28.344475016] [2811] ERROR RPI pipeline_base.cpp:1365 Please check that your camera sensor connector is attached securely.
[1:08:28.344480979] [2811] ERROR RPI pipeline_base.cpp:1366 Alternatively, try another cable and/or sensor.
Error on request:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/werkzeug/serving.py", line 335, in run_wsgi
execute(self.server.app)
File "/usr/lib/python3/dist-packages/werkzeug/serving.py", line 324, in execute
for data in application_iter:
File "/usr/lib/python3/dist-packages/werkzeug/wsgi.py", line 500, in __next__
return self._next()
^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/werkzeug/wrappers/response.py", line 50, in _iter_encoded
for item in iterable:
File "/usr/local/lib/python3.11/dist-packages/vilib-0.3.9-py3.11.egg/vilib/vilib.py", line 88, in gen
frame = get_frame()
^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/vilib-0.3.9-py3.11.egg/vilib/vilib.py", line 70, in get_frame
return cv2.imencode('.jpg', Vilib.flask_img)[1].tobytes()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
cv2.error: OpenCV(4.10.0) :-1: error: (-5:Bad argument) in function 'imencode'
> Overload resolution failed:
> - img is not a numpy array, neither a scalar
> - Expected Ptr<cv::UMat> for argument 'img'
Traceback (most recent call last):
File "/home/FigBot/picar-x/example/7.display.py", line 134, in <module>
main()
File "/home/FigBot/picar-x/example/7.display.py", line 94, in main
key = readchar.readkey()
^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/readchar/_posix_read.py", line 37, in readkey
raise KeyboardInterrupt