Tuesday, December 25, 2012

Wi-Fi Boosting: Hardware Trick

Increase your Wi-Fi router's range towards your computer and filter out unwanted Wi-Fi signal from neighbouring devices with some hardware trick. You already have the materials in your house and it takes less than 5 minutes.

A little theory 

Just the bare minimum to understand how and why it works.

Wi-Fi is an unlicensed radio band in the 2.4 GHz range and it behaves just like any other electromagnetic wave. It is known that electromagnetic waves are piercing through metal object very weakly, or in other words they are reflected or stopped. This is the exact same reason why you shouldn't put any metallic object in your microwave oven either.

Electromagnetic waves propagate in the direction without any obstruction freely, but waves that hit metallic surfaces (say a steel plate) get reflected (a portion pierces through and the remainder gets reflected. The ratio of reflected to continuing waves depends on the type and thickness of metallic layer). The reflected component then is heading the same way as the part which was going unobstructed, thereby creating an amplification effect. This amplification can be used in the case if Wi-Fi signal as well, just like described above.

Consider the following example.

Imagine a 2 dimensional system with point signal source (say a router, broadcasting Wi-Fi signal) and a metallic object (radiator) on its right. Considering only the horizontally propagating waves in the 2-dimensional plane, the following happens.

 The signal is emitted and propagates freely to the left as there is no obstruction.

The other part of the signal propagates to the right and hits the surface of the metal plate. At this point (ignoring any signal getting through, so assume 100% reflection) the signal is reflected from the surface and starts heading backwards, the way it started from (dashed lines) .

The reflected waves are now heading in the same direction as the first part (to the left), but now there are twice as much, going in the one direction, hence the stronger or more signal.

How to make use of this 


The reflection of signals is usually an unwanted thing in an apartment where Wi-Fi is used as it generally weakens the signal. This occurs when a router is placed close to a radiator or mirror and the computer is on the other side respectively. However when placing the signal source cleverly,  reflection can be taken advantage of and it can actually boost the radio signal. 2 main tricks that can be done are
  1. Amplifying the signal coming from the router to a specific direction
  2. Blocking signal arriving to a device
The first one is the process described above in the theory whereas a signal is forced in a chosen direction. The latter option might not seem useful for the fist time, but it is actually very handy in situations where there are a lot of different signals. In these cases (say 20 different Wi-Fi routers) each of the 13 channels are used, some even by more than 2-3 devices. If this happens, the receiver device has to differentiate between the incoming signals and decide which one is the one required and filter out the rest. Referring to the used example, if an antenna is receiving a signal from the left, then by placing a metallic object on its right, the unwanted signals coming from the right can be blocked out, hence the receiving device will have to "think" less about which signal is useful and which one should be disregarded.

Make your own amplifier


Making something that amplifies or rather said direct your Wi-Fi signal into the necessary direction is way easier than it sounds. All you need is:
  • Cardboard
  • Aluminium foil
  • Scissors, duct tape etc.
Ultimately what you need to do is to cut a piece of cardboard and cover it with aluminium foil. This will act as the metallic layer as described in the previous example and reflect your signal the way you need it to.

Then, based on how you want to direct the signal place it behind your signal source. You can either have it
  • Straight - the signal will be stronger on the one side of the wall while weaker on the other side
  • Bent in a slight "U" shape or parabola - the signal will be directed more or less in a cone shape. This is a more focused option and can extend the range further out in a narrower region.


This does sound cheap and it is, but it certainly does the job. I have applied this behind my receiver antenna and it has blocked out about 9 out of 12 Wi-Fi signals from neighbours and therefore made my own signal reception much more stable and reliable. I am just making another one to place behind the router and direct more signal towards my antenna, which is going to even further improve the quality of my local network.

Please note that even though this is a nice trick you can do fast within the next 5 minutes and get significant results immediately after placing it, it will not be as good as buying directional antennas or anything similar.

