This is an example how we can build a web server under an embedded system such as beagle board. Maybe a few years ago we experienced some difficulties if we want to apply a TCP/IP communication under microprocessor or microcontroller systems, we should add additional equipment to our minimum systems and sometimes it takes time and we need to hack the systems a lot. but now, there is many embedded systems are equipped with on board TCP/IP modules so it is easy now for us to build a systems that connected to a computer or TCP/IP network.
There are many vendors that builds this kind of systems such as arduino, raspberry, and beagle board. and now i want to try to make a web servers running in beagle board systems, and i promise … its very super duper easy ..
first of all we should prepare our beagle board systems, if you want to take a closer look to this systems you can find in http://beagleboard.org/
The beagleboard systems is include the operating systems package using Angstorm OS, Angstorm OS is build with openembedded and customized to suit the embedded system needs, for details you can find it in http://www.angstrom-distribution.org/
But if you want it to start installation from scratch you can find the tutorial in http://www.ibm.com/developerworks/linux/library/l-beagle-board/
to communicate with our beagleboard systems we can connect our PC to the beagleboard using a serial to USB adapter, and then we can set the baudrate to 115200 using our favorite remote tools such as putty, Teraterm or even hyper terminal software.
and then start your remote tools, and you should see a screen like this one below :
The beagle board equipped with the ethernet port modules, so you can plug your cables to the port and let the beagle get its own ip address using DHCP, you can see your ip address with the ifconfig or ip addr commands.
In the picture above we can see the ethernet port in beagle systems are bind in usb0 interface, so the IP gave by DHCP servers are configured in this interface, you can see my ip configuration are 172.21.4.28/26. sometimes you should make the network up with init network command.
Test your internet connection to make sure you can reach the internet from your beagle board systems.
Now we are ready to install the Web server using the beagle systems, here is the easy part. We should know that angstorm distribution have a repository systems called OPKG, it just like apt-get in ubuntu or yum in fedora or centos release. so we will install the web server using the repository systems.
we should realize that we are running in embedded system that mean it have a minimum hardware specification, so i think we should choose the web server that have a minimum requirement to support the minimum hardware, and i choose TinyHTTPD and Light HTTPD and we can start to install those web servers with :
opkg install light-httpd
opkg install thttpd
after it finished, you can run the web server, but you cant run both of them because its bind to the same 80 port. start your server with init command and you should see the picture below when you access it in your browser: