It is currently March 28th, 2024, 9:09 pm

Changes to NetIn/NetOut/NetTotal and SysInfo.

Changes made during the Rainmeter 3.3 beta cycle.
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Changes to NetIn/NetOut/NetTotal and SysInfo.

Post by jsmorley »

We have changed the way you can select the Network Interface Controller in the Interface option of the NetIn/NetOut/NetTotal measures, and the SysInfoData option of the SysInfo plugin.

Check the manual entries at:

Net measures Interface option.

SysInfo SysInfoData option.

The long and the short of it is that you now have three options for defining the network interface to use in these measures.

For both SysInfo > SysInfoData and NetIn > Interface you will be able to:
1) Use the string value "Best", and it will figure it out.
2) Use the string value "Qualcomm Atheros AR938x Wireless Network Adapter" or whatever the name of your adapter is.
3) Use the same index number you use today (default 0)

When the option is set to Best, DyanmicVariables=1 must be set on the measure if you want it to to automatically react to changes in the active interface. This should be done if for instance you have a laptop or other computer that you switch between wired and wireless connections.

We believe that 95% or better of the time, "Best" is all you are going to need. However, if you have a configuration where "Best" isn't working as you want, (and the function does "prefer wired over wireless" if both have active connections) then you can use the name(s) of the adapters instead.

At the very worst, you would be able to have a variable for each adapter name that your system uses, and toggle between them in the values for the network measures.

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1

[Variables]
;BestInterface=Qualcomm Atheros AR938x Wireless Network Adapter
BestInterface=Best

[MeasureWANIP]
Measure=Plugin
Plugin=WebParser
URL=http://icanhazip.com/
RegExp=(?siU)^(.*)$
StringIndex=1
UpdateRate=30
OnConnectErrorAction=[!SetOption MeterWANIP Text "WAN IP: No Connection"][!UpdateMeter *][!Redraw]
FinishAction=[!SetOption MeterWANIP Text "WAN IP: %1"][!UpdateMeter *][!Redraw]

[MeasureNetIn]
Measure=NetIn
Interface=#BestInterface#

[MeasureNetOut]
Measure=NetOut
Interface=#BestInterface#

[MeasureNetTotal]
Measure=NetTotal
Interface=#BestInterface#

[MeasureNetTotalCumulative]
Measure=NetTotal
Interface=#BestInterface#
Cumulative=1

[MeasureAdapter]
Measure=Plugin
Plugin=SysInfo
SysInfoType=ADAPTER_DESCRIPTION
SysInfoData=#BestInterface#

[MeasureLANIP]
Measure=Plugin
Plugin=SysInfo
SysInfoType=IP_ADDRESS
SysInfoData=#BestInterface#
IfMatch=^$
IfMatchAction=[!SetOption MeterLANIP Text "LAN IP: No Connection"][!UpdateMeter *][!Redraw]
IfNotMatchAction=[!SetOption MeterLANIP Text "LAN IP: %1"][!UpdateMeter *][!Redraw]

[MeasureGateway]
Measure=Plugin
Plugin=SysInfo
SysInfoType=GATEWAY_ADDRESS
SysInfoData=#BestInterface#

[MeterBack]
Meter=Image
W=300
H=200
SolidColor=37,47,57,255

[MeterAdapterName]
Meter=String
MeasureName=MeasureAdapter
X=10
Y=10
W=280
ClipString=2
FontSize=11
FontColor=255,255,255,255
SolidColor=0,0,0,1
AntiAlias=1

[MeterGateway]
Meter=String
MeasureName=MeasureGateway
X=10
Y=10R
FontSize=11
FontColor=255,255,255,255
SolidColor=0,0,0,1
AntiAlias=1
Text=Gateway IP: %1

[MeterLANIP]
Meter=String
MeasureName=MeasureLANIP
X=10
Y=0R
FontSize=11
FontColor=255,255,255,255
SolidColor=0,0,0,1
AntiAlias=1
Text=LAN IP: %1

[MeterWANIP]
Meter=String
MeasureName=MeasureWANIP
X=10
Y=10R
FontSize=11
FontColor=255,255,255,255
SolidColor=0,0,0,1
AntiAlias=1
Text=WAN IP: %1

[MeterNetIn]
Meter=String
MeasureName=MeasureNetIn
X=10
Y=5R
FontSize=11
FontColor=255,255,255,255
SolidColor=0,0,0,1
AntiAlias=1
AutoScale=1
NumOfDecimals=1
Text=Network In: %1Bytes

