Sunday, 07 July 2013 15:40

TP-LINK TL-MR3020 + OPENWRT + WEBCAM

This project uses an inexpensive TP-LINK TL-MR3020 Portable 3G/4G Wireless N Router with an Linux UVC supported camera to create an IP Camera that can be placed in a good location for surveillance.
 

Prerequisites

 
 
 

Installing pacakges for OpenWRT

  • Make sure you have Internet connection
  • SSH to the router
  • Install the following packages

opkg update
opkg install kmod-video-uvc
opkg install mjpg-streamer
It should look like this

[email protected]:~# opkg update
Downloading http://downloads.openwrt.org/attitude_adjustment/12.09-rc1/ar71xx/neric/packages/Packages.gz.
Inflating http://downloads.openwrt.org/attitude_adjustment/12.09-rc1/ar71xx/geric/packages/Packages.gz.
Updated list of available packages in /var/opkg-lists/attitude_adjustment.
[email protected]:~# opkg install kmod-video-uvc
Installing kmod-video-uvc (3.3.8-1) to root...
Downloading http://downloads.openwrt.org/attitude_adjustment/12.09-rc1/ar71xx/neric/packages/kmod-video-uvc_3.3.8-1_ar71xx.ipk.
Installing kmod-video-videobuf2 (3.3.8-1) to root...
Downloading http://downloads.openwrt.org/attitude_adjustment/12.09-rc1/ar71xx/neric/packages/kmod-video-videobuf2_3.3.8-1_ar71xx.ipk.
Installing kmod-video-core (3.3.8-1) to root...
Downloading http://downloads.openwrt.org/attitude_adjustment/12.09-rc1/ar71xx/neric/packages/kmod-video-core_3.3.8-1_ar71xx.ipk.
Installing kmod-i2c-core (3.3.8-1) to root...
Downloading http://downloads.openwrt.org/attitude_adjustment/12.09-rc1/ar71xx/neric/packages/kmod-i2c-core_3.3.8-1_ar71xx.ipk.
Installing kmod-input-core (3.3.8-1) to root...
Downloading http://downloads.openwrt.org/attitude_adjustment/12.09-rc1/ar71xx/neric/packages/kmod-input-core_3.3.8-1_ar71xx.ipk.
Configuring kmod-i2c-core.
Configuring kmod-video-core.
Configuring kmod-input-core.
Configuring kmod-video-videobuf2.
Configuring kmod-video-uvc.
[email protected]:~# opkg install mjpg-streamer
Installing mjpg-streamer (r148-4) to root...
Downloading http://downloads.openwrt.org/attitude_adjustment/12.09-rc1/ar71xx/neric/packages/mjpg-streamer_r148-4_ar71xx.ipk.
Installing libpthread (0.9.33.2-1) to root...
Downloading http://downloads.openwrt.org/attitude_adjustment/12.09-rc1/ar71xx/neric/packages/libpthread_0.9.33.2-1_ar71xx.ipk.
Installing libjpeg (6b-1) to root...
Downloading http://downloads.openwrt.org/attitude_adjustment/12.09-rc1/ar71xx/neric/packages/libjpeg_6b-1_ar71xx.ipk.
Configuring libjpeg.
Configuring libpthread.
Configuring mjpg-streamer.
[email protected]:~#

 
 
Check if drivers has been installed

[email protected]:~# dmesg | grep -i usb
[ 8.490000] usbcore: registered new interface driver usbfs
[ 8.490000] usbcore: registered new interface driver hub
[ 8.500000] usbcore: registered new device driver usb
[ 9.670000] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[ 9.680000] ehci-platform ehci-platform: new USB bus registered, assigned bus number 1
[ 9.740000] ehci-platform ehci-platform: USB 2.0 started, EHCI 1.00
[ 9.740000] hub 1-0:1.0: USB hub found
[ 10.000000] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[ 10.070000] usb 1-1: new high-speed USB device number 2 using ehci-platform
[ 10.230000] hub 1-1:1.0: USB hub found
[ 10.510000] usb 1-1.4: new full-speed USB device number 3 using ehci-platform
[ 348.190000] usbcore: registered new interface driver uvcvideo
[ 348.190000] USB Video Class driver (1.1.1)
[ 517.550000] usb 1-1.2: new high-speed USB device number 4 using ehci-platform
[ 517.690000] input: Microsoft?? LifeCam HD-5000 as /devices/platform/ehci-platform/usb1/1-1/1-1.2/1-1.2:1.0/input/input0
[ 771.450000] usb 1-1.2: USB disconnect, device number 4
[ 774.120000] usb 1-1: USB disconnect, device number 2
[ 774.120000] usb 1-1.4: USB disconnect, device number 3
[ 777.500000] usb 1-1: new high-speed USB device number 5 using ehci-platform
[ 777.680000] input: Microsoft LifeCam HD-5000 as /devices/platform/ehci-platform/usb1/1-1/1-1:1.0/input/input1
[email protected]:~#

 
 
 

Enable video streaming

Video streaming is diabled by default. To enable video streaming, edit /etc/config/mjpg-streamer and change option enabled "0" to option enabled "1" 
Note: Microsoft LifeCam HD-5000 support resolution up to 1280x720,  I'm using option resolution "1280x720" for my case. 

