2008年12月22日 星期一

miniupnpc-1.2 test setting on ARM9

miniupnpc-1.2 installation on ARM9
=======================================================================
1. Link ARM9 lan wire to asus router and connect ASUS router to internet. the miniupnpc-1.2
had installed on ARM9 device.

ASUS Router setting default ip 192.168.1.1,router must enable upnp function first !!
































2. on ARM9 board
/ # ifconfig eth0 192.168.1.23
/ # route add -net 0.0.0.0 gw 192.168.1.1
/ # route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.1.0 * 255.255.255.0 U 0 0 0 eth0
default 192.168.1.1 0.0.0.0 UG 0 0 0 eth0

/ # ping 192.168.50.1
PING 192.168.50.1 (192.168.50.1): 56 data bytes
64 bytes from 192.168.50.1: seq=0 ttl=63 time=10.498 ms
64 bytes from 192.168.50.1: seq=1 ttl=63 time=1.892 ms
64 bytes from 192.168.50.1: seq=2 ttl=63 time=1.892 ms
/ # ping 192.168.0.2
PING 192.168.0.2 (192.168.0.2): 56 data bytes
64 bytes from 192.168.0.2: seq=0 ttl=62 time=10.224 ms
64 bytes from 192.168.0.2: seq=1 ttl=62 time=2.655 ms
64 bytes from 192.168.0.2: seq=2 ttl=62 time=2.685 ms
64 bytes from 192.168.0.2: seq=3 ttl=62 time=2.594 ms

ok , now we can connect to internet.
/ # upnpc -m 192.168.1.23 -l
/ # upnpc -m 192.168.1.23 -s
check upnp IGD device on net.
upnpc : miniupnpc library test client. (c) 2006-2008 Thomas Bernard
Go to http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/
for more information.
List of UPNP devices found on the network :
desc: http://192.168.1.1:5431/dyndev/uuid:0013d4d1-fe68-0013-d4d1-fe680032a9a2
st: urn:schemas-upnp-org:device:InternetGatewayDevice:1

Found a (not connected?) IGD : http://192.168.1.1:5431/uuid:0013d4d1-fe68-0013-1
3. try to open ports for our ARM9 device
/ # upnpc -m 192.168.1.23 -r 8080 tcp 8081 tcp
upnpc : miniupnpc library test client. (c) 2006-2008 Thomas Bernard
Go to http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/
for more information.
List of UPNP devices found on the network :
desc: http://192.168.1.1:5431/dyndev/uuid:0013d4d1-fe68-0013-d4d1-fe680032a9a2
st: urn:schemas-upnp-org:device:InternetGatewayDevice:1

Found a (not connected?) IGD : http://192.168.1.1:5431/uuid:0013d4d1-fe68-0013-1
Trying to continue anyway
Local LAN ip address : 192.168.1.23
ExternalIPAddress = 192.168.50.111
InternalIP:Port = 192.168.1.23:8080
external 192.168.50.111:8080 TCP is redirected to internal 192.168.1.23:8080
ExternalIPAddress = 192.168.50.111
InternalIP:Port = 192.168.1.23:8081
external 192.168.50.111:8081 TCP is redirected to internal 192.168.1.23:8081

/ # upnpc -m 192.168.1.23 -r 11131 tcp 11142 udp
upnpc : miniupnpc library test client. (c) 2006-2008 Thomas Bernard
Go to http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/
for more information.
List of UPNP devices found on the network :
desc: http://192.168.1.1:5431/dyndev/uuid:0013d4d1-fe68-0013-d4d1-fe680032a9a2
st: urn:schemas-upnp-org:device:InternetGatewayDevice:1

Found a (not connected?) IGD : http://192.168.1.1:5431/uuid:0013d4d1-fe68-0013-1
Trying to continue anyway
Local LAN ip address : 192.168.1.23
ExternalIPAddress = 192.168.50.111
InternalIP:Port = 192.168.1.23:11131
external 192.168.50.111:11131 TCP is redirected to internal 192.168.1.23:11131
ExternalIPAddress = 192.168.50.111
InternalIP:Port = 192.168.1.23:11142
external 192.168.50.111:11142 UDP is redirected to internal 192.168.1.23:11142



4.check router status, we can see the ports had been sucessfully opened !!
asus router
Status & Log - Routing Table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.50.0 * 255.255.255.0 U 0 0 0 WAN
192.168.1.0 * 255.255.255.0 U 0 0 0 LAN
default 192.168.50.1 0.0.0.0 UG 0 0 0 WAN


Status & Log - Port Forwarding
Destination Proto. Port Range Redirect to
192.168.50.111 TCP 8081 192.168.1.23
192.168.50.111 TCP 8080 192.168.1.23
192.168.50.111 UDP 11142 192.168.1.23
192.168.50.111 TCP 11131 192.168.1.23
192.168.50.111 UDP 9001 192.168.1.3
192.168.50.111 TCP 80 192.168.1.3


type 192.168.50.111:80 on other PC browser,then you can see ARM9 webcam
if we already running this service on it!!

2008年11月26日 星期三

mjpg_streamer or uvc_streamer always Unable to set format: Invalid argument

When running webcam AP like mjpg_streamer or uvc_streamer on your PC
(need to "depmod -a" , and "modprove uvcvideo" , this will install uvc driver on your PC)

many people will see this:
[arthur@localhost mjpg-streamer-r63]$ ./mjpg_streamer
MJPG Streamer Version.: 2.0
i: Using V4L2 device.: /dev/video0
i: Desired Resolution: 640 x 480
i: Frames Per Second.: 5
i: Format............: MJPEG
Unable to set format: Invalid argument
Init v4L2 failed !! exit fatal
i: init_VideoIn failed

this can be easily bypass by using follow cammond:
/usr/local/bin/./mjpg_streamer -i "input_uvc.so -d /dev/video -y" -o "output_http.so"


This is because your PC is USB2.0 support, so the streamer can only use yuv mode to output your images,
it's 80 frames/sec, much more then MJPEG mode. if you really want test MJPEG mode,
then you can try

sudo rmmod echi_hcd,

this will force take off usb2.0 driver, and only usb1.1 driver running. and after this you can run your AP happily.

My system is fedora6 , /usr/src/kernels/2.6.22.14-72.fc6-i586/