It is currently May 2nd, 2024, 3:34 am

Ping Plugin always returns 0

Get help with creating, editing & fixing problems with skins
Naijeru
Posts: 5
Joined: August 28th, 2012, 6:38 pm

Ping Plugin always returns 0

Post by Naijeru »

I'm trying to use the PingPlugin to check my internet connection, however no matter what I do, the return value is always 0.

The measure is

Code: Select all

[MeasurePing]
Measure=Plugin
Plugin=Plugins\PingPlugin
DestAddress=blah.blah.blah.blah
Timeout=1000
TimeoutValue=0
IfEqualAction=!Execute [!RainmeterShowMeter MeterConnected][!RainmeterHideMeter MeterInternet][!

RainmeterHideMeter MeterInternet2][!RainmeterRedraw][!RainmeterEnableMeasure MeasureTextWiFi]
IfEqualValue=0
IfAboveAction=!Execute [!RainmeterHideMeter MeterConnected][!RainmeterShowMeter MeterInternet][!

RainmeterShowMeter MeterInternet2][!RainmeterRedraw][!RainmeterDisableMeasure MeasureTextWiFi]
IfAboveValue=0
UpdateDivider=2
Disabled=0
UpdateRate=2
And my display is

Code: Select all

[MeterInternet2]
Meter=STRING
x=85
y=15
FontColor=55, 55, 255
StringStyle=BOLD
FontSize=7
StringAlign=RIGHT
FontFace=Guifx v2 Transports
AntiAlias=1
Text=" 0"
Hidden=1
RightMouseDownAction=!Execute ["#SKINSPATH#\MDS\Extras\NetSettings"]

[MeterInternet]
Meter=STRING
x=86
y=15
FontColor=55, 255, 55
StringStyle=BOLD
FontSize=6
StringAlign=RIGHT
FontFace=Webdings
AntiAlias=1
Text=þ
Hidden=1

[MeterNetIn]
Meter=STRING
;MeasureName=MeasureNetIn
MeasureName=MeasurePing
X=74
Y=14
MeterStyle=NetInfo
I've set MeterNetIn to show the MeasurePing for debugging. Yet whether I use a valid, invalid, or local server. It always shows me a 0 regardless.

I'm running the current build from the frontpage, and win7 x64 with UAC turned off.

Am I being really stupid with this plugin? :(
User avatar
thatsIch
Posts: 446
Joined: August 7th, 2012, 9:18 pm

Re: Ping Plugin always returns 0

Post by thatsIch »

are you expecting a result for
"blah.blah.blah.blah"?

My suggestion: keep it simple bevor adding stuff like hidemeter etc.
just makes it more complicated for you to identify the problem source
User avatar
MerlinTheRed
Rainmeter Sage
Posts: 889
Joined: September 6th, 2011, 6:34 am

Re: Ping Plugin always returns 0

Post by MerlinTheRed »

Have you tried making the Timeout bigger? If your skin refreshes once per second, a Timeout that is also one second could be a little short.

Also, the IfEqualAction on MeasurePing will never do anything, because you don't have an IsEqualValue to trigger it.
Have more fun creating skins with Sublime Text 2 and the Rainmeter Package!
User avatar
Mordasius
Posts: 1173
Joined: January 22nd, 2011, 4:23 pm
Location: GMT +8

Re: Ping Plugin always returns 0

Post by Mordasius »

Assuming that your blah.blah.blah.blah is actually a real address like 122.55.94.221 for http://www.google.com, I suggest you try starting with something simple and building up from there e.g.

Code: Select all

[MeasurePing]
Measure=Plugin
Plugin=Plugins\PingPlugin
DestAddress=122.55.94.221
Timeout=10000
TimeoutValue=0
IfEqualValue=0
IfEqualAction=[!ShowMeter MeterTimedOut][!HideMeter MeterShowPing]
IfAboveValue=0
IfAboveAction=[!HideMeter MeterTimedOut][!ShowMeter MeterShowPing]

[MeterTimedOut]
Meter=STRING
Text=Ping Timed Out
Hidden=1

[MeterShowPing]
Meter=STRING
MeasureName=MeasurePing
Text="Ping return:  %1ms"
Hidden=1
Once that is working, you could play around with the values of Timeout, UpdateDivider and UpdateRate to set the level of timeout and how often you want to ping the desination. Note that with UpdateDivider=2 and UpdateRate=2 you are probably pinging the address every 4 seconds which might be the cause of your problem in the first place.
Naijeru
Posts: 5
Joined: August 28th, 2012, 6:38 pm

Re: Ping Plugin always returns 0

Post by Naijeru »

I'll have a go later (after work) with a .ini on it's own rather than as part of a bigger one.

In my first post (I probably should've made it clearer to read, sorry).

I said I was trying a combination of valid/invalid/local servers and all returned 0.

If I tried http://www.google.co.uk I got 0
If I tried blah.blah.blah.blah I get 0
If I try 127.0.0.1 I get 0
If I try 192.168.1.1 (router) I get 0

From a command line I get all pings back within a usual 12-43ms.

Edit: I did read a post from 2010 (I know, outdated) that ping was a plugin that didn't work on 64bit. But when I tried to find the post in the bug section (they didn't provide a link), I haven't found it yet. So I was more curious to know whether there is a bug with the plugin maybe not working on Win7 x64. If someone can confirm they have Win7 x64 that would also be helpful.


P.S. Hopefully my grammar is right, writing quickly from work isn't always easy :)
User avatar
lysy1993lbn
Posts: 291
Joined: July 25th, 2011, 9:53 am
Location: Lublin, Poland

Re: Ping Plugin always returns 0

Post by lysy1993lbn »

Do you have any firewall running?
"Never argue with an idiot, he will drag you down to his level and beat you with experience."
my deviantART | Alternative Rainmeter tray icons
Naijeru
Posts: 5
Joined: August 28th, 2012, 6:38 pm

Re: Ping Plugin always returns 0

Post by Naijeru »

I have Norton Internet Security running, but rainmeter.exe has been set to "Allowed" instead of "Auto" to forcefully allow it through. My weather plugin works okay and returns the rss feed from weather.com okay.
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Ping Plugin always returns 0

Post by jsmorley »

One thing to remember is that ping does not use the http: network protocol, and that addresses are hostnames on network domains (e.g. google.com) or IP addresses, (e.g. 74.125.227.110) and not web site addresses like http://SomeSite.com.