config mjpg-streamer core
         option enabled "1"
         option device "/dev/video0"
         option resolution "640x480"
         option fps "5"
         option www "/www/webcam"
         option port "8080"

Restart the router, you are ready to stream the video.
 
  • start on boot
    /etc/init.d/mjpg-streamer enable
  • start mjpg-streamer right now
    /etc/init.d/mjpg-streamer start
  • Stop mjgp-streamer
    /etc/init.d/mjpg-streamer stop
 

Nanavigate to http://192.168.1.1:8080, you should see the following screen

About M-JPEG streamer
 
More command to stream the video
  • http://192.168.1.1:8080/?action=snapshot
  •  http://192.168.1.1:8080/?action=stream
 

Show Date and Time on top of video

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head>

<script>
   setInterval(function(){showDateTime()},500); //run showDateTime function every 500ms
   function showDateTime() {
      document.getElementById("dateNow").innerHTML = new Date().toDateString();
      document.getElementById("timeNow").innerHTML = new Date().toLocaleTimeString();
   }
</script>

<style type="text/css">
div.dateTime
{
   position: fixed;
   top: 10px;
   left: 10px;
}
</style>
</head>

<!-- show video from camera, please use your own router IP & port -->
<div class="img">
   <a target="_parent"><img src="http://192.168.0.1:8080/?action=stream"></a>
</div>
<div class="dateTime">
   <div id="dateNow">Show the date</div>
   <div id="timeNow">Show the time</div>
</div>
</body></html>
 

Manage dynamic controls in uvcvideo

  • Listing available controls for device video
    opkg install uvcdynctrl
    uvcdynctrl -c
  • Disable auto focus
    uvcdynctrl --set='Focus, Auto' 0
  • Enable auto focus 
    uvcdynctrl --set='Focus, Auto'
 
Read here for more about TL-WR1043ND+OpenWRT+Webcam 
 
 
Read 58923 times Last modified on Sunday, 12 June 2016 10:43

7 comments

  • Comment Link Stevambums Thursday, 21 November 2019 22:20 posted by Stevambums

    Generic Propecia Price cialis 5mg Amoxicillin 21 Levitra 8 Compresse

  • Comment Link WilliamVed Monday, 18 November 2019 04:58 posted by WilliamVed




    918indo_13102019
    ANSI
    RobertCom
    RobertComYR
    $aptK7k1y7K
    [email protected]
    GDLVDNU622
    [email protected]
    pop.gmail.com

    124456847
    Maputo
    Mozambique
    Service
    Cycling



    0













    áèçíåñ
    äîñóã
    îáúÿâ
    êóðèëêà
    ôëåéì
    ôëýéì
    îñíîâí
    ðàçâëå÷
    îôôòîïèê
    îôòîïèê
    îôô-òîïèê
    ïðî÷åå
    ðàçíîå
    îáî âñ¸ì
    flood
    flame
    stuff
    blah
    off-topic
    off topic
    offtopic
    oftopic
    general
    common
    business
    îáùà
    îáùèé
    îáùåå
    îáùèå
    ðåêëàì
    adver
    false

  • Comment Link NeooSUM Saturday, 16 November 2019 21:41 posted by NeooSUM

    Здесь вы можете заказать копию любого сайта под ключ, недорого и качественно, при этом не тратя свое время на различные программы и фриланс-сервисы.

    Клонированию подлежат сайты как на конструкторах, так и на движках:
    - Tilda (Тильда)
    - Wix (Викс)
    - Joomla (Джумла)
    - Wordpress (Вордпресс)
    - Bitrix (Битрикс)
    и т.д.
    телефон 8-996-725-20-75 звоните пишите viber watsapp
    Копируются не только одностраничные сайты на подобии Landing Page, но и многостраничные. Создается полная копия сайта и настраиваются формы для отправки заявок и сообщений. Кроме того, подключается админка (админ панель), позволяющая редактировать код сайта, изменять текст, загружать изображения и документы.

    Здесь вы получите весь комплекс услуг по копированию, разработке и продвижению сайта в Яндексе и Google.

    Хотите узнать сколько стоит сделать копию сайта?
    напишите нам
    8-996-725-20-75 звоните пишите viber watsapp

  • Comment Link admin Monday, 15 August 2016 22:27 posted by admin

    Logitech C910 is a UVC supported camera. The installation is same as the Microsoft LifeCam HD-5000. I have another article regarding webcam on OpenWrt router.
    http://ediy.com.my/blog/item/33-tp-link-tl-wr1043nd-router-web-cam-ip-cam

  • Comment Link zhamest Sunday, 14 August 2016 17:23 posted by zhamest

    Any one can help me give me a bin image because im confused setting Openwrt MR3040 v1 to make MJPG Streamer with Logitech C910

    Many Thanks

  • Comment Link admin Thursday, 05 May 2016 19:15 posted by admin

    I think it should be possible, please read this blog post.
    http://sheldor.blogspot.my/2013/09/openwrt-based-video-recording-system_10.html

  • Comment Link dika Thursday, 05 May 2016 13:35 posted by dika

    Hi..
    thanks for sharing. But i wonder, can we record the streaming-video and save it to usb stick?
    Many thanks

Leave a comment

Back to Top