DataFox

DataFox is a bandwidth usage monitor for BSNL’s DataOne and MTNL’s TriBand broadband services. DataFox is a cross platform extension written for Firefox and Google Chrome; if you use Internet Explorer or any other browser, DataFox will not work for you. Tough shit. Version 1.9.5 is compatible with Firefox versions 1.5 – 15 and supports BSNL sites (including data.bsnl.in and selfcare.ndc.bsnl.co.in) and both MTNL Bombay/Delhi sites (including 59.185.101.2).

DataFox in action on the Firefox status bar…

menu tooltip
DataFox context menu DataFox tooltip

DataFox in Google Chrome


Download, Installation & Updates

If you’re using Firefox, click here to install the extension directly. Alternatively, right click, choose Save Link As… and save the XPI file locally. Open this file in Firefox (File > Open File…) to complete the installation. DataFox has been tested with Firefox versions 1.5 to 8. To activate this extension, you need to restart Firefox. Firefox might show you a message at the top of this window, saying it prevented thegoan.com from asking you to install an extension. Click the Options button in the message and then click Allow in the dialog that shows up. Click the link again to install.

To update, go to Tools > Add-ons and select DataFox in the list. Right click to bring up the context menu. Select Find Update. Firefox will connect to my update site and inform you if an update is available. If one is, click Install Updates and you’re done.

If you are using Google Chrome, click the Install button on this page.

Use

DataFox is really easy to use. Once installed, you should see this icon () in your status bar. Click it to bring up the login dialog. Select your ISP, then enter your name and password and click the Login button; that’s it. Click the icon again to refresh the usage data. Since version 1.4, if you keep CTRL pressed when you click this icon, DataFox will display details from the most recent successful update. This can come in handy if the usage server is down and you’d like the previous details restored.

DataFox works by obtaining usage information directly from the BSNL / MTNL usage site, it does not monitor your network in any way, so usage details probably won’t change until you logout of DataOne / TriBand and log back in again. BSNL users may want to use the Override default domain option in the login dialog in case the BSNL server you are being directed to is not responding (see below for explanation). Users who normally use bbservice.bsnl.in/data.bsnl.in to check their usage must check this option and select the corresponding domain from the domain list. MTNL users, if the usage server is down, DataFox will not be able to fetch any usage records.

You can right click the status bar icon to bring up the following options:

Update Forces the usage data to update, has the same effect as clicking the icon.
Logout Allows you to re-enter your account details the next time you update.
Show Records Display your usage records in the browser, you may choose to see records of either the active month, or the selector for all months.
Month (BSNL Only) Choose the month for which usage data is fetched. DataFox will allow you to choose one of six months as this is the extent of the records available online. In case data for a month does not exists (say, if you have only been using DataOne for three months) then DataFox will display an error message when trying to fetch the usage info.
Preferences Brings up the DataFox preference dialog (see below). Can also be invoked from the Tools menu.
Login Dialog options:Override default domain (BSNL Only) By default, DataFox first queries sancharnet.in for the appropriate address at which your usage can be checked. I assume it sends you to a server in your region for the quickest response. In case you wish to specify your own address or in case the redirect is not working for some reason, check the box and choose an address from the list or enter your own. data.bsnl.in users (those with IP addresses in the range 117.*.*.*) must check this option and select data.bsnl.in from the domain list, DataFox will not work for you otherwise. In the username field and password fields, you must enter your 14 digit portal Id and corresponding password; these are different from the username and password you use in your dialer / modem / router.

Preferences

Login on startup:

If this is checked and you have a password saved, DataFox will attempt to log in to your ISP’s site and show you the most recent usage details. If unchecked, DataFox will display cached details on startup.

Bandwidth limit:

If you’re using DataFox, you’re most likely on a bandwidth limited plan. Entering your limit here will enable DataFox to display a progress bar indicating the percentage of bandwidth (for the current month) consumed. DataFox will also be able to tell you if you are danger of reaching your limit before the month ends and how much “surplus” bandwidth you have for the current day. If you do not enter your limit, none of these statistics will be available.

Statusbar / Tooltip string:

DataFox parses the data returned from your ISP, makes some calculations and places the results in several variables…

[BSNL]{tS}-Total Upload
[Both]{tR}-Total Download
[BSNL]{tX}-Total Transfer
[Both]{cX}-Chargeable Transfer
[Both]{sX}-Surplus Transfer (for today)
[Both]{rX}-Remaining Transfer (for the month)
[Both]{uP}-Used Percent
[Both]{aP}-Allowed Percent
[BSNL]{tH}-Total Hours
[Both]{YM}-Year-Month
[Both]{tT}-Last Updated

You can place any text in the Statusbar string or the Tooltip string, and DataFox will replace any variables in the text with their actual values.

An example: I’ve transferred 2 GB in all but only 1.5 GB if the night transfer is excluded. So the string “{tX}GB / {cX}GB” will produce “2.0GB / 1.5GB”.

Progress page:

