Cannot detect camera when using raspberry pi 4

I am attempting to connect my raspberry pi using a v2.1 cam to edge impulse for the purpose of image detection. When I do so I get the error

pi@raspberrypi:~ $ edge-impulse-linux
Edge Impulse Linux client v1.3.5

[SER] Using microphone hw:1,0
Failed to initialize linux tool Error: Cannot find any webcams, run this command with --disable-camera to skip selection
at /usr/lib/node_modules/edge-impulse-linux/build/cli/linux/linux.js:435:23
at processTicksAndRejections (internal/process/task_queues.js:97:5)

I have looked through several of the fourm posts and tutorials and have been unable to find a solution please help.

Thanks

3 Likes

Hi @Maen.aa,

It sounds like your Raspberry Pi cannot communicate with the camera. I recommend checking the wiring or cable to make sure it is firmly attached to the Pi. Then, try running the command:

raspistill -o ~/Downloads/image.jpg

This should open a viewer, snap a photo, and save the image in your Downloads folder.

I am able to capture images. The problem is not the connection to the camera itself. Other ideas?

did you get the solution for this. same problem for me also

2 Likes

Same issue here… only way I can capture images from my raspberry pi to the edge impulse client is through the webclient.

Hi all,

Can you provide me with the project ID and tell me what cameras you are attempting to use? Is it all the Pi Cam v2.1?

I also had a similar problem with the Pi4 and V2 Camera. If you can take images using the command “rapstill -o …” then edit the dtoverlay parameter to imx219 in /boot/config.txt . That is, dtoverlay=imx219 . This is the required value for the V2 camera module from the documentation: Raspberry Pi Documentation - Camera

Hope this helps :+1:

3 Likes

Yes, it works now.
Thank you!

1 Like

hello, i am new to rpi and dont understand how to actually change dtoverlay to dtoverlay=imx219. can you explain how to do so please?

dtoverlay parameter is being edited in the /boot/config.txt file. This is a configuration file used by the Raspberry Pi’s boot loader to set various parameters and options for the system.

By setting the dtoverlay parameter to “imx219”, the system is configured to use the camera module that is based on the Sony IMX219 sensor. This allows the Raspberry Pi to interface with the camera and capture images or video using the camera module.

So to solve this you must find the config.txt file in the boot folder and edit it.

Hello @marabc, if you have accessed the Raspberry Pi remotely say via SSH then you can enter the following commands, after logging in, to access the config.txt file. If you are using a GUI to access the Raspberry Pi then you can open the Terminal application and run the commands.

  1. open the config.txt file by running the following command on the Terminal or Command prompt
    sudo nano /boot/config.txt

  2. scroll down and find the line that starts with dtoverlay=

  3. edit the line to say dtoverlay=imx219

  4. Save the file and exit the file: press Ctrl+X on your keyboard and you will be asked if you want to save the file and you should press Y on your keyboard. Lastly press Enter

  5. Lastly reboot the Raspberry Pi by entering the following command:
    sudo reboot

2 Likes

If I may say so, it should not be replaced dtoverlay=vc4-fkms-v3d by dtoverlay=imx219
but add the line dtoverlay=imx219.
indeed, deleting the dtoverlay=vc4-fkms-v3d line blocks the startup of the PI

1 Like

Well, it appears as you’re right @BARROIS - I’m stuck in a boot loop. Wish I would have scrolled down a bit further before I edited my config.txt (btw, mine was moved to /boot/firmware/config.txt). Any advice on how to fix?

Figured out that I was able to take the SD card out, put it in a reader on my other computer and access the config.txt file and add the line back in. I’m able to boot back up, but edge-impulse-linux is still unable to find any webcams :frowning: so, back to the drawing board…

Open the SD card under Windows/Linux/MAC and modify the config.txt “by hand”…
This is what I had to do, but I didn’t go any further.

test :