Raspberry Pi 3B+: Camera V1.3 is not working - camera

My goal is to make pictures with a simple Python3 (OpenCV) script.
The problem is that the camera can not be used by all the tools I have tried. But it shows up at "/dev/video".
My hardware is:
Raspberry Pi 3 B+
Raspberry Pi camera V1.3 (same issue with V2.1) (they are both working on a Jetson Nano/Raspi4)
This is my setup:
Installation of the Raspberry Pi OS Full (released: 2021-10-30)
Activation of these interfaces in the Raspi-Config: Camera, SSH, VNC, I2C
Checks, if the camera is found/working
I tried the follwing things (those are not the all of them):
libcamera-hello Main errors: "libEGL warning: DRI2: failed to authenticate" and "what(): failed to import fd 21"
raspistill/raspivid (I reinstalled it) Error: "mmal: mmal_vc_component_create: failed to create component 'vc.ril.camera' (1:ENOMEM)"
changing the driver in the "/boot/config.txt" file (ov5647, imx219, vc4-fkms-v3d, vc4-kms-v3)
vcgencmd get_camera Output: "supported=0 detected=0"
I stopped VNC, because someone had a similar problem and was able to fix it by stopping VNC.
I did a lot of research (~10h) and trial and error. But was not able to get any picture out of the camera.

Try:
libcamera-hello --qt-preview
I think that while using VNC or remote desktop the HW acceleration is not enabled. Also try to enable glamor HW acceleration

Make sure you are trying a very basic example such as this one:
import cv2
vid = cv2.VideoCapture(0)
while(True):
ret, frame = vid.read()
cv2.imshow('frame', frame)
if cv2.waitKey(1) & 0xFF == ord('q'):
break
vid.release()
cv2.destroyAllWindows()
To make that work you need to run the program as admin (e.g., sudo python test.py). Then report back the error messages you get.

Related

N210 not recognized under gnuradio

I have an ETTUS Research N210 software defined radio (SDR) connected to my laptop. The device is recognized under macos and also under an Ubuntu on top of a virtual box. These commands:
uhd_usrp_probe --args=addr=192.168.10.2
and
uhd_find_devices --args=addr=192.168.10.2
and even
rx_ascii_art_dft --args=addr=192.168.10.2 --freq 92000000 --gain 30 --rate 8000000 --frame-rate 15 --ref-lvl -50 --dyn-rng 70
work perfectly and deliver results. But whenever I start the gnuradio-companion with a simple flow graph, I get the following error (BOTH directly under macos and on top of VirtualBox Ubuntu):
[ERROR] [UHD] Device discovery error: unknown key format 192.168.10.2
Runtime
RuntimeError: LookupError: KeyError: No devices found for ----->
Device Address: 192.168.10.2
In the flow graph, I put the device address in the properties window of "USRP Source--> General --> Device Address".
Any ideas what I am doing wrong?
I finally found the solution in one of the replies in ETTUS forum. So I put it here in the hope it can be useful for others facing the same problem. The device address field of the USRP source in gnuradio-companion should not be filled with just "192.168.10.2" but with "addr=192.168.10.2". This solved the problem for me.

install proxmox from usb device error

I try to install Proxmox using a USB, and when I click to install, I see the next error:
testing cdrom /dev/sr0
umount: can't umount /mnt: Invalid argument
testing again in 5 seconds
Finally:
no cdrom found - unable to continue (type exit or CTRL-D to reboot)
I prepare the USB using ImageUSB in Windows, and it does have the previous fail, then I try to prepare in Ubuntu using dd if=pve-cd.iso of=/dev/XYZ bs=1M, I don't know where is the problem.
For someone out there still having similar issue, use below method to create the installation media. That should help.
Instructions for Windows
Download Etcher from https://etcher.io , select the ISO and your USB Drive.
If this doesn’t work, alternatively use the OSForensics USB installer from http://www.osforensics.com/portability.html
Instructions for GNU/Linux
You can simply use dd on UNIX like systems. First download the ISO image, then plug in the USB stick. You need to find out what device name gets assigned to the USB stick (see below). Then run:
dd if=proxmox-ve_*.iso of=/dev/XYZ bs=1M
Note: Be sure to replace /dev/XYZ with the correct device name.
Caution: Be very careful, and do not overwrite the hard disk!
Instructions from: https://pve.proxmox.com/wiki/Install_from_USB_Stick

Kinect / Primesense (Xtion) ROS Ubuntu through Virtual Machine (VMware)

