It is currently April 20th, 2024, 3:45 am

Network meter bar is pegged 100% of the time.

Get help with creating, editing & fixing problems with skins
keithsplace
Posts: 7
Joined: December 5th, 2020, 3:30 pm

Network meter bar is pegged 100% of the time.

Post by keithsplace »

Everything seems to work fine except that the network meter bars are pegged out at 100% all the time.
Even with 0 activity on the text output.. I have played with the settings in the connection maxupload speed and maxdownload speed and refreshed and nothing changes.

Code: Select all

; Lines starting ; (semicolons) are commented out.
; That is, they do not affect the code and are here for demonstration purposes only.
; ----------------------------------

[Rainmeter]
; This section contains general settings that can be used to change how Rainmeter behaves.
Update=1000
Background=#@#Background.png
; #@# is equal to Rainmeter\Skins\illustro\@Resources
BackgroundMode=3
BackgroundMargins=0,34,0,14

[Metadata]
; Contains basic information of the skin.
Name=Network
Author=poiru
Information=Shows your IP address and network activity.
License=Creative Commons BY-NC-SA 3.0
Version=1.0.0

[Variables]
; Variables declared here can be used later on between two # characters (e.g. #MyVariable#).
fontName=Trebuchet MS
textSize=8
colorBar=235,170,0,255
colorText=255,255,255,205
maxDownload=10485760
MaxUpload=10485760
; Set maxDownload and maxUpload to your maximum download and upload speed in bits.
; To convert kilobits, megabits, kilobytes, and megabytes into bits, go to www.google.com
; and search for something like "10 megabytes in bits".

; ----------------------------------
; MEASURES return some kind of value
; ----------------------------------

[measureIP]
; This measure returns your IPv4 address. WebParser measures are relatively complicated. If you're a beginner with
; Rainmeter, take a look at some of the other illustro skins before modifying this one.
; For more information, go here: https://docs.rainmeter.net/tips/ipaddress
Measure=Plugin
Plugin=WebParser
URL=https://checkip.amazonaws.com/
UpdateRate=14400
RegExp=(?siU)^(.*)$
StringIndex=1
Substitute="":"N/A"
; Substitute works as follows: "A":"B" where A is a string to substitute and B is a string
; to substitute with. In this case, it substutes "" (i.e. empty) to N/A

[measureNetIn]
Measure=NetIn
NetInSpeed=#1073741824#
; NetInSpeed must be set so your maximun download speed for the download bar to scale correctly

[measureNetOut]
Measure=NetOut
NetOutSpeed=#10485760#

; ----------------------------------
; STYLES are used to "centralize" options
; ----------------------------------

[styleTitle]
StringAlign=Center
StringCase=Upper
StringStyle=Bold
StringEffect=Shadow
FontEffectColor=0,0,0,50
FontColor=#colorText#
FontFace=#fontName#
FontSize=10
AntiAlias=1
ClipString=1

[styleLeftText]
StringAlign=Left
; Meters using styleLeftText will be left-aligned.
StringCase=None
StringStyle=Bold
StringEffect=Shadow
FontEffectColor=0,0,0,20
FontColor=#colorText#
FontFace=#fontName#
FontSize=#textSize#
AntiAlias=1
ClipString=1

[styleRightText]
StringAlign=Right
StringCase=None
StringStyle=Bold
StringEffect=Shadow
FontEffectColor=0,0,0,20
FontColor=#colorText#
FontFace=#fontName#
FontSize=#textSize#
AntiAlias=1
ClipString=1

[styleBar]
BarColor=#colorBar#
BarOrientation=HORIZONTAL
SolidColor=235,170,0,255

[styleSeperator]
SolidColor=255,255,255,15

; ----------------------------------
; METERS display images, text, bars, etc.
; ----------------------------------

[meterTitle]
Meter=String
MeterStyle=styleTitle
; Using MeterStyle=styleTitle will basically "copy" the
; contents of the [styleTitle] section here during runtime.
X=100
Y=12
W=190
H=18
Text=Network
; Even though the text is set to Network, Rainmeter will display
; it as NETWORK, because styleTitle contains StringCase=Upper.

