It is currently April 27th, 2024, 8:07 pm

SysInfo doesn't work for GATEWAY_ADDRESS

Get help with creating, editing & fixing problems with skins
User avatar
balala
Rainmeter Sage
Posts: 16179
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: SysInfo doesn't work for GATEWAY_ADDRESS

Post by balala »

RainyDaze wrote: February 15th, 2024, 10:33 am No, still not working. I'm using Rainmeter 4.5.13.3632 (64bit) on Windows 10 Enterprise N 2016 LTSB 1607 64-bit (build 14393)
I get nothing in the logs, other than reading the ini files and 'Refreshing skin'
I've tried with the following but it just returned blank:
I think you get the blank result because you didn't run the plugin measure. To this try out, try adding the following option to the [Rainmeter] section: LeftMouseUpAction=[!CommandMeasure "measureGW1" "Run"]. With this option added you can get the [measureGW1] measure executed when you left click wherever on your skin, where is not defined another LeftMouseUpAction option (hope there is such a place). As Yincognito mentioned, there is no OnOutputAction option in Rainmeter, so if you don1T have somewhere else the above !CommandMeasure bang, you get never the measure executed.

Additional tip: Even if it works, the correct syntax of the Plugin option is Plugin=RunCommand, not Plugin=Plugins\RunCommand.dll. For backward compatibility reasons your syntax works, but strictly speaking it's not correct. However not getting the measure working can't be explained this way.
User avatar
Yincognito
Rainmeter Sage
Posts: 7178
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: SysInfo doesn't work for GATEWAY_ADDRESS

Post by Yincognito »

balala wrote: February 15th, 2024, 3:26 pm I think you get the blank result because you didn't run the plugin measure. [...] As Yincognito mentioned, there is no OnOutputAction option in Rainmeter, so if you don1T have somewhere else the above !CommandMeasure bang, you get never the measure executed.
That's why I mentioned the possibility that he misspelled OnUpdateAction, because changing OnOutputAction to OnUpdateAction will in fact run the measure from itself, so to speak. Obviously, a FinishAction=[!UpdateMeter *][!Redraw] to update whatever meter is displaying the gateway address is recommended, otherwise one won't see anything for the simple reason that while the measure will work and run, the meter won't show the measure's value when the latter retrieves its data:

Code: Select all

[Variables]

[Rainmeter]
Update=1000
AccurateText=1
DynamicWindowSize=1
BackgroundMode=2
SolidColor=0,255,0,255

---Measures---

[Outcome]
Measure=SysInfo
SysInfoType=GATEWAY_ADDRESS
SysInfoData=Best
; or Start > Settings > Network & Internet > View Hardware And Connection Properties > (an adapter whose Connectivity has Internet) > Description
DynamicVariables=1

[measureGW1]
Measure=Plugin
Plugin=Plugins\RunCommand.dll
Program=PowerShell
Parameter=(Get-WmiObject -Class Win32_NetworkAdapterConfiguration -Property DefaultIPGateway).DefaultIPGateway
OutputType=ANSI
UpdateDivider=240
OnUpdateAction=[!CommandMeasure measureGW1 "Run"]
FinishAction=[!UpdateMeter *][!Redraw]

---Meters---

[Result]
Meter=String
AntiAlias=1
MeasureName=Outcome
MeasureName2=measureGW1
Text=Outcome = %1#CRLF#measureGW1 = %2
DynamicVariables=1
Gateway.jpg
Also, there's no UpdateRate for a RunCommand measure, so a proper UpdateDivider must be used instead (the one above will update - and run, via the OnUpdateAction - the measure every 4 minutes). Obviously, it's just an example, no need to get the gateway address that frequently.
You do not have the required permissions to view the files attached to this post.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
balala
Rainmeter Sage
Posts: 16179
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: SysInfo doesn't work for GATEWAY_ADDRESS

Post by balala »

Yincognito wrote: February 15th, 2024, 4:28 pm That's why I mentioned the possibility that he misspelled OnUpdateAction, because changing OnOutputAction to OnUpdateAction will in fact run the measure from itself, so to speak.
Once per second. Too much, in my opinion (and yours as well, I think, based on your last sentence).
Yincognito wrote: February 15th, 2024, 4:28 pm Obviously, a FinishAction=[!UpdateMeter *][!Redraw] to update whatever meter is displaying the gateway address is recommended, otherwise one won't see anything for the simple reason that while the measure will work and run, the meter won't show the measure's value when the latter retrieves its data:
Why wouldn't see it? The skin is set to get updated once per second, so even if one update cycle later, but the result is shown (tried it out).
User avatar
Yincognito
Rainmeter Sage
Posts: 7178
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: SysInfo doesn't work for GATEWAY_ADDRESS

Post by Yincognito »

balala wrote: February 15th, 2024, 4:45 pm Once per second. Too much, in my opinion (and yours as well, I think, based on your last sentence).

Why wouldn't see it? The skin is set to get updated once per second, so even if one update cycle later, but the result is shown (tried it out).
You're right on both accounts. I suppose I added the FinishAction out of habit, to account for the case where the meter has an UpdateDivider=-1 set on it (which some folks - like me - often do, to save resources when possible). So yep, for this specific code, it will work without it as well. :thumbup:
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth