It is currently April 27th, 2024, 6:40 pm

SysInfo doesn't work for GATEWAY_ADDRESS

Get help with creating, editing & fixing problems with skins
RainyDaze
Posts: 3
Joined: February 13th, 2024, 2:28 pm

SysInfo doesn't work for GATEWAY_ADDRESS

Post by RainyDaze »

In my skin, I have:
[measureGW]
Measure=SysInfo
SysInfoType=GATEWAY_ADDRESS
SysInfoData=Ethernet


This does not work, it displays 0 instead of the Default Gateway IP Address of the Network Adapter called 'Ethernet'.
ipconfig shows the expected values.

If I replace GATEWAY_ADDRESS with IP_ADDRESS it works fine, displaying the IP Address of the network adapter.

Any ideas?

I've tried SysInfoData=0, 1 2 etc. and SysInfoType=GATEWAY_ADDRESS_V4, but it's the same result
I get the same result if I use SysInfoType=RainyDaze!
Has anyone got this working?
Last edited by RainyDaze on February 13th, 2024, 3:58 pm, edited 1 time in total.
User avatar
balala
Rainmeter Sage
Posts: 16178
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: SysInfo doesn't work for GATEWAY_ADDRESS

Post by balala »

Try using the default SysInfoData=Best option (or simply remove the SysInfoData option, to use its default value).
RainyDaze
Posts: 3
Joined: February 13th, 2024, 2:28 pm

Re: SysInfo doesn't work for GATEWAY_ADDRESS

Post by RainyDaze »

@balala same result I'm afraid
User avatar
balala
Rainmeter Sage
Posts: 16178
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: SysInfo doesn't work for GATEWAY_ADDRESS

Post by balala »

RainyDaze wrote: February 13th, 2024, 3:44 pm @balala same result I'm afraid
Then no more idea from my part. Someone else will have to help you here. Sorry...
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 »

RainyDaze wrote: February 13th, 2024, 3:11 pm In my skin, I have:
[measureGW]
Measure=SysInfo
SysInfoType=GATEWAY_ADDRESS
SysInfoData=Ethernet


This does not work, it displays 0 instead of the Default Gateway IP Address of the Network Adapter called 'Ethernet'.
ipconfig shows the expected values.

If I replace GATEWAY_ADDRESS with IP_ADDRESS it works fine, displaying the IP Address of the network adapter.

Any ideas?

I've tried SysInfoData=0, 1 2 etc. and SysInfoType=GATEWAY_ADDRESS_V4, but it's the same result
I get the same result if I use SysInfoType=RainyDaze!
Has anyone got this working?
This works for me:

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

---Meters---

[Result]
Meter=String
AntiAlias=1
MeasureName=Outcome
Text=Result = %1
DynamicVariables=1
Does it work for you?
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
balala
Rainmeter Sage
Posts: 16178
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: SysInfo doesn't work for GATEWAY_ADDRESS

Post by balala »

Yincognito wrote: February 13th, 2024, 7:14 pm Does it work for you?
Don't know if it works for OP, however you gave me an idea. Your description about how to get the proper SysInfoData (the commented out line in the [Outcome] measure of your code) proved correct. According to it, I got the name of my adapter and got the code working with that name. Even if in my case the SysInfoData=Best does work, if for anyone it doesn't, using your description anyone can get the proper value of this option and can use it to get the proper gateway.
Not sure I am correct, but hope I am...
User avatar
SilverAzide
Rainmeter Sage
Posts: 2613
Joined: March 23rd, 2015, 5:26 pm

Re: SysInfo doesn't work for GATEWAY_ADDRESS

Post by SilverAzide »

Powershell:

Code: Select all

Get-WmiObject -Class MSFT_NetAdapter -Namespace root\StandardCimv2 | Sort-Object -Property InterfaceType, Virtual, InterfaceDescription | Format-Table -Property @{Label='Interface Name'; Expression={$_.InterfaceDescription}}, @{Label='Connection'; Expression={$_.Name}}, Virtual, State, @{Label='Type'; Expression={$_.InterfaceType}} -AutoSize
Using either the "Interface Name" or "Connection Name" in SysInfoData should work. Make sure your Connection Name matches what you see via this command. Windows sometimes "helpfully" hides the numeric suffix.
Gadgets Wiki GitHub More Gadgets...
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 13th, 2024, 7:27 pm Don't know if it works for OP, however you gave me an idea. Your description about how to get the proper SysInfoData (the commented out line in the [Outcome] measure of your code) proved correct. According to it, I got the name of my adapter and got the code working with that name. Even if in my case the SysInfoData=Best does work, if for anyone it doesn't, using your description anyone can get the proper value of this option and can use it to get the proper gateway.
Not sure I am correct, but hope I am...
Yep, there are lots of ways to get the proper value for SysInfoData in this case, either through Windows Settings, Control Panel, Rainmeter itself (with or without the Debug box being checked), PowerShell (like SilverAzide described), command line, etc. I imagined the Windows Settings way would be "easier" / more "friendly" for the regular user, that's why I added that comment about it. When things don't work, simplifying them sometimes helps.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
RainyDaze
Posts: 3
Joined: February 13th, 2024, 2:28 pm

Re: SysInfo doesn't work for GATEWAY_ADDRESS

Post by RainyDaze »

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:

Code: Select all

[measureGW1]
Measure=Plugin
Plugin=Plugins\RunCommand.dll
Program=PowerShell
Parameter=(Get-WmiObject -Class Win32_NetworkAdapterConfiguration -Property DefaultIPGateway).DefaultIPGateway
OutputType=ANSI
UpdateRate=14400
OnOutputAction=[!CommandMeasure measureGW1 "Run"]
Last edited by balala on February 15th, 2024, 3:11 pm, edited 1 time in total.
Reason: Please use <code> tags whenever are you posting codes. It's the </> button.
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 »

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:
[measureGW1]
Measure=Plugin
Plugin=Plugins\RunCommand.dll
Program=PowerShell
Parameter=(Get-WmiObject -Class Win32_NetworkAdapterConfiguration -Property DefaultIPGateway).DefaultIPGateway
OutputType=ANSI
UpdateRate=14400
OnOutputAction=[!CommandMeasure measureGW1 "Run"]
That's strange. By the way, there's no OnOutputAction in Rainmeter (or maybe you misspelled OnUpdateAction), so you should forget about Rainmeter for a moment and first try the appropriate command to get the gateway address in PowerShell itself. Also, just to be sure, does the Settings location mentioned in the code comment above provide any gateway addresses? Some screenshots with the retrieved and not retrieved gateway might help to at least identify where the problem resides.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth