Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Network Download/Upload Meter


  • Please log in to reply
60 replies to this topic
SKAN
  • Administrators
  • 9115 posts
  • Last active:
  • Joined: 26 Dec 2005

after discussing with Skan about the discrepancy between the script and netstat.exe, in this very thread, I realized that the loopback (24, in your first interface 1 : 24 : 5, indicates it's a loopback interface) may not be a particular target of netstat.exe. It may simply try to sum up the data of all the interfaces.

So, I may also do it here.
What I'm concerned atm is, however, whether we have to include the loopback interface too or not.
I'd like to hear about the opinion of yours and other users on it.


Sean, try LanSpeed2 when you have time: <!-- m -->http://httpd.chello....nosta/orcasoft/<!-- m --> . It allows you to select an adaptor, and you can run multiple instances by renameing the exe. The setback is that it has too much fancy things that one does not need.

We may run in to compare the results.

My existing setup is :
NIC attached to a ADSL2 / 256Kbps / Data Limit: Day Usage: 1GB Data per month / Night usage: Unlimited.

The existing script helps me to keep a check on Sent/Recvd so that I do not exceed my day usage bandwidth limits. My previous attempt was to ControlGetText from LAN dialog and show the bandwidth on the start button. But I could never automate the opening of the dialog :(. ( See: How to start the "Local Area Connection Status" )

Now I have decided to sign for an additional ISP for better browsing speed. ( I will be retaining the current for my downloading needs ). I will be adding another NIC and modem and will be simulataneously using both the connections from different browsers. ( I am yet to find if it possible :roll: )

The additional setup would be:
Additional NIC attached to a ADSL2 / 2Mbps / Data Limit: A meagre 350MB per month.

So my future script will have to monitor and display data for two adaptors with a single script in a compact GUI. :roll:

Sean
  • Members
  • 2462 posts
  • Last active: Feb 07 2012 04:00 AM
  • Joined: 12 Feb 2007

Sean, try LanSpeed2 when you have time: <!-- m -->http://httpd.chello....nosta/orcasoft/<!-- m --> . It allows you to select an adaptor, and you can run multiple instances by renameing the exe. The setback is that it has too much fancy things that one does not need.

Thanks for the link. I'll try it later as I have to update a few other scripts first.

My previous attempt was to ControlGetText from LAN dialog and show the bandwidth on the start button. But I could never automate the opening of the dialog :(. ( See: How to start the "Local Area Connection Status" )

It turned out difficult to do it than I thought.
I'm controlling, i.e., enable/disable a network adapter, using FolderItem Verb COM. As the status verb is just the second verb, I expected it to work with VerbItem to 1 (it's 0-based) but nothing happened!

It didn't work even with explorer.exe (:file-manager, not the shell) if setting to use separate (explorer.exe) processes for the shell and for the file-manager.

I presume atm that some neccessary modules are not loaded into the file-manager explorer.exe.

So, unless you configured to show networt connection tray icon, it would be very hard to find a solution.
If the tray icon is shown, then it's easy to pop up the status dialog.

Now I have decided to sign for an additional ISP for better browsing speed. ( I will be retaining the current for my downloading needs ). I will be adding another NIC and modem and will be simulataneously using both the connections from different browsers. ( I am yet to find if it possible :roll: )

Is that possible?
Anyway, I think I have to wait a while to hear opinions of other users before updating the script.

Sean
  • Members
  • 2462 posts
  • Last active: Feb 07 2012 04:00 AM
  • Joined: 12 Feb 2007
Hi Chris,

This is no big deal because my config isn't typical: Neither the topmost script nor Skan's works on my system, probably because I have a NIC for LAN and another for Internet (so perhaps the script is monitoring the LAN one).

1 : 24 : 5
65539 : 6 : 5
65540 : 6 : 5


I uploaded a second script at the top post, which tries to add up the data of all available interfaces.
You may use it temporarily until final version is completed.
If there is still a problem, please let me know.

Chris
  • Administrators
  • 10727 posts
  • Last active:
  • Joined: 02 Mar 2004
Yes, it seems to work great. Thanks!

ai4fu
  • Members
  • 20 posts
  • Last active: Feb 24 2013 11:22 PM
  • Joined: 09 Dec 2007
I grabbed both of these scripts (Sean's on page 1 and Skan's on page 2) and wanted to modify them both in different ways. A pointer in the right direction would be useful ( and if you've the patience, the reasoning for it! helps me learn!)

Network Download/Upload Meter:

Removed the /1024 part in order to show my very variable network card connection. I am mobile 5 days a week... but that is only effective when I am on an "RTT" connection. When i get to an "EVDO" area my speed can go all the way to 2Mb/s+. What I am looking for is a way to make the bar graph logarithmic...

And for Skan's "Netmeter" script I was hoping to find a way to tell the script to look for the bitmap in a local, non-temporary directory so that it doesn't have to dl it every time... (again with explanations so I can learn instead of "mooching" all the time... I need all the help I can get... :? )

Thanks
Jim

SKAN
  • Administrators
  • 9115 posts
  • Last active:
  • Joined: 26 Dec 2005

And for Skan's "Netmeter" script I was hoping to find a way to tell the script to look for the bitmap in a local, non-temporary directory so that it doesn't have to dl it every time...


That bitmap is just 2 pixel with a size of mere 62 bytes :shock:
Looks like a dirt particle when opened in a browser.
<!-- m -->https://ahknet.autoh...les/grad001.bmp<!-- m -->

BTW, I wrote it in W2K and icons numbers are inconsistent when run in XP.

:)

Sean
  • Members
  • 2462 posts
  • Last active: Feb 07 2012 04:00 AM
  • Joined: 12 Feb 2007

What I am looking for is a way to make the bar graph logarithmic...

AHK has a built-in logarithmic functions: Log()/Ln(). You may use it.

ai4fu
  • Members
  • 20 posts
  • Last active: Feb 24 2013 11:22 PM
  • Joined: 09 Dec 2007

That bitmap is just 2 pixel with a size of mere 62 bytes :shock:
Looks like a dirt particle when opened in a browser.
<!-- m -->https://ahknet.autoh...les/grad001.bmp<!-- m -->

You are absolutely correct, it IS minute... however I just wanted help on how to make it find the file locally, if it exists, THEN dl it if not, and save it where it could be found next time, not in the temp dir, that gets dumped too frequently...

AHK has a built-in logarithmic functions: Log()/Ln(). You may use it.

Yep, found that, but I tried to use it as a log of the divisor:
dnRate := Round((dnNew - dnOld) / [color=orange]log(1024)[/color])
upRate := Round((upNew - upOld) /[color=orange] log(1024)[/color])
...but that did not quite produce the desired result. I was thinking of trying this instead:
[color=orange]log(dnRate)[/color] := Round((dnNew - dnOld) / 1024)
[color=orange]log(upRate)[/color] := Round((upNew - upOld) / 1024)
...but I doubt it will work. :?
Thank you both for the pointers... :)

Nope...it didn't work :oops:

Sean
  • Members
  • 2462 posts
  • Last active: Feb 07 2012 04:00 AM
  • Joined: 12 Feb 2007

dnRate := Round((dnNew - dnOld) / [color=orange]log(1024)[/color])
upRate := Round((upNew - upOld) /[color=orange] log(1024)[/color])

You may use this:
dnRate := Round(ln(dnNew - dnOld + 1) * 8)
upRate := Round(ln(upNew - upOld + 1) * 8)


ai4fu
  • Members
  • 20 posts
  • Last active: Feb 24 2013 11:22 PM
  • Joined: 09 Dec 2007
Thanks Sean!

The first one did the trick nicely. It is now speed proportionate from just a bare few kb/s out in the rural areas to nearly full graph at 850 kb/s.

I must admit that I could not find a "progress control" as you put it but I guessed at it...let me know if I got it right

Gui, -Caption +Border +AlwaysOnTop +ToolWindow
Gui, Color, 00FF00
Gui, +LastFound
WinSet, TransColor, EEAA99
Gui, Add, Progress,      w100 h10 cGreen -0x1 vDn [color=orange]Range0-12[/color]
Gui, Add, Progress, x+10 w100 h10 cRed   -0x1 vUp [color=orange]Range0-12[/color]
Gui, Show, x780 y20 , NetMeter                  ; Adjust X & Y to suit your screen res

If GetIfTable(tb)
   ExitApp

Jim

Sean
  • Members
  • 2462 posts
  • Last active: Feb 07 2012 04:00 AM
  • Joined: 12 Feb 2007

I must admit that I could not find a "progress control" as you put it but I guessed at it...let me know if I got it right

I realized that as you're new to AHK, and I think you got it right.
BTW, I updated the code so as to need not put Range. It may be better one as its range is fine-grained between 0-100, which is the default one, than 0-12. I multiplied 8 as you said the rate was 2Mbps. If it's 850Kbps, may use 8.6 instead. Or you may use log instead of ln with multiplying one between 19 and 20.

ai4fu
  • Members
  • 20 posts
  • Last active: Feb 24 2013 11:22 PM
  • Joined: 09 Dec 2007
I should have qualified the 850... that was just the best speed it has gone to since I have made those changes you suggested. I do see 2Mb/s occasionally, but only in major metro areas, and then usually only when downloading torrents. Most of the time my speed ranges from 5kb/s to 500Kb/s, with the best ever at 2.86Mb/s The changes you have suggested make it work great now, exactly what I had wanted.

And yes, I am very new to AHK, indeed, I am new to scripting at all. Trust me, if there was a web page for "AHK for dummies" that's where I would be. :lol:

Most of what I do with AHK is cutting and pasting existing scripts and making changes to suit my particular needs. I have a hard time making new scripts. Just don't know enough...which is why I ask so many questions.

Thanks for your help. Seriously.

Thalon
  • Members
  • 641 posts
  • Last active: Jan 02 2017 12:17 PM
  • Joined: 12 Jul 2005
Didn't see this topic before, but it works nicely here.
I might take it as a baseground to build "Netmeter" in AHK out of it :)

Thalon

Sean
  • Members
  • 2462 posts
  • Last active: Feb 07 2012 04:00 AM
  • Joined: 12 Feb 2007

I might take it as a baseground to build "Netmeter" in AHK out of it :)

Good to hear it. Of course you'll share it?

noisex
  • Guests
  • Last active:
  • Joined: --
Upload meter