Programatically Access Statistics from 3G Mifi/Access Point!!

Specifically I’m going to talk about the Huawei MIFI (Mobile 3G Wifi) E585 though these could be applied to another access point/ mifi. You will need the web debugger FIDDLER (a http request sniffer).

So, probably your MIFI/access point is configured with IP address .

If there are pages that display the statistics (such as those on the E858) there is a chance the information can be accessed through a .php or other dynamic page.

On the E858, accessing displays the current total download/upload and flux for the current session. (pictures coming later).

However, if you want to check more analytical statistics such as total usage you have to log on. Fortunately, if the data screen uses a JQuery (or javascript ajax script)  fiddler can be used to sniff and discover the data source (post me a line for more instructions).

In the case of E858, all statistics are accessible through which includes current bit rate, total number of connected devices, DNS, etc,  without requiring http authentication.

Below is a quick proof of concept which parses the total usage (in gigabytes) and sends an e-mail when over a threshold.  It’s a proof of concept – not an actual robust app 😛 (feel free to extend though) .

The parsing of ipad.cgi for the E858 or other data sources for other devices can  be used to interesting tools and widgets not provided initially by the company software (if circumstances allow). In my case I plan to build a windows taskbar monitor to display total connected users, total data consumption, and real time info from my pc without logging into the MIFI.

Hope it helps!

[Download eclipse project here]

Imports go here…

public class Scan3GUsage {

    public static void main(String args[])
        double TotalFlux;
        double threshhold = 15.00;
                System.out.println(TotalFlux = readTotalConsumption());
                if(threshhold <= TotalFlux)
                try {
                } catch (InterruptedException e) {
    public static double readTotalConsumption()
        String tempString = null;
        try {
            URL myURL = new URL(“”);
            URLConnection myURLConnection =
            BufferedReader in = new BufferedReader(
                    new InputStreamReader(myURLConnection.getInputStream()));
            String inputLine;
            while ((inputLine = in.readLine()) != null)
            tempString = inputLine.substring(10,15);        //Must Account for MB, Other measurements

            return Double.parseDouble(tempString);
            catch (MalformedURLException e) {
            catch (IOException e) {   
        return -1;
    public static void sendEmail()
        Properties props = new Properties();
         props.put(“”, “”);
         props.put(“mail.smtp.socketFactory.port”, “465”);
         props.put(“mail.smtp.auth”, “true”);
         props.put(“mail.smtp.port”, “465”);
         Session session = Session.getDefaultInstance(props,
             new javax.mail.Authenticator() {
                 protected PasswordAuthentication getPasswordAuthentication() {
                     return new PasswordAuthentication(“account”,”password”);
         try {
             Message message = new MimeMessage(session);
             message.setFrom(new InternetAddress(“”));
             message.setRecipients(Message.RecipientType.TO,    InternetAddress.parse(“”));
             message.setSubject(“Over the Usage Limit”);
             message.setText(“Warning, you are over the 3G usage limit.”);
         } catch (MessagingException e) {
             throw new RuntimeException(e);



Menelaos Bakopoulos

Mr. Menelaos Bakopoulos is currently pursuing his PhD both at Center for TeleInFrastruktur (CTiF) at Aalborg University (AAU) in Denmark and Athens Information Technology (AIT) in Athens, Greece. He received a Master in Information Technology and Telecommunications Systems from Athens Information Technology and a B.Sc. in Computer Science & Management Information Systems from the American College of Thessaloniki. Since April 2008 he has been a member of the Multimedia, Knowledge, and Web Technologies Group.

More Posts