Showing posts with label Ubuntu. Show all posts
Showing posts with label Ubuntu. Show all posts

Sunday, October 20, 2019

TP-LINK TL-WR802N OpenWrt

I started using these instructions:
https://git.openwrt.org/?p=openwrt/openwrt.git;a=commit;h=e6f047fa368ca9c90691b93aa5e03068fe1f4178
However for the V4 I have they are wrong, the ip is actually 192.168.0.66 for the tftpd.
Also the filename tested that works is wr802nv1_tp_recovery.bin not tp_recovery.bin

Thanks to this person for the mentioning ip and filename changes:
http://wr802n.blogspot.com/2018/04/dd-wrt-install-on-tp-link-tl-wr802n.html

Tested with Ubuntu18.04 atftp server.

apt-get install atftpd
cp wr802nv1_tp_recovery.bin to /srv/tftpd
chown -R nobody /srv/tftpd
sudo atftpd -v --user nobody /srv/tftp --daemon --listen-local
tftp to 192.168.0.66 and issue a get wr802nv1_tp_recovery.bin to confirm tftp is operational
reset router with ethernet jack plugged into tftpd server, wait for it to download the firmware

wait for device to reboot, get dhcp from newly running openwrt
ssh root@192.168.1.1
Gets you OpenWrt 4.14.149 2019

opkg update doesn't work because I am connected over the thernet port and the wifi port isn't configured with internet

try to config wifi client to get inet
https://openwrt.org/docs/guide-user/network/wifi/connect_client_wifi
uci set wireless.@wifi-device[0].disabled="0"
uci commit wireless
wifi

confirm iw dev wlan0 scan returns list of aps and wifi is enabled

uci get network.wwan returns blank so set it

uci set network.wwan=wlan0
lets try this
http://h-wrt.com/en/mini-how-to/wifi_openwrt

editing the /etc/config/wireless and /etc/init.d/network got us wlan0 internet access!
now opkg update worked

opkg install luci works now!



Tuesday, July 5, 2016

zoneminder on 1001x eepc

Use built in camera: /usr/bin/mplayer tv:// -tv driver=v4l2:device=/dev/video0 -vo png -frames 10

Run this script in an area zoneminder can access the png files, the first few will be blank while the camera loads.  I take the 4th or 5th frame as a file type source in zoneminder, and have zone minder read that file into its db as a camera monitor, which creates events. 

#!/bin/bash
cd /var/www/html
while [ 1 ]
do
/usr/bin/mplayer tv:// -tv driver=v4l2:device=/dev/video0 -vo png -frames 10 > /dev/null 2>&1
sleep 10
done

I tried using zoneminder to detect the camera natively with some zmu commands but gave up and just wrote the above mplayer script to create png images.

Another method which worked with a usbcam which didn't seem to like mplayer was:

avconv -f video4linux2 -s 640x480 -i /dev/video0 -ss 0:0:2 -frames 1 out.jpg


References and other notes:

http://defectio.blogspot.com/2012/09/connecting-webcam-to-zoneminder.html

failed capture commands with the eepc:

# zmu -d /dev/video0 -q -v
Error, failed to enumerate standard 0: Connection timed out

another failed attempt at mplayer:
# mplayer tv:// -vo aa -monitorpixelaspect 0.5 -quiet
MPlayer2 2.0-728-g2c378c7-4 (C) 2000-2012 MPlayer Team
Cannot open file '/root/.mplayer/input.conf': No such file or directory
Failed to open /root/.mplayer/input.conf.
Cannot open file '/etc/mplayer/input.conf': No such file or directory
Failed to open /etc/mplayer/input.conf.

Playing tv://.
Detected file format: TV
Selected driver: v4l2
 name: Video 4 Linux 2 input
 author: Martin Olschewski <olschewski@zpr.uni-koeln.de>
 comment: first try, more to come ;-)
v4l2: your device driver does not support VIDIOC_G_STD ioctl, VIDIOC_G_PARM was used instead.
Selected device: USB 2.0 Camera
 Capabilities:  video capture  streaming
 supported norms:
 inputs: 0 = Camera 1;
 Current input: 0
 Current format: YUYV
tv.c: norm_from_string(pal): Bogus norm parameter, setting default.
v4l2: ioctl enum norm failed: Inappropriate ioctl for device
Error: Cannot set norm!
Selected input hasn't got a tuner!
v4l2: ioctl set mute failed: Invalid argument
Error opening/initializing the selected video_out (-vo) device.

v4l2: select timeout
v4l2: ioctl set mute failed: Invalid argument
v4l2: 0 frames successfully processed, 1 frames dropped.

Exiting... (End of file)

#  v4l2-ctl --list-devices
USB 2.0 Camera (usb-0000:00:1d.7-6):
        /dev/video0

https://wiki.zoneminder.com/Hardware_Compatibility_List#USB_Cameras
http://ubuntuforums.org/showthread.php?t=1939703


Another method of capturing I like is using a cheap pci capture card and normal CCTV cameras, 4 channels, and these zone minder settings.

source /dev/video0
video for linux version 2 capture method
device channel 0
device format ntsc
capture palette YUYV
768x480, 10 frames/second

All of this was done using Ubuntu 16.04 x86_64