Since it took me quite some time to figure out how to get Xtion (Primesense) to work on VMware I thought to share it here with you. (with Kinect I have a problem to let ROS see the device even though VMware has successfully connected it).
roslaunch openni2_launch openni2.launch
Running the above command gave me the error:
Warning: USB events thread - failed to set priority. This might cause loss of data...
I either got a single frame or no frame when running "rviz" and Add --> Image --> Image topic --> /camera/rgb/image_raw
So how do I get video frames in Ubuntu from a Primesense device while using a Virtual Machine (VMware)?
My specs
Windows 7 running VMware 10.0.4 build-2249910
Ubuntu 12.04.5 Precise in VMware
ROS Hydro
The following question pointed me in the right direction: http://answers.ros.org/question/77651/asus-xtion-on-usb-30-ros-hydro-ubuntu-1210/?answer=143206#post-id-143206
In the answer of blizzardroi (not selected answer) he/she mentions that USBInterface should be 0. I reasoned that since my main Machine is Windows, I should set UsbInterface to 1, which indeed solved it.
Solution
Go to /etc/openni2/ (from system folder, not Home) and open PS1080.ini with administrator rights (e.g. sudo gedit PS1080.ini). Search for UsbInterface, remove the ; and change the value to 1. It should look like below:
; USB interface to be used. 0 - FW Default, 1 - ISO endpoints (default on Windows), 2 - BULK endpoints (default on Linux/Mac/Android machines)
UsbInterface=1
Additional
From previous experience it may also be related that your Windows system may need the kinect drivers as well. If the above not works, try to install the following:
(Kinect SDK) https://www.microsoft.com/en-us/download/details.aspx?id=34808
(OpenNI2 Windows) http://structure.io/openni
p.s. Don't forget your drivers for Ubuntu (replace hydro with your ROS version)
sudo apt-get install ros-hydro-openni*
Important
It doesn't solve the error below, but rviz returns video, which means that we can read the data the Primesense device publishes!
Warning: USB events thread - failed to set priority. This might cause loss of data...
Got the same warning from opennni (issued at start by a binary located at Tools/PSLinkConsole) with another sensor.
Solved by starting process as sudo - my guess: to set priority to USB event threads you need root access. :)

Debian Camera isn't working

I have never before worked in Debian environment. I have some problem with camera, I was looking for answers but find nothing.
I am working in virtualbox, the camera is plugged through virtualbox. I am using is my laptop webcam, Lenovo EasyCamera. When I lauch program, for example cheese, I get this message :
jakub#debian:~$ cheese
OpenGL Warning: crPixelCopy3D: simply crMemcpy'ing from srcPtr to dstPtr
(cheese:3368): Gtk-WARNING **: Attempting to add a widget with type GtkImage to a GtkToggleButton, but as a GtkBin subclass a GtkToggleButton can only contain one widget at a time; it already contains a widget of type GtkLabel
libv4l2: error turning on stream: Brak miejsca na urządzeniu
** (cheese:3368): WARNING **: Error starting streaming on device '/dev/video0'.
** (cheese:3368): WARNING **: Could not negotiate format
When cheese is working, the diode from the cam is on, so camera is working, but why Debian cannot show me the image.
I hope you will know what to do. I appreciate your help.
It appears to be the same as this issue:
libv4l2: error turning on stream: No space left on device
You probably need to enable USB 2.0 in your virtual machine and pass the device into your guest OS using a high-speed USB host controller (EHCI).
You may need the VirtualBox Extension Pack, I remember it being required for USB 2.0 in the past. I can't find any current information about that, though, perhaps EHCI support is now included already.

Raspberry Pi - Audio Fails After Adding RTC

I have a Raspberry Pi that I'm trying to hook-up to walkie-talkies to announce the current time every half hour plus different status updates automatically.
I had a CRON job running mpg123 that was announcing the time over the walkies perfectly, but then when I installed the drivers for this RasClock module as specified here (https://www.modmypi.com/blog/installing-the-rasclock-raspberry-pi-real-time-clock), all audio stopped working.
speaker-test says:
speaker-test 1.0.25
Playback device is default
Stream parameters are 48000Hz, S16_LE, 1 channels
Using 16 octaves of pink noise
Playback open error: -1,Operation not permitted
and mpg123 says:
[module.c:142] error: Failed to open module jack: file not found
[module.c:142] error: Failed to open module portaudio: file not found
[pulse.c:84] error: Failed to open pulse audio output: Connection refused
[nas.c:220] error: could not open default NAS server
[module.c:142] error: Failed to open module openal: file not found
[audio.c:180] error: Unable to find a working output module in this list: alsa,oss,jack,portaudio,pulse,nas,openal
[audio.c:532] error: Failed to open audio output module
[mpg123.c:897] error: Failed to initialize output, goodbye.
Now, the machine tends to freeze up a lot, too. When I tried suggestions I found online, such as adding "LD_LIBRARY_PATH=/usr/lib/mpg123" or "export LD_LIBRARY_PATH=/usr/lib:/usr/lib/mpg123" before the command, it made no difference.
What little hair I have left thanks you in advance for helping me through this.
I had the same error message with mpg123.
Before this message, I installed all these packages: mysql-server, build-essential, libmysqlclient-dev, libapache2-mod-wsgi.
I also changed group:
# usermod -G anothergroup pi
One of these two manipulations have caused my problem.
The solution in my case ?
Go in the /etc/group file and modify the line beginning with "audio" from this...
audio:x:NN:
to that...
audio:x:NN:pi
N.B.: NN is the GID. pi is the Raspberry Pi's default username.
To achieve the same result, there is also this command :
# usermod -a -G audio pi
Log out from your session and log in again.
P.S.: Could somebody add the mpg123 tag because I spent a lot of time without finding this topic, as I have exactly the same problem with mpg123 ?
I had the same issue run this command should fix it modprobe snd_bcm2835