My plans are to test a parabola antenna by placing a small router in the middle of it and check how far the range has extended. I have seen Wi-Fi working over vast distances and I am hoping for reproducing similar results.

    Thursday, December 20, 2012

    PirateBox: Design 2.0 Update

    First of all a huge thanks to Maxime who has made some really nice improvements to my design that I am discussing here. It is about the "Design 2.0" and see the list of improvements below.

    The improvements and changes do not require any change to your PirateBox, except for the www folder where the html files are stored, the pbIMG_ws.img file on your drive.


    • User gets automatically redirected to mobile version of the website if accessing from mobile device (presuming no preference is set on the device for viewing the browser versions). 
    • Display the number of connected users, just to keep track on how many users are connected to the PirateBox.
      (Fundamental part of a PirateBox is that it is fully anonymous and this does not change here. No information is collected from the users, the device only tells the total number of connections, nothing else.)
    • There is a very nicely written tutorial for replacing the original PirateBox design with my Design, including instructions how to modify the page for your liking.
    • Also the chat was changed slightly. It is no longer operating as an iframe, but as a core part of the index (home) page. As a result of this it will load faster and it will eliminate compatibility issues with some devices. Also since it is now the part of the main page, there is no need for a chat.html page either.

    Changing to my Design


    Download: GitHub

    There is a tutorial written by Maxime on GitHub that you can follow, but it is as simple as downloading the "Design 2.0" folder and copying over its contents to the Pendrive's pbIMG_ws.img/piratebox/www folder, overwriting any similar files already there.
    Attention: Make sure you do a BACKUP of your own www folder and it's contents before overwriting files or doing any changes.


    So that you do not have to go back to previous post to know what design I am talking about.

    As you can see nothing has changed in the overall design, the pictures just show how the design looks to have a quick idea of what you get here. The change in chat is not remarkable to the naked eye, but it is a nice new feature that it doesn't need to be loaded and embedded from a separate page, but being part of the main page.
    I also cannot show the mobile redirect, but that is one of the nice features I really like. So from now on even people from mobile devices can get a basic view of the site, however if they prefer they can sure view the browser version.

    Future Plans

    After talking to Maxime we have started to work together to give a better finish to the UI, add more functionality and improve general appearance and usability.
    Our plans for the future are to add the following:
    • Admin page with the features
      • Allow editing (rename, delete etc.) of uploaded files
      • Contain a short guide of terminal commands with the most important commands
    • Option for owners to add video, music or possible games to the PirateBox that can be streamed to the users. It is likely that only "stronger" PirateBoxes will have this function as this will need larger amount of computing power from the router. (However as browser try opening files instead of downloading them anyway, this sort of works already.)
    • Multiple languages support for the site so users could choose to view & use the PirateBox in their own, preferred language.
    • Design adjustments to achieve a higher standard and make a more attractive UI in general for the public.
    Videos, music and even flash games can be added easily by anyone right now as well. As HTML5 supports a videos and music, this can also be added relatively easily, see the example below for adding a video:

        <article id="video">
        <h1>Copy Is Not Theft!</h1>
        <h2>A short video illustrating the difference between stealing and       copying.</h2>
        <video id="intro_vid" width="600" height="450" controls >
        <source src="multimedia/Copying.Is.Not.Theft.webm" />
        <source src="multimedia/Copying.Is.Not.Theft.mp4" />

    The above code would add a new article (section) to the man page where video(s) would be at multimedia/video.webNow you can see 2 video formats listed there, this is needed because in HTML 5 different browsers support different video types.

    Similarly, you could add audio files to your site as well, example:

        <audio controls="controls">
        <source src="multimedia/audio.ogg" type="audio/ogg">
        <source src="multimedia/audio.mp3" type="audio/mpeg">
        Your browser does not support the audio element, soz.

    Where again the 2 file types are because of browser supports.
    Although note that the standard pbIMG_ws.img container is only 20MB in size and all the files for the website must be in here. Now you can of course make a larger img file that could contain all the files and added videos, but this will take up space on the pendrive. Also the more multimedia you add, the more your box will have to work.

    On my custom box I am using a 50MB container with just one short video and audio file for experimental purposes, it looks like this:

    As you can see, I also made myself a "Video" and "Games" tab as well, the picture above shows the video page, but there is a flash game uploaded as well. It is running just fine, but not multiplayer.