Archive for the ‘Bluetooth Media Sharing’ Category:
Blü server cluster
No so long ago, we received a couple of computers from the SCM.IT team (thanks to Prof. Liu, Antony and Simon), 20 computers (with their keyboard/mouse/LCD friends) to be precise. While 3 of them have dead power supplies, the other ones are happy and running along.
This post will outline some of the things I have done so far.
- Setting up the computers
Since the computers will all be connected together in a cluster, I needed to setup the computers and connect them together. This was definitvely not an easy task but, with a little time, i got them all up together. Physically at least.
[insert photo of cluster]
The process each computer underwent was the following (several computers were done in parallel):
- Check power supply
- Modify BIOS settings:
- Allow PXE
- Allow Wake on Lan
- Restart on power loss
- Wake up at 6.00 am
- boot from USB, then SATA
- Num. Lock
- Enable Hyperthreading
- Partition HDD and install Ubuntu Linux 9.04
I considered originally installing Linux using PXE but then thought it would be faster just to boot all the computers with Ubuntu Jaunty on my USB key. (it was faster) - Install openssh-server on all the computers
sudo apt-get update && sudo apt-get -y install openssh-server && sudo reboot
- Connect to the blü network
- Setting up the network
Since we need to keep the costs down (the computers were lended to us for free), we also went the cheap route for the network. If we keep the “google” approach to the cluster, we should stick to cheap components that can easily be replaced in case of failure. Thus, the following networking tools were purchased:
- D-Link DIR-300 router (on which i installed DD-WRT) @ $HK199
- D-Link 16port 10/100 switch @ $HK230
- 300m of CAT5 cable
- 50 RJ45 plugs
- crimping tool
The longest part of this process was, of course, making the cables.
- Remote access
I had a look at which solution would be the best in order to control all the computers graphically without having to buy expensive KVM switches. My final decision went for running Xsessions over ssh. This would ensure minimal modifications to the system and security.
Other choices were X forwarding and VNC. I did not go for VNC because of security reasons and also because i had touble forcing it to launch before the gdm prompt. Similarly I did not go for X forarding because I had concerns about security.
To run Xsessions under windows one needs to install Xming and Xming-fonts. Then create a xml file with the following extension: .xlaunch and content:
<?xml version="1.0"?> <XLaunch xmlns="http://www.straightrunning.com/XmingNotes" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.straightrunning.com/XmingNotes XLaunch.xsd" WindowMode="Windowed" ClientMode="StartProgram" Program="gnome-session" ClientStart="PuTTY" Compress="true" RemoteHost="192.168.0.1" RemoteUser="blu" Display="15" Clipboard="false"/>
replacing of course 192.168.0.1 by the client IP and gnome-session by the program you would like to launch
MyDNS
There has been some issues for me to convert the wifi interface of the computer to an AP under ubuntu studio 8.10.
This is my attempt to still enable users to connect to the BTMS server using wifi.
My First attempts included installing chillispot on the system, but that ended up messing up all my network settings and that was not what I really wanted: end up without any networking working at all.
My second attempt, that now seems the correct route to take is to use a hardware router connected to the ethernet port of the server and redirect all the traffic to the server.
To redirect the traffic there are two ways that I have found:
- Install DD-WRT on the router and use the captive portal features of the router
- This route was tried and miserably failed
. This is because the router used is a DIR-300 and it is a cheap piece of useless junk! haha
Even with the original firmware I find that the router is pretty crap… and failed in many ways (even at simple tasks such as getting an IP through DHCP on startup). With DD-WRT installed, most of the extra features such as VPN serving or captive portals did not want to work
- This was done, after a little research, by installing "mydns" (http://mydns.bboy.net/) on the system and redirecting all the incomming DNS requests of the router to that server. The ruling system was simple enough for me to force all the addresses to point to the pages I want. Since it did not allow wildcards for the final domain extensions such as .com, .aero, .hk ….. I simply got the list of all those extensions from Wikipedia and make a simple SQL script to insert them all with the info i required. So far, so good.
One of the things I would find to say about this system is that if the computer accessing the system does not clear its DNS cache frequently enough or at reconnection with another AP, they will have all the URL accessed during that session show up as inaccurate and inaccessible.
New front-end for BTMS
Since the ideal for this system is portability, the new interface will not replace totally the originally XHTML/Javascript based front-end, but it will supplement it with much richer and less resource intensive work.
I am now using Flex to implement the front-end, php provides the backend for supplying with the media info and any new update.
The interface now polls for new data every 10 seconds and thus, the display can be refreshed every 10 seconds. Since the data is not time-critical I consider those 10 seconds enough for the user not to run away by not seeing his work displayed.
This switch to flash based medium that does not support the animated GIF images I have in the HTML interface will force me to encode those videos in FLV format.
Why I picked Flex is because there are now a plethora of 3D engines for flash and also because about 90% of the browsers support flash. Furthermore, this would also enable kiosks to simply run the flash application in a standalone projector instead of having to run a browser that would hog down the system resources.
For testing, please come to Inno Centre in the SIG area and upload your pictures to "Bluetooth Media Sharing" via bluetooth.
The wifi extension is ready but not yet enabled so as to keep my system in the short-range availability only.
BTMS update
Finished the MAC filtering settings on my BTMS system.
Now, the system will have 3 settings: blacklist, whitelist and OFF. This will enable to filter the content as it come. The three modes work as follows:
- blacklist: will delete all the submissions done by the registered MAC addresses. It will not even try to process them as they will be deleted straight away
- whitelist: will automatically approve all the content that is submitted by the registered MAC addresses. Content that is not in the list of approved MAC addresses will be added nonetheless but will need to be approved manually by an admin.
- OFF: will approve everyone and every content without admin supervision.
I also finished making the admin page for removing/accepting images. The page was mainly tested on my iTouch and displayed quite well.
Project Update on BTMS
Trying to work with Red5. It does not really work like i would like it to.
I might actually go back to a PHP backend for the whole AMF connection between Flash and the database. It was quite snappy when working on http://matchup.morgan.hk/www last year. I was using AMFPHP at the time and quite liked it for its simplicity of implementation. (It is also important to note that I am quite fluent in PHP and have a slight (huge) aversion to Java)
So far, i can get the video conferencing to work. I only need to implement the interface properly and try to integrate it to the current BTMS platform.
Ref for red5 and Flex
http://www.actionscript.org/resources/articles/615/3/Getting-started-with-red5-server/Page3.html
http://www.flashextensions.com/tutorials.php
getting Red5 to work
Yesterday I was remoting in to the computer I have in the Inno Centre to try to get the Red5 working. (public holiday)
While remoting in, I could sitll not get it to work how I wanted. I did make sure the firewall was open and I even tried to connect to the server by using a SSH proxy to the computer and no dice. All the time the server would try to get a handshake and timeout.
In order to solve this problem, I simpy took the problem from the beginning and decided to re-install the whole red5 system.
I did try to install it on the other machine I have in the Inno Centre, which is a Windows Box, but no dice. I am not a big java fan and apparently the java install I had was giving me trouble.
What I had done the first time was to install it on the linux box was using the SVN snapshot. This might have been a bad idea since we never know what might have gotten through the latest submission. When going back to the website I found out that there was already a pre-compiled package for debian systems. Which is the underlying system to the Ubuntu box I am using.
After installing the DEB file, everything ran out of the box and I am now happy to be able to test the server even remotely (tried from a computer lab with webcams in order to test the livre video broadcast)
More info when I have developped a little more.
Now, it’s time to install Flash
Installing Red5
http://osflash.org/red5/ubuntu804
Tonight after class I installed Red5 on my ubuntu box down in the RA room. It will serve as a Flash Media server for the BTMS/MiG developments. Hopefully by next week we can have live video streaming happening between two clients.
Then I should get on with authentication.
Updated frontend
For the BTMS project, I am currently changing the front-end that was browser based and sucking up a lot of ressources and tend to fail.
The front-end is now coded using C++ and OpenFrameworks.
It is very easy to use and uses standard C++, OpenGL and libraries. I am so happy to see it work the way it does. It is also cross-platform so I should be able to release the front-end for Linux, Windows and Mac OS X.
Subscribe to the comments for this post