[meterIPLabel]
Meter=String
MeterStyle=styleLeftText
X=10
Y=40
W=190
H=14
Text=IP Address

[meterIPValue]
Meter=String
MeterStyle=styleRightText
MeasureName=measureIP
X=200
Y=0r
; r stands for relative. In this case, the Y postition of meterValueCPU is 0 pixels
; below the Y value of the previous meter (i.e it's the same as in meterLabelCPU).
W=190
H=14
Text=%1
; %1 stands for the value of MeasureName (measureIP in this case).

[meterSeperator]
Meter=Image
MeterStyle=styleSeperator
X=10
Y=52
W=190
H=1

[meterUploadLabel]
Meter=String
MeterStyle=styleLeftText
X=10
Y=60
W=190
H=14
Text=Upload

[meterUploadValue]
Meter=String
MeterStyle=styleRightText
MeasureName=measureNetOut
X=200
Y=0r
W=190
H=14
Text=%1B/s
NumOfDecimals=1
AutoScale=1
; Because measureIP returns the current upload speed in bytes, we must use AutoScale=1 to
; automatically scale the value into a more readable figure.

[meterUploadBar]
Meter=Bar
MeterStyle=styleBar
MeasureName=measureNetOut
X=10
Y=72
W=190
H=1

[meterDownloadLabel]
Meter=String
MeterStyle=styleLeftText
X=10
Y=80
W=190
H=14
Text=Download

[meterDownloadValue]
Meter=String
MeterStyle=styleRightText
MeasureName=measureNetIn
X=200
Y=0r
W=190
H=14
Text=%1B/s
NumOfDecimals=1
AutoScale=1

[meterDownloadBar]
Meter=Bar
MeterStyle=styleBar
MeasureName=measureNetIn
X=10
Y=92
W=190
H=1
User avatar
CodeCode
Posts: 1365
Joined: September 7th, 2020, 2:24 pm
Location: QLD, Australia

Re: Network meter bar is pegged 100% of the time.

Post by CodeCode »

your Max'values' need to be in the billions to represent GB. Trillions for TB. (millions for MB).


One MILLLLLION.
ƈǟռ'ȶ ʄɨӼ ɨȶ ɨʄ ɨȶ ǟɨռ'ȶ ɮʀօӄɛ - ʊռʟɛֆֆ ɨȶ ɨֆ ɨռ ƈօɖɛ.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5398
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Network meter bar is pegged 100% of the time.

Post by eclectic-tech »

This skin uses methods that have been modified over the years and there are a few errors in your code.

Here is an example that should help you update and simplify your code: A Network Sample Skin

In the [Variables] section you have incorrect values for the min/max speeds. I would recommend you use the values returned by SpeedTest to set these:

Code: Select all

[Variables]
; Variables declared here can be used later on between two # characters (e.g. #MyVariable#).
fontName=Trebuchet MS
textSize=8
colorBar=235,170,0,255
colorText=255,255,255,205
;Set these for sure
;http://speedtest.net
MaxDownloadMbits=33.82
MaxUploadMbits=4.85

In your network measure, set the min/max to those variables, use a multiplier converted to bits, and average the size to reduce "spiky" values:

Code: Select all

[measureNetIn]
Measure=NetIn
Interface=Best
MinValue=0
MaxValue=(#MaxDownloadMbits# * 1048576)
AverageSize=5

[measureNetOut]
Measure=NetOut
Interface=Best
MinValue=0
MaxValue=(#MaxUploadMbits# * 1048576)
AverageSize=5
This should get you closer to a working network skin with accurate displays. Feel free to ask any questions about the sample skin or this code.
keithsplace
Posts: 7
Joined: December 5th, 2020, 3:30 pm

Re: Network meter bar is pegged 100% of the time.

Post by keithsplace »

I get about 425 -480Mbps down and 23-27Mbps on Speedtest and most speed test sites on average. so I'm assuming My rated speed is 500Mbps down 25 up.

So my measure setting converted would be 500000000 down and 23000000.?
Is that correct?
keithsplace
Posts: 7
Joined: December 5th, 2020, 3:30 pm

Re: Network meter bar is pegged 100% of the time.

Post by keithsplace »

And at those settings it the same, meters pedded 100%.
I even trying to add more 0's, lots of them and still the same.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5398
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Network meter bar is pegged 100% of the time.

Post by eclectic-tech »

keithsplace wrote: December 6th, 2020, 3:49 pm I get about 425 -480Mbps down and 23-27Mbps on Speedtest and most speed test sites on average. so I'm assuming My rated speed is 500Mbps down 25 up.

So my measure setting converted would be 500000000 down and 23000000.?
Is that correct?
Please post the code you are using. I recommended a few changes, need to see the changes you made, and that way others can test what you have... Use the </> code tags.
keithsplace
Posts: 7
Joined: December 5th, 2020, 3:30 pm

Re: Network meter bar is pegged 100% of the time.

Post by keithsplace »

Here is code in use:

Code: Select all

; Lines starting ; (semicolons) are commented out.
; That is, they do not affect the code and are here for demonstration purposes only.
; ----------------------------------

[Rainmeter]
; This section contains general settings that can be used to change how Rainmeter behaves.
Update=1000
Background=#@#Background.png
; #@# is equal to Rainmeter\Skins\illustro\@Resources
BackgroundMode=3
BackgroundMargins=0,34,0,14

[Metadata]
; Contains basic information of the skin.
Name=Network
Author=poiru
Information=Shows your IP address and network activity.
License=Creative Commons BY-NC-SA 3.0
Version=1.0.0

[Variables]
; Variables declared here can be used later on between two # characters (e.g. #MyVariable#).
fontName=Trebuchet MS
textSize=8
colorBar=235,170,0,255
colorText=255,255,255,205
;Set these for sure
;http://speedtest.net
MaxDownloadMbits=437.26
MaxUploadMbits=23.34
; Set maxDownload and maxUpload to your maximum download and upload speed in bits.
; To convert kilobits, megabits, kilobytes, and megabytes into bits, go to www.google.com
; and search for something like "10 megabytes in bits".

; ----------------------------------
; MEASURES return some kind of value
; ----------------------------------

[measureIP]
; This measure returns your IPv4 address. WebParser measures are relatively complicated. If you're a beginner with
; Rainmeter, take a look at some of the other illustro skins before modifying this one.
; For more information, go here: https://docs.rainmeter.net/tips/ipaddress
Measure=Plugin
Plugin=WebParser
URL=https://checkip.amazonaws.com/
UpdateRate=14400
RegExp=(?siU)^(.*)$
StringIndex=1
Substitute="":"N/A"
; Substitute works as follows: "A":"B" where A is a string to substitute and B is a string
; to substitute with. In this case, it substutes "" (i.e. empty) to N/A

[measureNetIn]
Measure=NetIn
Interface=Best
MinValue=0
MaxValue=(#MaxDownloadMbits# * 43700000000)
AverageSize=5
; NetInSpeed must be set so your maximun download speed for the download bar to scale correctly

[measureNetOut]
Measure=NetOut
Interface=Best
MinValue=0
MaxValue=(#MaxUploadMbits# * 230000000)
AverageSize=5

; ----------------------------------
; STYLES are used to "centralize" options
; ----------------------------------

[styleTitle]
StringAlign=Center
StringCase=Upper
StringStyle=Bold
StringEffect=Shadow
FontEffectColor=0,0,0,50
FontColor=#colorText#
FontFace=#fontName#
FontSize=10
AntiAlias=1
ClipString=1

[styleLeftText]
StringAlign=Left
; Meters using styleLeftText will be left-aligned.
StringCase=None
StringStyle=Bold
StringEffect=Shadow
FontEffectColor=0,0,0,20
FontColor=#colorText#
FontFace=#fontName#
FontSize=#textSize#
AntiAlias=1
ClipString=1

[styleRightText]
StringAlign=Right
StringCase=None
StringStyle=Bold
StringEffect=Shadow
FontEffectColor=0,0,0,20
FontColor=#colorText#
FontFace=#fontName#
FontSize=#textSize#
AntiAlias=1
ClipString=1

[styleBar]
BarColor=#colorBar#
BarOrientation=HORIZONTAL
SolidColor=235,170,0,255

[styleSeperator]
SolidColor=255,255,255,15

; ----------------------------------
; METERS display images, text, bars, etc.
; ----------------------------------

[meterTitle]
Meter=String
MeterStyle=styleTitle
; Using MeterStyle=styleTitle will basically "copy" the
; contents of the [styleTitle] section here during runtime.
X=100
Y=12
W=190
H=18
Text=Network
; Even though the text is set to Network, Rainmeter will display
; it as NETWORK, because styleTitle contains StringCase=Upper.

[meterIPLabel]
Meter=String
MeterStyle=styleLeftText
X=10
Y=40
W=190
H=14
Text=IP Address

[meterIPValue]
Meter=String
MeterStyle=styleRightText
MeasureName=measureIP
X=200
Y=0r
; r stands for relative. In this case, the Y postition of meterValueCPU is 0 pixels
; below the Y value of the previous meter (i.e it's the same as in meterLabelCPU).
W=190
H=14
Text=%1
; %1 stands for the value of MeasureName (measureIP in this case).

[meterSeperator]
Meter=Image
MeterStyle=styleSeperator
X=10
Y=52
W=190
H=1

[meterUploadLabel]
Meter=String
MeterStyle=styleLeftText
X=10
Y=60
W=190
H=14
Text=Upload

[meterUploadValue]
Meter=String
MeterStyle=styleRightText
MeasureName=measureNetOut
X=200
Y=0r
W=190
H=14
Text=%1B/s
NumOfDecimals=1
AutoScale=1
; Because measureIP returns the current upload speed in bytes, we must use AutoScale=1 to
; automatically scale the value into a more readable figure.

[meterUploadBar]
Meter=Bar
MeterStyle=styleBar
MeasureName=measureNetOut
X=10
Y=72
W=190
H=1

[meterDownloadLabel]
Meter=String
MeterStyle=styleLeftText
X=10
Y=80
W=190
H=14
Text=Download

[meterDownloadValue]
Meter=String
MeterStyle=styleRightText
MeasureName=measureNetIn
X=200
Y=0r
W=190
H=14
Text=%1B/s
NumOfDecimals=1
AutoScale=1

[meterDownloadBar]
Meter=Bar
MeterStyle=styleBar
MeasureName=measureNetIn
X=10
Y=92
W=190
H=1
User avatar
balala
Rainmeter Sage
Posts: 16147
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Network meter bar is pegged 100% of the time.

Post by balala »

keithsplace wrote: December 8th, 2020, 9:08 pm Here is code in use:
The problem here is that the color of the bar and the color of the background are the same (namely 235,170,0,255), so you practically can't see the bar. See in the [styleBar] section that the color of the bars is set to BarColor=#colorBar# and the solid color of the same Bar meters is set to SolidColor=235,170,0,255. If you check the value of the colorBar variable within the [Variables] section you can easily get the color: colorBar=235,170,0,255. This is the same color, that's why you see those bars like there were always completely filled.
The solution is extremely simple: replace for instance the SolidColor option of the [styleBar] section with another color, for example: SolidColor=100,100,100,255
keithsplace
Posts: 7
Joined: December 5th, 2020, 3:30 pm

Re: Network meter bar is pegged 100% of the time.

Post by keithsplace »

Ok Got it..
Thanks....
one more question: Can you get the local IP address as well, or this machines IP?
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Network meter bar is pegged 100% of the time.

Post by jsmorley »

keithsplace wrote: December 10th, 2020, 11:25 pm Ok Got it..
Thanks....
one more question: Can you get the local IP address as well, or this machines IP?
Sure, you will just need to add a SysInfo plugin measure, and a meter to display the result.

Code: Select all

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

[Variables]

[MeasureLANIP]
Measure=Plugin
Plugin=SysInfo
SysInfoType=IP_ADDRESS
SysInfoData=Best
DynamicVariables=1

[MeasureWANIP]
Measure=WebParser
URL=https://checkip.amazonaws.com/
RegExp=(?siU)^(.*)$
StringIndex=1
RegExpSubstitute=1
Substitute="^$":"N/A"

[MeterIP]
Meter=String
MeasureName=MeasureLANIP
MeasureName2=MeasureWANIP
FontSize=12
FontWeight=400
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1
Text=LAN: %1		WAN: %2

1.jpg
You do not have the required permissions to view the files attached to this post.