This page controls the colors used by DataFox under different usage conditions. If you do not specify your Bandwidth limit preference page, only the Usage OK colors will be used. On the other hand, if you do specify the limit but still do not want the progress bar to appear, you can simple uncheck the enable box.

How DataFox tracks your bandwidth use

Note: The following only applies if you have specified your bandwidth limit.

Let us assume you have 6000MiB of transfer for the month, and you’re in the month of June (which has 30 days).

DataFox will calculate that you have 6000/30 = 200MiB of transfer available per day (let’s call this TPD); assuming that you’re using your bandwidth at a regular rate. This means, on the 1st of the month, you’re allowed 1*TPD = 200MiB and on the 5th of the month, your usage could go upto 5*TPD = 1000MiB and you’d still be within limits.

Allowed Transfer = date * TPD
Surplus Transfer = Allowed Transfer – Chargeable Transfer (Chargeable Transfer is the actual bandwidth that is recorded by your ISP and deducted from your bandwidth cap – this is the figure you usually keep track of).

Now, if your Surplus Transfer is negative, DataFox puts your usage in the Overlimit category and the Overlimit colors will be used for the text and the progress bar. If your Surplus Transfer is positive, your usage is OK and a different set of colors is used. It is important to note that the Surplus transfer is not the difference between your monthly limit and the amount used till date. It is the difference between the allowed usage on that date as calculated by DataFox and your actual usage.

IllustrationBandwidth limit: 6000MiB, Nr. of Days in month: 30, therefore TPD = 200MiB.
On the 5th:
Chargeable Transfer as recorded by your ISP 850MiB
Allowed Transfer as calculated by DataFox 5 * TPD = 1000MiB
Surplus Transfer = Allowed – Chargeable 1000 – 850 = 150MiB(OK)
On the 15th:
Chargeable Transfer as recorded by your ISP 3300MiB
Allowed Transfer as calculated by DataFox 15 * TPD = 3000MiB
Surplus Transfer = Allowed – Chargeable 3000 – 3300 = -300MiB(Overlimit)
On the 29th:
Chargeable Transfer as recorded by your ISP 6500MiB
Allowed Transfer as calculated by DataFox 29 * TPD = 5800MiB
Surplus Transfer = Allowed – Chargeable 5800 – 6500 = -700MiB(Overlimit)

DataFox is also capable of calculating the allowed usage on an hourly basis instead of on a daily basis (see the Daily / Hourly radio buttons on Progress preference page).

Here DataFox calculates a TPH figure as 6000 MiB / (30 * 24) hours = 8.3MiB per hour. At 2pm on the 5th of the month, 4 * 24 + 14 = 110 hours have passed. Your allowed usage at this time is: 110 * 8.33 = 916.3MiB.

The remaining calculations are the same. I programmed this in before the daily mode and then I realized this was probably too accurate to be useful, so I made the daily mode the default.

Changelog

Version 0.8 
  • Initial verision suppports BSNL DataOne only.
  • Basic tooltip and statusbar preferences.
Version 0.85b 
  • Support for MTNL TriBand.
  • Multi-window awareness.
  • Ability to execute Javascript in tooltip and status bar strings.
  • Login on startup optional.
Version 1.0 
  • Progress bar.
  • Bandwidth limit awareness, tracking and reporting.
  • Preference changes take effect immediately.
  • New preference for data unit and decimal point accuracy.
Version 1.0.1
  • Bugfix: BSNL bandwidth limit awareness.
  • Bugfix: MTNL Bombay Session Records.
Version 1.2
  • Bugfix: Rounding error could cause progress meter to display wrong color.
  • Firefox 3 beta 4 support added, many FF3 related fixes.
Version 1.4
  • Support added for new BSNL portal (bbservice.bsnl.in).
  • DataFox will now cache results automatically.
Version 1.5
  • Works with bbservice.bsnl.in update (~ July 2008), consumes much less bandwidth.
  • Code cleanup: Global variables significantly reduced, better Firefox citizen.
Version 1.7
  • Works with data.bsnl.in.
  • Works with MTNL Bombay site for ‘@’ users (59.185.101.2).
  • New variable {rX} added for remaining transfer.
Version 1.7.5
  • Works with data.bsnl.in update (~ May 2009).
  • Miscellaneous minor fixes.
  • Bumped max Firefox version to 3.5.*.
Version 1.9
  • Works with data.bsnl.in update (~ November 2009).
  • Works with MTNL Bombay update for ‘@’ users (~ July 2009).
  • Bumped max Firefox version to 3.6.*.
Version 1.9.2
  • Works with data.bsnl.in update (~ June 2010).
  • Compatible with Firefox 4
Version 1.9.3
  • Compatible with Firefox 6
Version 1.9.5 (Current)
  • Support for selfcare.ndc.bsnl.co.in
  • Compatible with Firefox current Firefox versions.

Coming up

  • Daily progress mode.
  • [Insert your favourite feature here - send me feature requests].

Privacy

The Source:

