Friday, February 27, 2015

Mini2440 web server and IP Camera

Access local web server through LAN Network
By default, web server is installed in board.
After setting IP address for board (come to "Network setting" on touch screen), internal web can be access through local network
Note: By default, default port is 80 (not 8090 as in following picture, to edit port, come to file /etc/boa/boa.conf), to test it, type: 192.168.1.230:80

Those web are saved in /www/ in board. Default program in this web is controlling the LED in board, let's try to do some setting in web and see how LED blinking changed in board.
Through this web, application in board can be accessed through LAN Network. or even Internet.

Access local web server through internet
1. Open port (port forwarding)
Come to router by default address 192.168.1.1, user: Admin, pass: Admin

Configure as this

Another kind of router maybe will have another way, but same principle
This case:
   Port 8090 is chosen to be opened, so the setting port in board also should be changed in file /etc/boa/boa.conf (don't choose common port, because it is used for another application in PC)
   192.168.1.230 is board IP Address, the board must be set this address

After opening port, to test it is opened or not, come to web page that can test it online
For example, come to http://portchecker.co/ to check port


2. Open web from internet
That's all. Now come to another PC (that not in LAN Network with board) connected to internet  to test it, just type external IP Address with port: 222.253.211.101:8090
The web will be loaded same as in Local Network.
Note: External IP Address and Internal IP Address are different, Google it to find definition of them.


3. IP Camera
The default web server in Mini2440 can't use camera
Another way is get MJPStream Mini2440 project from following link
In the project:
   * un-comment the content "PLUGINS += output_http.so" in "Make" file
   * Change port from 8080 to 8090 in file "mjpg_streamer.c"
Then, cross-compile it
After all, download to board
Stop default web server:
$/etc/rc.d/init.d/httpd stop

Connect USB-Camera to board, run project by command:
$./start.sh


Currently, you can connect to my camera via address: 222.254.224.227:8090



The complete project for Mini2440 can be downloaded here and run on your board.





No comments:

Post a Comment