Linux UVC모듈과 호환되는 USB 카메라 검색

http://www.ideasonboard.org/uvc/



패키지 설치하기

Yocto 리눅스의 패키지 매니저에 UVC드라이버 등 패키지를 추가한다.


/etc/opkg/base-feeds.conf


src/gz all http://repo.opkg.net/edison/repo/all
src/gz edison http://repo.opkg.net/edison/repo/edison
src/gz core2-32 http://repo.opkg.net/edison/repo/core2-32

Update opkg:

opkg update

If the update is successful, the output should look like this:

Downloading http://repo.opkg.net/edison/repo/all/Packages.gz.
Inflating http://repo.opkg.net/edison/repo/all/Packages.gz.
Updated list of available packages in /var/lib/opkg/all.
Downloading http://repo.opkg.net/edison/repo/edison/Packages.gz.
Inflating http://repo.opkg.net/edison/repo/edison/Packages.gz.
Updated list of available packages in /var/lib/opkg/edison.
Downloading http://repo.opkg.net/edison/repo/core2-32/Packages.gz.
Inflating http://repo.opkg.net/edison/repo/core2-32/Packages.gz.
Updated list of available packages in /var/lib/opkg/core2-32.
Downloading http://iotdk.intel.com/repos/2.0/intelgalactic/Packages.
Updated list of available packages in /var/lib/opkg/iotkit.

Cloning this repository onto Edison

To install git:

opkg install git
Installing git (2.0.1-r0) on root.
Downloading http://repo.opkg.net/edison/repo/core2-32/git_2.0.1-r0_core2-32.ipk.
Configuring git.

다음을 실행하여 Repository를 클로닝(복제) 한다. git clone https://github.com/drejkim/edi-cam.

Cloning into 'edi-cam'...
remote: Counting objects: 93, done.
remote: Total 93 (delta 0), reused 0 (delta 0), pack-reused 93
Unpacking objects: 100% (93/93), done.
Checking connectivity... done.

Installing the UVC driver

Older versions of the Edison Yocto image do not contain the UVC driver. To check whether or not the UVC driver is installed, type the following:

find /lib/modules/* -name 'uvc'

If the UVC driver is installed, the output should look something like this:

/lib/modules/3.10.17-poky-edison+/kernel/drivers/media/usb/uvc

If nothing is returned, the UVC driver needs to be installed:

opkg install kernel-module-uvcvideo

To make sure the UVC driver is loaded and the webcam is detected properly, plug in your webcam,

 then type lsmod | grep uvc:

root@myedison:~# lsmod | grep uvc
uvcvideo               71516  0
videobuf2_vmalloc      13003  1 uvcvideo
videobuf2_core         37707  1 uvcvideo

Also, verify that the video device node has been created by typing ls -l /dev/video0:

root@myedison:~# ls -l /dev/video0
crw-rw----    1 root     video      81,   0 Nov 10 15:57 /dev/video0

I

Installing ffmpeg

To install ffmpeg:

edi-cam 으로 이동

cd /edi-cam
  •  bin. 폴더로 이동한다.
  • Type ./install_ffmpeg.sh to run the shell script.
  • Creating ~/bin directory if it doesn't exist...
    Removing old versions of ffmpeg...
    Downloading ffmpeg...
    --2016-02-11 08:12:53--  http://johnvansickle.com/ffmpeg/releases/ffmpeg-release-32bit-static.tar.xz
    Resolving johnvansickle.com... 199.79.62.21
    Connecting to johnvansickle.com|199.79.62.21|:80... connected.
    HTTP request sent, awaiting response... 200 OK
    Length: 14387580 (14M) [application/x-tar]
    Saving to: '/home/root/bin/ffmpeg-release-32bit-static.tar.xz'
    
    100%[======================================>] 14,387,580   922KB/s   in 30s
    
    2016-02-11 08:13:27 (472 KB/s) - '/home/root/bin/ffmpeg-release-32bit-static.tar.xz' saved [14387580/14387580]
    
    Unpacking...
    Cleaning up...

If the download doesn't work, the release link may have changed. Check here, copy the address of the latest release, and replace in the shell script.

Installing Node.js packages

  • Navigate to web/server.
  • Install the Node.js packages by typing npm install.

Running the demo

Updating the WebSocket address

Modify wsUrl in web/client/index.html. The section of the code looks like this:

// CHANGE THIS TO THE APPROPRIATE WS ADDRESS
var wsUrl = 'ws://myedison.local:8084/';

Replace myedison with the name of your Edison.

Running the Node.js server

  • Navigate to web/server.
  • Run the server by typing node server.js.

The Node.js server should now be running. The console will look something like this:

WebSocket server listening on port 8084
HTTP server listening on port 8080
Listening for video stream on port 8082
Stream Connected: 127.0.0.1:52995 size: 320x240

Viewing the video stream

Open a browser window and navigate to http://myedison.local:8080, where myedison is the name of your Edison. You should now see the video stream from your webcam!

'ROBOTICS > Intel Edison' 카테고리의 다른 글

Intel Edison에 고정 IP 할당하기  (0) 2016.06.07
Socket통신으로 웹에서 LED제어하기  (0) 2016.02.12
소켓통신을 통해 웹에서 입력받기  (0) 2016.02.11
Wifi 설정하기  (0) 2016.02.11

+ Recent posts