[MeterNetOut]
Meter=String
MeasureName=MeasureNetOut
X=10
Y=0R
FontSize=11
FontColor=255,255,255,255
SolidColor=0,0,0,1
AntiAlias=1
AutoScale=1
NumOfDecimals=1
Text=Network Out: %1Bytes

[MeterNetTotal]
Meter=String
MeasureName=MeasureNetTotal
X=10
Y=0R
FontSize=11
FontColor=255,255,255,255
SolidColor=0,0,0,1
AntiAlias=1
AutoScale=1
NumOfDecimals=1
Text=Network Total: %1Bytes

[MeterNetTotalCumulative]
Meter=String
MeasureName=MeasureNetTotalCumulative
X=10
Y=5R
FontSize=11
FontColor=255,255,255,255
SolidColor=0,0,0,1
AntiAlias=1
AutoScale=1
NumOfDecimals=1
Text=Cumulative Total: %1Bytes
1.png
You do not have the required permissions to view the files attached to this post.
User avatar
Mordasius
Posts: 1167
Joined: January 22nd, 2011, 4:23 pm
Location: GMT +8

Re: Changes to NetIn/NetOut/NetTotal and SysInfo.

Post by Mordasius »

Just downloaded the latest beta version and found that my Network skin is causing the error message Cannot find interface "14" when I set the index number of the network interface controller using NetworkInterface=14 in the [Variables] section and Interface=#NetworkInterface# in the measure. Same error message if I set NetworkInterface=0.
In both cases it seems to default to Interface=0 with resultant over-estimates of the upload and download speeds.
error message.jpg
interface error.jpg
You do not have the required permissions to view the files attached to this post.
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Changes to NetIn/NetOut/NetTotal and SysInfo.

Post by jsmorley »

Mordasius wrote:Just downloaded the latest beta version and found that my Network skin is causing the error message Cannot find interface "14" when I set the index number of the network interface controller using NetworkInterface=14 in the [Variables] section and Interface=#NetworkInterface# in the measure. Same error message if I set NetworkInterface=0.
In both cases it seems to default to Interface=0 with resultant over-estimates of the upload and download speeds.
error message.jpg
interface error.jpg
We will look at this right away. Can you verify some behaviors on your system?

1) Does it work correctly with Best?
2) Does it work correctly with the name of the adapter specified?

Thank you, thank you for reporting this. I could poke a pencil in my eye that I didn't catch it during testing. This is a massive backwards compatibility issue that we will correct as soon as possible.
User avatar
Mordasius
Posts: 1167
Joined: January 22nd, 2011, 4:23 pm
Location: GMT +8

Re: Changes to NetIn/NetOut/NetTotal and SysInfo.

Post by Mordasius »

jsmorley wrote:We will look at this right away. Can you verify some behaviors on your system?
1) Does it still get an error if you use 14 right in the measure instead of using a #Variable#?
Yes. Same error messages.

2) Does it work correctly with Best?
Probably yes because it shows lower values than with Interface=0

3) Does it work correctly with the name of the adapter specified?

Using Interface=Atheros AR9271 Wireless Network Adapter results in exactly the same values as default value of Interface=0
User avatar
Brian
Developer
Posts: 2673
Joined: November 24th, 2011, 1:42 am
Location: Utah

Re: Changes to NetIn/NetOut/NetTotal and SysInfo.

Post by Brian »

Mordasius wrote:1) Does it still get an error if you use 14 right in the measure instead of using a #Variable#?
Yes. Same error messages.

2) Does it work correctly with Best?
Probably yes because it shows lower values than with Interface=0

3) Does it work correctly with the name of the adapter specified?
Using Interface=Atheros AR9271 Wireless Network Adapter results in exactly the same values as default value of Interface=0
Thanks Mordasius for the feedback!
I believe the issue(s) have been fixed, and we should have a beta out shortly.

Even us developers forget to look at our logs sometimes... :oops:

-Brian
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Changes to NetIn/NetOut/NetTotal and SysInfo.

Post by jsmorley »

The new beta is available at http://rainmeter.net.

Thanks once again for catching this Mordasius!
User avatar
Mordasius
Posts: 1167
Joined: January 22nd, 2011, 4:23 pm
Location: GMT +8

Re: Changes to NetIn/NetOut/NetTotal and SysInfo.

Post by Mordasius »

Thanks Brian / jsmorley,

A lumberjack friend that I never had would probably have said that if you don't keep your eye on the log when swinging an axe you can easily chop off a few toes.

