balena-labs-projects / balena-cam

Network Camera with Raspberry Pi and WebRTC. Tutorial:
https://balena.io/blog/build-a-raspberry-pi-based-network-camera/
MIT License
175 stars 78 forks source link

Capturing video from second camera on balenaFin #68

Closed Hegazi closed 4 years ago

Hegazi commented 4 years ago

I have enabled 'Dual camera mode' as per instructions for the balenaFin: https://www.balena.io/fin/1.1/docs/developers/#Dual-camera-mode I also changed the Fleet Configuration. I get the following output when switching cv2.VideoCapture(0) in server.py to cv2.VideoCapture(1) to get the feed of the second camera. Note: Works fine with main camera

 balena-cam  select timeout
 balena-cam  VIDIOC_DQBUF: Resource temporarily unavailable
 balena-cam  Failed to open default camera. Exiting...
 balena-cam  Video device is ready
 balena-cam  select timeout
 balena-cam  VIDIOC_DQBUF: Resource temporarily unavailable
 balena-cam  Failed to open default camera. Exiting...
Service exited 'balena-cam'
Restarting service 'balena-cam' 
mbalamat commented 4 years ago

Hi @Hegazi before running balena-cam can you check if there is a /dev/video1 device?

Hegazi commented 4 years ago

Running 'ls /dev/' I get video0, video1, video10, video11, video12.

mbalamat commented 4 years ago

@Hegazi sorry for the late reply for a quicker response we reply very quickly in our forums. Can you try running vcgencmd get_camera to see if the cameras are recognised. After that can you try to run raspistill -cs 1 -o image1.jpg to see if the camera that is connected to the second CSI port works and takes a picture?

Hegazi commented 4 years ago

@mbalamat I have posted on the forum right here:

Running vcgencmd get_camera I get:

supported=2 detected=2

Running raspistill -cs 1 -o image1.jpg I get:

mmal: mmal_vc_component_enable: failed to enable component: ENOSPC mmal: camera component couldn't be enabled mmal: main: Failed to create camera component mmal: Failed to run camera app. Please check for firmware updates

jellyfish-bot commented 4 years ago

[rahul-thakoor] This issue has attached support thread https://jel.ly.fish/#/9cab8786-b291-45bf-8d8c-90c53c9ead9d

rahul-thakoor commented 4 years ago

Have you also changed this line ?

mbalamat commented 4 years ago

@Hegazi since we are discussing this on the forums I'll close this. Feel free to re-open it if you need to.