2008年12月28日 星期日

zd1211b.ko/zd1211.ko working on at91rm9200

zd1211b.ko test get ip from wireless AP ok!! but very slow.
==========================================================================
~ $ ifconfig wlan0 up

~ $ iwconfig wlan0 essid SMC
~ $ Channel changed:5 to 1
~ $ iwconfig
lo no wireless extensions.

eth0 no wireless extensions.

wlan0 802.11b/g NIC ESSID:"SMC"
Mode:Managed Channel=0 Access Point: 00:13:F7:A4:44:5A
Bit Rate:0 kb/s
Retry:on RTS thr=9999 B Fragment thr:off
Encryption key:off
Power Management:off
Link Quality:66/100 Signal level:49/100 Noise level:0/100
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:5392 Missed beacon:0


~ $ iwevent
Waiting for Wireless Events from interfaces...
04:05:13.589203 wlan0 Scan request completed
04:05:15.191925 wlan0 New Access Point/Cell address:00:13:F7:A4:44:5A
lo Interface doesn't support scanning.

eth0 Interface doesn't support scanning.

04:05:28.385284 wlan0 Scan request completed
Channel changed:11 to 5
04:05:30.457702 wlan0 New Access Point/Cell address:00:13:F7:A4:44:5A
04:05:43.697876 wlan0 Scan request completed
Channel changed:11 to 5
04:05:45.660309 wlan0 New Access Point/Cell address:00:13:F7:A4:44:5A
lo Interface doesn't support scanning.

eth0 Interface doesn't support scanning.

04:05:58.017609 wlan0 Scan request completed
lo Interface doesn't support scanning.

eth0 Interface doesn't support scanning.

04:06:12.307159 wlan0 Scan request completed
cgi_half_bottom 0
lanrestart
No DHCP used by LAN, skip.
wlan0: No such process
ifconfig
lo Interface doesn't support scanning.

eth0 Interface doesn't support scanning.

04:06:27.416778 wlan0 Scan request completed
cgi_half_bottom 0
lanrestart
No DHCP used by LAN, skip.
wlan0: No such process
ifconfig
04:06:30.107025 wlan0 New Access Point/Cell address:00:13:F7:A4:44:5A
iwconfig
No DHCP used by LAN, skip.
udhcpc
udhcpc (v1.7.5) started
ifconfig
done
Sending discover...
lo Interface doesn't support scanning.

eth0 Interface doesn't support scanning.

Sending discover...
Sending discover...
Sending discover...
04:06:44.165558 wlan0 Scan request completed
Sending discover...
Sending discover...
******We Lose AP for 5 seconds
04:06:50.236267 wlan0 New Access Point/Cell address:Not-Associated
Sending discover...
Sending discover...
Sending discover...
Sending discover...
04:07:03.291656 wlan0 Scan request completed
04:07:05.254028 wlan0 New Access Point/Cell address:00:13:F7:A4:44:5A
04:07:18.338318 wlan0 Scan request completed
04:07:20.215515 wlan0 New Access Point/Cell address:00:13:F7:A4:44:5A
Sending discover...
Sending select for 192.168.2.195...
Lease of 192.168.2.195 obtained, lease time 86400
dns1 = 192.168.2.1, dns2 =
done
killall: crond: no process killed
lo Interface doesn't support scanning.

eth0 Interface doesn't support scanning.

04:08:29.702066 wlan0 Scan request completed
=====================================================================
zd1222.ko also ok !!

fix error: 'init_net' undeclared (first use in this function)

there are no init_net in kernel-2.6.23 and under ,so just remove "init_net" , the compile will pass.

ZD1211_2_22_0_0 driver

//for 2.6.24 above// for (adapters_proc_dir = init_net.proc_net->subdir;
for (adapters_proc_dir = proc_net->subdir; //for 2.6.23


//arthur create_proc_entry(ADAPTERS_PROC_DIR, S_IFDIR, init_net.proc_net);
create_proc_entry(ADAPTERS_PROC_DIR, S_IFDIR, proc_net); //arthur



//arthur remove_proc_entry(ADAPTERS_PROC_DIR, init_net.proc_net);
remove_proc_entry(ADAPTERS_PROC_DIR, proc_net); //arhtur

how to rename eth1 to wlan0

iftab put under /etc/ directory
=====================================================
eth0 mac 00:03:EA:11:4A:84
wlan0 mac 00:0E:2E:5E:42:37



and under arm9 console just type "ifrename"

P.S. ifrename is a tool in wireless_tools.29

done !!!!!

2008年12月25日 星期四

upnpc setting testing in real


列出目前已經支援的routerports

/ # upnpc -m 192.168.2.23 -l

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.2.1/root.sxml

st: urn:schemas-upnp-org:device:InternetGatewayDevice:1


Found valid IGD : http://192.168.2.1:4444/wipconn

Local LAN ip address : 192.168.2.23

Connection Type : IP_Routed

Status : Connected, uptime=634, LastConnectionError : ERROR_NONE

MaxBitRateDown : 10000000 bps MaxBitRateUp 10000000 bps

ExternalIPAddress = 59.115.131.135

0 TCP 88->192.168.2.23:8082 'video' ''

1 TCP 89->192.168.2.23:8081 'video-1' ''

GetGenericPortMappingEntry() returned 713 (SpecifiedArrayIndexInvalid)


upnpc 新開一個port 80 mappingarm9 device 8080

/ # upnpc -a 192.168.2.23 8080 80 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.2.1/root.sxml

st: urn:schemas-upnp-org:device:InternetGatewayDevice:1


Found valid IGD : http://192.168.2.1:4444/wipconn

Local LAN ip address : 192.168.2.23

ExternalIPAddress = 59.115.131.135

InternalIP:Port = 192.168.2.23:8080

external 59.115.131.135:80 TCP is redirected to internal 192.168.2.23:8080


檢查一下 開port成功

/ # upnpc -m 192.168.2.23 -l

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.2.1/root.sxml

st: urn:schemas-upnp-org:device:InternetGatewayDevice:1


Found valid IGD : http://192.168.2.1:4444/wipconn

Local LAN ip address : 192.168.2.23

Connection Type : IP_Routed

Status : Connected, uptime=646, LastConnectionError : ERROR_NONE

MaxBitRateDown : 10000000 bps MaxBitRateUp 10000000 bps

ExternalIPAddress = 59.115.131.135

0 TCP 80->192.168.2.23:8080 'libminiupnpc' ''

1 TCP 88->192.168.2.23:8082 'video' ''

2 TCP 89->192.168.2.23:8081 'video-1' ''

GetGenericPortMappingEntry() returned 713 (SpecifiedArrayIndexInvalid)

/ # Jan 2 00:13:33 MJPG-streamer [936]: serving client: 220.132.160.12:36267

Jan 2 00:13:33 MJPG-streamer [936]: serving client: 220.132.160.12:36268



arm9 device ip = 192.168.2.23)需加上gateway

/ # route add -net 0.0.0.0 gw 192.168.2.1

否則會找不到device


在公司電腦開瀏覽器 打入59.115.131.135 然後enter就可以連上webcam


刪除這個port mapping

upnpc -m 192.168.2.23 -d 80 tcp


加入8080 mapping arm9 8080 port

/ # upnpc -m 192.168.2.23 -a 5050 tcp 8080 tcp

在其他上網電腦開瀏覽器 打入59.115.131.1358080 然後enter就可以連上webcam

(ex. mjpg-streamer-r63)










If we want 11131/11142 ports service to out arm9 board then just type

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




If we want 8080/8081 service to out arm9 board then just type

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



check put route setting ,the port had been successfully added!!


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/