pynq-webcam无法使用的问题

零.前言

最终我重新买了一个webcam解决了问题,以下是当时试图解决问题的流程,不具备高参考价值!

一.问题的阐述

xilinx@pynq:~$ fswebcam -S 10 image.jpg
--- Opening /dev/video0...
Trying source module v4l2...
Error opening device: /dev/video0
open: Permission denied
Trying source module v4l1...
Error opening device: /dev/video0
open: Permission denied
Unable to find a source module that can read /dev/video0.

xilinx@pynq:~$ fswebcam  -i 0 -d v4l2:/dev/video0  --no-banner  --jpeg 95  --save test.jpg
--- Opening v4l2:/dev/video0...
Error opening device: /dev/video0
open: Permission denied

拍照反正是 无权限或者找不到模块读video

二. 漫长的解决问题进程

我来好好研究下
首先参考这篇帖子
在这里插入图片描述
好吧,我先来解释下:dmesg 命令:

‘dmesg’命令设备故障的诊断是非常重要的。在‘dmesg’命令的帮助下进行硬件的连接或断开连接操作时,我们可以看到硬件的检测或者断开连接的信息。‘dmesg’命令在多数基于Linux和Unix的操作系统中都可以使用。

输入dmesg命令后
我找到关于uvcvideo的部分:

[    5.756284] uvcvideo: Found UVC 1.00 device USB Web Camera (1c4f:3000)
[    5.761536] uvcvideo: UVC non compliance - GET_DEF(PROBE) not supported. Enab                                                                                                             ling workaround.
[    5.762808] uvcvideo 1-1:1.0: Entity type for entity Processing 5 was not ini                                                                                                             tialized!
[    5.762823] uvcvideo 1-1:1.0: Entity type for entity Selector 4 was not initi                                                                                                             alized!
[    5.762833] uvcvideo 1-1:1.0: Entity type for entity Camera 1 was not initial                                                                                                             ized!
[    5.762842] uvcvideo 1-1:1.0: Entity type for entity Input 2 was not initiali                                                                                                             zed!
[    5.763825] input: USB Web Camera: USB Web Camera as /devices/soc0/amba/e0002                                                                                                             000.usb/ci_hdrc.0/usb1/1-1/1-1:1.0/input/input0
[    5.765366] usbcore: registered new interface driver uvcvideo
[ 1082.515781] uvcvideo: Failed to query (GET_DEF) UVC control 11 on unit 5: -32                                                                                                              (exp. 1).
[ 1082.558791] uvcvideo: Failed to query (GET_DEF) UVC control 11 on unit 5: -32                                                                                                              (exp. 1).
[ 1105.884833] uvcvideo: Failed to submit URB 0 (-28).
[ 1177.156943] uvcvideo: Failed to submit URB 0 (-28).
[ 1183.037075] uvcvideo: Failed to submit URB 0 (-28).
[ 2086.557614] uvcvideo: Failed to query (GET_DEF) UVC control 11 on unit 5: -32                                                                                                              (exp. 1).
[ 2086.585387] uvcvideo: Failed to submit URB 0 (-28).
[ 2177.027580] uvcvideo: Failed to query (GET_DEF) UVC control 11 on unit 5: -32                                                                                                              (exp. 1).
[ 2177.055342] uvcvideo: Failed to submit URB 0 (-28).
[ 3352.157378] uvcvideo: Failed to query (GET_DEF) UVC control 11 on unit 5: -32                                                                                                              (exp. 1).
[ 3352.185142] uvcvideo: Failed to submit URB 0 (-28).
[ 3368.999375] uvcvideo: Failed to query (GET_DEF) UVC control 11 on unit 5: -32                                                                                                              (exp. 1).
[ 6050.682868] uvcvideo: Failed to query (GET_DEF) UVC control 11 on unit 5: -32                                                                                                              (exp. 1).
[ 6134.656853] uvcvideo: Failed to query (GET_DEF) UVC control 11 on unit 5: -32                                                                                                              (exp. 1).
[ 6134.714172] uvcvideo: Failed to submit URB 0 (-28).

(*关于什么是uvc?参考:UVC (USB Video Class) 使用笔记 (转)

对以上输出信息进行阐述:
Found UVC 1.00 device USB Web Camera (1c4f:3000)
第一个 UVC 1.00 device USB Web Camera 的摄像头它的 VID:PID 是 1c4f:3000 ;

但是ls /dev/video*,却存在相应的信息

#输入
xilinx@pynq:~$ ls /dev/video*
#输出
/dev/video0

由于不清楚pynq的linux相关信息,将其列如下:

xilinx@pynq:~$ uname -srm   #指令,列出linux的内核版本号
Linux 4.14.0-xilinx-v2018.2 armv7l
xilinx@pynq:~$ hostnamectl  #指令,列出linux信息
   Static hostname: pynq
         Icon name: computer
        Machine ID: 568ab3dedab843beb1067cb4f9270281
           Boot ID: 3f48a5b29871449ea3113f67026a7d58
  Operating System: PynqLinux, based on Ubuntu 18.04
            Kernel: Linux 4.14.0-xilinx-v2018.2
      Architecture: arm

嗯,我发现还有好多问题需要去解决。
我需要另开一篇日志去写了,这篇日志只写主线任务
我又发现:
我按照此博文的方法

树莓派接入USB摄像头
https://blog.csdn.net/yjp19871013/article/details/80147803

查找到摄像头,我们可以使用fswebcam命令测试抓图:
$ sudo apt-get install fswebcam
$ fswebcam /dev/video0 ~/image.jpg

fswebcam安装了,但是第二个指令报错

##报错
xilinx@pynq:/$ fswebcam /dev/video0 ~/image.jpg
--- Opening /dev/video0...
Trying source module v4l2...
Error opening device: /dev/video0
open: Permission denied
Trying source module v4l1...
Error opening device: /dev/video0
open: Permission denied
Unable to find a source module that can read /dev/video0.

没办法,我只好安装luvcview

如果不满足于抓图,我们还可以看看摄像头的效果。只需要登录VNC,启动树莓派上的终端,使用luvcview即可:
$ sudo apt-get install luvcview
$ luvcview -s 1080x720

发现 无法安装

##无法安装
xilinx@pynq:~$ sudo apt-get install luvcview
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package luvcview

嗯,尝试换个源
参考:https://blog.csdn.net/qq_35451572/article/details/79516563
发现换了清华源阿里源都还是无法安装。外网能ping通
我再想办法吧
下面这篇博文需要看
Ubuntu上安装luvcview和打开USB摄像头全过程
https://blog.csdn.net/qq_44596345/article/details/88390562

其他参考:
对于Linux内核tty设备的一点理解:
http://blog.chinaunix.net/uid-20543672-id-3225777.html
Topic: Take picture with fswebcam [Solved] (Read 34868 times)
https://forum.arduino.cc/index.php?topic=253571.0
解决Linux中普通用户无权限访问串口设备问题
https://blog.csdn.net/u013992330/article/details/79102741
ubuntu下使用UVC摄像头
https://blog.csdn.net/xingyu19871124/article/details/5764954
Ubuntu16.04下用luvcview对摄像头功能调试(一)
https://blog.csdn.net/Lagrantaylor/article/details/96858585

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值