Glad to hear that we will be able to use Interface=Best because the alternative of having to identify the appropriate interface number to get realistic values for upload and download was a real pain in the buttocks.

Update:

Just to confirm that I now get the same values for upload and download using Interface=14 or Interface=Best.

Thanks
User avatar
Brian
Developer
Posts: 2673
Joined: November 24th, 2011, 1:42 am
Location: Utah

Re: Changes to NetIn/NetOut/NetTotal and SysInfo.

Post by Brian »

Mordasius wrote:Just to confirm that I now get the same values for upload and download using Interface=14 or Interface=Best.

Thanks
Awesome! Thanks for reporting.

-Brian
User avatar
SilverAzide
Rainmeter Sage
Posts: 2588
Joined: March 23rd, 2015, 5:26 pm

Re: Changes to NetIn/NetOut/NetTotal and SysInfo.

Post by SilverAzide »

Hello,

I've tested the latest build of 3.3, and the SysInfo plugin appears to not be working in one instance. I hope I'm not doing something dumb:

[MeasureIPAddress]
Measure=Plugin
Plugin=SysInfo
SysInfoType=IP_ADDRESS
SysInfoData=<see below>
DynamicVariables=1

When I use SysInfoData=Best I get the correct result.
When I use SysInfoData=0 I get the expected result (a virtual adapter, just like in 3.2).
When I use my adapter name, as in SysInfoData=Intel(R) 82579LM Gigabit Network Connection, I get the correct result.
When I use the adapter index, as in SysInfoData=17, I get an empty string.

For the ADAPTER_DESCRIPTION, everything works like the above except when using the adapter index, where I am getting a return value of 0, which seems a little strange.

Just to clarify, the results of NetIn/NetOut/NetTotal are all OK (as reported by Mordasius above), this issue is specifically concerning the SysInfo plugin only.
Gadgets Wiki GitHub More Gadgets...
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Changes to NetIn/NetOut/NetTotal and SysInfo.

Post by jsmorley »

SilverAzide wrote:Hello,

I've tested the latest build of 3.3, and the SysInfo plugin appears to not be working in one instance. I hope I'm not doing something dumb:

[MeasureIPAddress]
Measure=Plugin
Plugin=SysInfo
SysInfoType=IP_ADDRESS
SysInfoData=<see below>
DynamicVariables=1

When I use SysInfoData=Best I get the correct result.
When I use SysInfoData=0 I get the expected result (a virtual adapter, just like in 3.2).
When I use my adapter name, as in SysInfoData=Intel(R) 82579LM Gigabit Network Connection, I get the correct result.
When I use the adapter index, as in SysInfoData=17, I get an empty string.

For the ADAPTER_DESCRIPTION, everything works like the above except when using the adapter index, where I am getting a return value of 0, which seems a little strange.

Just to clarify, the results of NetIn/NetOut/NetTotal are all OK (as reported by Mordasius above), this issue is specifically concerning the SysInfo plugin only.
SysInfo and the Net measures do not use the same index number. The Net measures are in a sense counting "interfaces", with "0" being "all" while SysInfo is counting "adapters", with "0" being "first". They get their information from two different places in Windows in two different ways, and they just have no relationship to each other. There is no way to reconcile them without breaking backwards compatibility. That ship has sailed.

So for me for instance I would have to to use Interface=4 and SysInfoData=1.

That is one of the primary reasons we created the functionality of "Best" or the "name" of the adapter. It wan't to reconcile the index numbers in the two different measures, that just can't be done. It was to in effect eliminate them, so you can use one much more sensible thing in both places.

For the vast majority of users and cases, you want

Interface=Best
SysInfoData=Best

In some very rare cases with multiple "active" interfaces, you might need

Interface=Intel(R) 82579LM Gigabit Network Connection
SysInfoData=Intel(R) 82579LM Gigabit Network Connection

I can't envision any case where those awful index numbers are going to be the right approach. They still work of course, but are also still as hideous as they ever were.

There could be a rare case, where you have multiple active interfaces, with more than one of them actually generating traffic at the same time, where you might want Interface=0, or "all" to measure all traffic. You need to know what you really have in your system though, as Interface=0 is just as likely to create "double" or "triple" values due to virtual interfaces in Windows. In any case, it can't work with SysInfoData, as there is no such thing as "all" IP_ADDRESS or "all" GATEWAY_ADDRESS. SysInfoData=0 just means "first".