There are many people concerned about the safety of their logincredentials. This is a fair concern, so let me try to allay your fears. The XPI file you downloaded is just a zip file. Decompress it to find a JAR file (which is also just a zip file) in which you will find all the source behind DataFox. It’s just basic JavaScript and XML, and it won’t take a rocket scientist to figure out your account details are going only to the BSNL / MTNL servers. It would be impossible to hide any password stealing code in what is essentially open source project – the code is available under GPLv2 (there is no separate download, just follow the steps above to get to the source). Besides this, DataFox has been in use for two years by tens of thousands of users, if there was something fishy going on, it would never get this popular and everyone and their grandmothers would know about it.

Saved Passwords:

If you save your passwords, DataFox uses Firefox’s password store to store them. Go to Tools > Options > Security and click Show Passwords…. Look for all entries where the site is “chrome://datafox/” – you can delete or view those passwords as you please.

Contact & Support

I’m Brian Fernandes, see the About page for contact details; comments and feature requests welcome. Join other DataFox users in the DataFox thread at the India Broadband Forum. More info may be found at the DataFox wiki page.

Special thanks to Apoorv, Arnav, Gavnit, mrbgupta, Netfreak, Rohit, Seshu, Sunish and Vrushank who have sent me their passwords, without which DataFox would only work for BSNL’s old portal. Essbebe has helped collate information on the new portal, making my job much easier. Sushubh for running the India Broadband Forum which is the place to discuss DataFox related issues.

  1. #1 by Deepak on September 21, 2011 - 5:42 PM

    why we cannot get data from…
    http://selfcare.sdc.bsnl.co.in/
    datafox is not working with this……

  2. #2 by fanofDataFox on September 28, 2011 - 10:17 PM

    Bsnl isn’t providing details of data.bsnl.in anymore, instead new users have to use the selfcare portals. It ‘d be nice if you update DataFox to be able to retrieve data from selfcare websites as well. Thankyou.

  3. #3 by fanofDataFox on September 28, 2011 - 10:45 PM

    please add support for selfcare websites. By the way where is my previous comment, I thought I already posted xD

  4. #4 by vaidyanath on October 5, 2011 - 12:17 PM

    Hi,
    Data Fox is a great add-on to Firefox. It used to work well till last month with the MTNL web-site. However starting this month it shows the consumption as zero consistently, even though, i can log onto
    http://register.mtnl.net.in/mtnlWebInt/
    and check the current session history has consumtion.
    However, the “Viwe Usage Summary’ on MTNL site also shows current month usage as zero even though the “Monthly Balance Usage” seems to be changing
    Please help

  5. #5 by vs4vijay on January 5, 2012 - 3:12 PM

    nice project…

  6. #6 by Rahul on January 6, 2012 - 10:47 PM

    why we cannot get data from…
    http://selfcare.sdc.bsnl.co.in/
    datafox is not working with this……

  7. #8 by saurabh on January 15, 2012 - 7:07 PM

    Hi,
    BSNL is using chargeable bandwidth as the usage above the bandwidth limit (For the month) and it is 0 if it is below it. Hence surplus transfer = allowed – {tX}. Please do the needful so that the status bar becomes flawless.

    • #9 by Brian on January 16, 2012 - 2:32 AM

      Which site is this one?

      • #10 by saurabh on January 16, 2012 - 10:11 PM

      • #11 by saurabh on January 16, 2012 - 10:28 PM

        but then again, the above formula would not work as in night unlimited plans {tX} would include night (Free) download too. However BSNL does segregate them and allows us to download the same in xls format, (and we have to total the actual “unchargeable usage” and the “night unlimited usage”.

  8. #12 by HS on February 7, 2012 - 6:34 PM

    Tooltip doesn’t display details in FF 10 :(

    • #13 by Brian on May 5, 2012 - 8:55 PM

      I did notice this, but it appears to be working now in FF 12, correct?

  9. #14 by Nikhil on April 16, 2012 - 9:25 AM

    V 1.9.5 doesn’t seem to work with MTNL (BOM) users who need to log in with the “@a” option to check their usage. Can I help in anyway to include parsing that page? (Also a dev)

    • #15 by Brian on May 5, 2012 - 8:52 PM

      Thanks for the offer, the approach taken varies from site to site, and it has been a long time since I worked on DataFox. I’m trying to release an update in the next few weeks, if you can share your login details with me, I should be able to add support.

  10. #16 by SUTIRTHA BHAUMIK on May 4, 2012 - 8:19 PM

    Our eastern region portal http://selfcare.edc.bsnl.co.in
    is not working in datafox. Please fix this.

    • #17 by Brian on May 5, 2012 - 8:50 PM

      Could you share your username and password with me so I can add support for it?

      • #18 by SUTIRTHA BHAUMIK on June 28, 2012 - 11:05 AM

        Ya sure. I am leaving my username and password here. Please delete the post as soon you see it and do let me know after you have finished adding the support. I will change my password again.

        Username: drnripenb1
        Password: password

        • #19 by SUTIRTHA BHAUMIK on September 12, 2012 - 7:42 PM

          Brian, it seems you don’t have much time to add support for this software. I am changing my password for security again. Do let me know when you will get time. I will send it again to you.

(will not be published)