It is currently December 4th, 2022, 11:29 am

Gadgets 7.5.0 - inspired by AddGadgets.com Sidebar Gadgets

A package of skins with a "theme" or by a single author
User avatar
SilverAzide
Rainmeter Sage
Posts: 2175
Joined: March 23rd, 2015, 5:26 pm

Re: Gadgets 7.3.0 - inspired by AddGadgets.com Sidebar Gadgets

Post by SilverAzide »

provato wrote: May 7th, 2022, 12:26 pm Hi!

I have a problem with the button "List HWiNFO Indexes" at the "All CPU Meter Settings". It simply does nothing and the rainmeter log shows the following error:

Script: Settings.lua:349: attempt to index local 'file' (a nil value)

...and there is no "HWiNFOIndexList.txt" file in the @Resources folder. It's not created at all.

The button below it ("Edit HWiNFO Settings") works perfectly fine and opens HWiNFO.inc in notepad++.

I am no expert at lua scripting, but it seems the .txt file is not being written for some reason... I'd appreciate some help to make this button work, thanks
Well, you are the first person to report something like this. For some reason, the script is unable to create the output file in the @Resources folder. It sounds like there is something preventing this, like a permissions issue. Are you running Rainmeter in some unusual way (as a different user, or running elevated, etc.)? Are you able to change any other Gadget settings (this would also write changes to files in that same folder). What happens if you try to create a file with the name HWiNFOIndexList.txt in that folder?

If you can't get it to work, a work-around is to open a PowerShell prompt and enter the following command:

Code: Select all

reg query HKEY_CURRENT_USER\SOFTWARE\HWiNFO64\VSB | Select-String -Pattern 'Label.*' -AllMatches | % { $_.Matches } | % { $_.Value -replace 'Label(\d+)\s+\w+\s+(.*)', '$1 = $2' }
This will list the HWiNFO sensor indexes you have selected. Let me know how it goes.
Gadgets Wiki GitHub More Gadgets...
provato
Posts: 9
Joined: May 7th, 2022, 12:14 pm

Re: Gadgets 7.3.0 - inspired by AddGadgets.com Sidebar Gadgets

Post by provato »

Thanks for the quick response!
SilverAzide wrote: May 7th, 2022, 6:27 pmAre you running Rainmeter in some unusual way (as a different user, or running elevated, etc.)?
No I'm running Rainmeter the usual way, only one user in my PC (me - administrator account), I checked the start menu shortcut of Rainmeter and it's not configured to run elevated (as administrator), everything else works and all hwinfo sensors are reported properly in Gadgets skin. It's just this button that doesn't work.
SilverAzide wrote: May 7th, 2022, 6:27 pmAre you able to change any other Gadget settings (this would also write changes to files in that same folder).
Yes I've tried everything else pretty much in the settings. I can change colors, opacity, edges style, open HWiNFO.inc file, change double-click action and make it run task manager or perfmon, show or hide RAM, graphs, core temps etc. Everything works except "list HWiNFO indexes"
SilverAzide wrote: May 7th, 2022, 6:27 pmWhat happens if you try to create a file with the name HWiNFOIndexList.txt in that folder?
I've already tried that out of curiosity. The file remains a blank .txt file after selecting "list HWiNFO indexes" and after refresh of the skin and even after restart of rainmeter.
SilverAzide wrote: May 7th, 2022, 6:27 pmIf you can't get it to work, a work-around is to open a PowerShell prompt and enter the following command:

Code: Select all

reg query HKEY_CURRENT_USER\SOFTWARE\HWiNFO64\VSB | Select-String -Pattern 'Label.*' -AllMatches | % { $_.Matches } | % { $_.Value -replace 'Label(\d+)\s+\w+\s+(.*)', '$1 = $2' }
This will list the HWiNFO sensor indexes you have selected. Let me know how it goes.
Well, this command works perfectly fine. Here is the response I get:

Code: Select all

Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

Try the new cross-platform PowerShell https://aka.ms/pscore6

PS C:\WINDOWS\system32> reg query HKEY_CURRENT_USER\SOFTWARE\HWiNFO64\VSB | Select-String -Pattern 'Label.*' -AllMatches | % { $_.Matches } | % { $_.Value -replace 'Label(\d+)\s+\w+\s+(.*)', '$1 = $2' }
28 = Core VIDs
0 = Core 0 VID
1 = Core 1 VID
2 = Core 2 VID
3 = Core 3 VID
29 = Core Clocks
4 = Core 0 Clock
5 = Core 1 Clock
6 = Core 2 Clock
7 = Core 3 Clock (perf #1)
8 = Bus Clock
30 = Core Effective Clocks
9 = Core 0 T0 Effective Clock
10 = Core 0 T1 Effective Clock
11 = Core 1 T0 Effective Clock
12 = Core 1 T1 Effective Clock
13 = Core 2 T0 Effective Clock
14 = Core 2 T1 Effective Clock
15 = Core 3 T0 Effective Clock
16 = Core 3 T1 Effective Clock
17 = Average Effective Clock
31 = Core Usage
18 = Core 0 T0 Usage
19 = Core 0 T1 Usage
20 = Core 1 T0 Usage
21 = Core 1 T1 Usage
22 = Core 2 T0 Usage
23 = Core 2 T1 Usage
24 = Core 3 T0 Usage
25 = Core 3 T1 Usage
26 = Max CPU/Thread Usage
27 = Total CPU Usage
32 = CPU (Tctl/Tdie)
33 = CPU SOC
34 = APU GFX
40 = Core Temperatures
35 = Core0
36 = Core1
37 = Core2
38 = Core3
39 = L3 Cache
41 = CPU
42 = CPU
43 = CPU
44 = Fan2
45 = Read Activity
46 = Write Activity
47 = Total Activity
48 = Read Rate
49 = Write Rate
50 = Read Total
51 = Write Total
52 = GPU Temperature
53 = GPU Core Voltage (VDDCR_GFX)
54 = GPU Clock
55 = GPU Memory Clock
56 = GPU SoC Clock
57 = GPU VCN Clock
58 = GPU Utilization
59 = GPU D3D Usage
70 = GPU D3D Utilizations
60 = GPU Video Decode 0 Usage
61 = GPU Video Decode 1 Usage
62 = GPU Computing (High Priority Compute) Usage
63 = GPU Computing (Compute 0) Usage
64 = GPU Computing (Compute 1) Usage
65 = GPU D3D Memory Dedicated
66 = GPU D3D Memory Dynamic
67 = PCIe Link Speed
68 = GPU Memory Usage
69 = Framerate
PS C:\WINDOWS\system32>
User avatar
SilverAzide
Rainmeter Sage
Posts: 2175
Joined: March 23rd, 2015, 5:26 pm

Re: Gadgets 7.3.0 - inspired by AddGadgets.com Sidebar Gadgets

Post by SilverAzide »

provato wrote: May 7th, 2022, 7:20 pm
Hm... well, I have no idea what to tell you. For some reason, Lua isn't able to write that file. If you want to make a code change to see what the problem is, do the following:

Open the @Resources\Settings.lua file with a text editor. Locate the comment line "-- write to the file". Replace this block of code with the following:

Code: Select all

  -- write to the file
  local file, msg = io.open(fileName, "w")
  if not file then
    print(msg)
  else
    file:write(output)
    file:close()
  end
Refresh the Settings skin (or close and reopen), and click the "List HWiNFO Indexes" link. It should fail again, like before (although it might open the text editor with nothing showing or a message about a file not existing). Now, open the Rainmeter About dialog. On the Log tab, you should see a line with the reason the file could not be created.
Gadgets Wiki GitHub More Gadgets...
User avatar
SilverAzide
Rainmeter Sage
Posts: 2175
Joined: March 23rd, 2015, 5:26 pm

Re: Gadgets 7.3.0 - inspired by AddGadgets.com Sidebar Gadgets

Post by SilverAzide »

provato wrote: May 7th, 2022, 7:20 pm Well, this command works perfectly fine. Here is the response I get:
OK... great. This is the list of sensor indexes you selected. You can use this method as a work-around to get the index numbers to configure the variables until the file creation problem is identified.
Gadgets Wiki GitHub More Gadgets...
provato
Posts: 9
Joined: May 7th, 2022, 12:14 pm

Re: Gadgets 7.3.0 - inspired by AddGadgets.com Sidebar Gadgets

Post by provato »

SilverAzide wrote: May 7th, 2022, 7:40 pmOpen the @Resources\Settings.lua file with a text editor. Locate the comment line "-- write to the file". Replace this block of code with the following:

Code: Select all

  -- write to the file
  local file, msg = io.open(fileName, "w")
  if not file then
    print(msg)
  else
    file:write(output)
    file:close()
  end
Refresh the Settings skin (or close and reopen), and click the "List HWiNFO Indexes" link. It should fail again, like before (although it might open the text editor with nothing showing or a message about a file not existing). Now, open the Rainmeter About dialog. On the Log tab, you should see a line with the reason the file could not be created.
Sorry for the late answer,

Like you said, I edited the Settings.lua file and this time the button started notepad++ with the HWiNFOIndexList.txt file, but it was blank.
The Line with the reason you mentioned in the log tab reads this:

Code: Select all

N:\Rainmeter\Skins\Gadgets\@Resources\HWiNFOIndexList.txt: No such file or directory
I can see the HWiNFOIndexList.txt inside the @Resources folder (It is created automatically, but it's blank)

P.S.: I have my Skins in an SSD partition which has the letter N:\, you think maybe this is to blame?
provato
Posts: 9
Joined: May 7th, 2022, 12:14 pm

Re: Gadgets 7.3.0 - inspired by AddGadgets.com Sidebar Gadgets

Post by provato »

Sorry (again) for double-posting, but I have to mention that I solved the problem!!

I read somewhere that lua scripts are encoding sensitive, so I tried changing the encoding of the settings.lua file.
When I changed it from UTF-16 BE BOM to UTF-8 the "List HWiNFO Indexes" button worked!!!
It must be because my OS is in Greek I guess...

Anyway, thank you so much for taking the time to answer me and help me solve this, and keep up the good work, I love gadgets since windows vista/7
User avatar
SilverAzide
Rainmeter Sage
Posts: 2175
Joined: March 23rd, 2015, 5:26 pm

Re: Gadgets 7.3.0 - inspired by AddGadgets.com Sidebar Gadgets

Post by SilverAzide »

provato wrote: May 8th, 2022, 1:27 pm Sorry (again) for double-posting, but I have to mention that I solved the problem!!

I read somewhere that lua scripts are encoding sensitive, so I tried changing the encoding of the settings.lua file.
When I changed it from UTF-16 BE BOM to UTF-8 the "List HWiNFO Indexes" button worked!!!
It must be because my OS is in Greek I guess...

Anyway, thank you so much for taking the time to answer me and help me solve this, and keep up the good work, I love gadgets since windows vista/7
Interesting! Thanks for your detective work! I'll be sure to check into changing the encoding of all the Lua scripts for the next release of the Gadgets. I never would have imagined the file encoding would make a difference in this way.
Gadgets Wiki GitHub More Gadgets...
User avatar
SilverAzide
Rainmeter Sage
Posts: 2175
Joined: March 23rd, 2015, 5:26 pm

Re: Gadgets 7.3.0 - inspired by AddGadgets.com Sidebar Gadgets

Post by SilverAzide »

provato wrote: May 8th, 2022, 1:27 pm
jsmorley wrote: May 8th, 2022, 1:27 pm
Well, I'm confused... I followed the Lua instructions in this post by @jsmorley here Unicode and external files in Lua. But it seems the mention in the third post about io.open() failing has cropped up, even though there are no Unicode characters in the file path on your machine (as far as I can tell). There is a disconnect in here somewhere, and I don't see how to work around the problem short of not using Lua at all for this.

So, in summary, with a Lua file encoded in UTF16 LE BOM, the following code will fail on a machine running Greek Windows.

Code: Select all

local fileName = SKIN:GetVariable('@') .. 'HWiNFOIndexList.txt'    -- where @ is 'N:\Rainmeter\Skins\Gadgets\@Resources\'
local file = io.open(fileName, 'w')                                -- fails with 'No such file or directory', file is nil
file:write(output)
file:close()
And after changing the encoding of the Lua file to UTF8, the code will succeed. :confused:
Gadgets Wiki GitHub More Gadgets...
Kaboloy
Posts: 10
Joined: December 21st, 2019, 8:27 pm

Re: Gadgets 7.3.0 - inspired by AddGadgets.com Sidebar Gadgets

Post by Kaboloy »

Hello SilverAzide, hello forum users,

my english is not so good that I could understand it all but...
I have understand as far as I was able to configure the program at my new PC in combination with HWiNFO64 with the help of that tutorial so that it works for me now under Windows 10.
I use Rainmeter 4.5.13.3632 with the last Gadgets skin under Win10 64bit (Pro).

One thing makes me a little bit headache: In a user account (with limited rights on Windows 10 that means I'm not at the administrators group) I must start HWiNFO with admin-rights (right click -> Start as Admin -> Password input) and then Rainmeter with admin-rights too! Otherwise the values for the graphical card and some of the CPU not available. The fan speed at CPU Meter (only in %) is still not displayed - maybe is the reason that my motherboard sensor only transmit values in rpm?
Is it possible to change this?

Well, and is that normal with the permission of admin rights for operation with HWiNFO (and can it be a security risk)?
I think that HWiNFO for access of some of the sensors need advanced rights. But why can Rainmeter (with Gadgets Skin) not access of the values without advanced rights under a user account?

My sensor entry list looks as follows:

Code: Select all

HWiNFO Sensor Entry Index List

Index Sensor                                   Label                          Value
----- ---------------------------------------- ------------------------------ ---------------
0     System: GIGABYTE X570 AORUS ELITE        Auslastung der Auslagerungs... 0.0 %
1     CPU [#0]: AMD Ryzen 5 5600X: Enhanced    CPU (Tctl/Tdie)                49.0 °C
2     GIGABYTE X570 AORUS ELITE (ITE IT8688E)  CPU                            478 RPM
3     GIGABYTE X570 AORUS ELITE (ITE IT8688E)  System 3/PCH                   1849 RPM
4     GPU [#0]: NVIDIA GeForce RTX 3080:       GPU Temperatur                 55.2 °C
6     GPU [#0]: NVIDIA GeForce RTX 3080:       GPU Lüfter1                   0 RPM
7     GPU [#0]: NVIDIA GeForce RTX 3080:       GPU Lüfter2                   0 RPM
9     GPU [#0]: NVIDIA GeForce RTX 3080:       GPU-Speicher-Takt              101.3 MHz
10    GPU [#0]: NVIDIA GeForce RTX 3080:       GPU-Kern-Last                  7.0 %
11    GPU [#0]: NVIDIA GeForce RTX 3080:       GPU-Speicher-Nutzung           5.3 %
12    GPU [#0]: NVIDIA GeForce RTX 3080:       GPU Lüfter1                   0 %
13    GPU [#0]: NVIDIA GeForce RTX 3080:       GPU Lüfter2                   0 %
14    GPU [#0]: NVIDIA GeForce RTX 3080:       Zugeteilter GPU-Speicher       542 MB
5     GPU [#0]: NVIDIA GeForce RTX 3080:       GPU-Kern-Spannung              0.719 V
8     GPU [#0]: NVIDIA GeForce RTX 3080:       GPU Takt                       210.0 MHz
My configuration file looks in excerpts as follows:

Code: Select all

; ------------------------------------------ Motherboard -------------------------------------------
;
; CPU fan speed (RPM); one fan per physical CPU
HWiNFO_MOBO_CPUFanSpeed=2
HWiNFO_MOBO_CPU1FanSpeed=
HWiNFO_MOBO_CPU2FanSpeed=
HWiNFO_MOBO_CPU3FanSpeed=

; -------------------------------------------- GPU #0 ----------------------------------------------
;
;   (For AMD GPUs, see the "SPECIAL NOTE Regarding AMD GPUs" above.)
;   (HWiNFO may not show GPU #0 in cases where you have a dedicated graphics card.)
;
; GPU temperature (degrees)
HWiNFO_GPU0_Temp=4
; GPU core voltage (volts)
HWiNFO_GPU0_CoreVoltage=5
; GPU core clock frequency (MHz)
HWiNFO_GPU0_Clock=8
; GPU memory clock frequency (MHz)
HWiNFO_GPU0_MemoryClock=9
; GPU core load (percent)
HWiNFO_GPU0_CoreLoad=10
; GPU memory usage (percent)
;   NOTE: for *most* nVidia GPUs, this sensor reports the percentage of RAM in use
;   NOTE: for *rare* nVidia GPUs that do NOT have a sensor for memory usage (percent), you MUST set this value to blank
;   NOTE: for all AMD and Intel GPUs, you MUST set this value to blank since this sensor does not exist
HWiNFO_GPU0_MemoryUsage=11
; GPU memory allocated (MB)
;   NOTE: for nVidia GPUs, set the following value to the index of the "GPU Memory Allocated" sensor (i.e., amount of VRAM allocated, in megabytes)
;   NOTE: for *some* AMD GPUs, set the following value to the index of the "GPU Memory Usage" sensor (i.e., amount of VRAM allocated, in megabytes)
;   NOTE: for *most* AMD GPUs, set the following value to blank since there is no sensor available to report allocated VRAM
;   NOTE: for Intel GPUs, set the following value to blank since there is no sensor available to report allocated VRAM
HWiNFO_GPU0_MemoryAlloc=14
; GPU fan usage (percent, not RPM!)
;   IMPORTANT: if your GPU sensor does not report fan usage, set the following value to blank
HWiNFO_GPU0_FanUsage=12
HWiNFO_GPU0_FanUsage2=13
HWiNFO_GPU0_FanUsage3=
HWiNFO_GPU0_FanUsage4=
; GPU fan speed (RPM)
;   NOTE: the GPU fan speed sensor can be either on the graphics card or the motherboard, depending on your hardware
HWiNFO_GPU0_GPUFanSpeed=6
HWiNFO_GPU0_GPUFanSpeed2=7
HWiNFO_GPU0_GPUFanSpeed3=
HWiNFO_GPU0_GPUFanSpeed4=
I have CPU and GPU configured under/with the digit 0 (CPU #0/GPU #0). I don't know if that helps...

PS: It was not possible for me to configure a autostart function of HWiNFO64 with admin rights on a Windows user account :-(

Thanks for your attention!
Have a nice Sunday
User avatar
SilverAzide
Rainmeter Sage
Posts: 2175
Joined: March 23rd, 2015, 5:26 pm

Re: Gadgets 7.3.0 - inspired by AddGadgets.com Sidebar Gadgets

Post by SilverAzide »

Kaboloy wrote: May 22nd, 2022, 3:56 pm In a user account (with limited rights on Windows 10 that means I'm not at the administrators group) I must start HWiNFO with admin-rights (right click -> Start as Admin -> Password input) and then Rainmeter with admin-rights too!
Hello! The issue you are having with needing to run HWiNFO and Rainmeter as an admin is a known problem.

The source of the issue is how HWiNFO uses the registry to store sensor data. The Rainmeter and HWiNFO developers discussed this but the final decision was to leave things as they are, because changing the way HWiNFO works would break a lot of skins. So unfortunately there is nothing that can be done about this. To simplify things, you could create a small batch file to run both HWiNFO and Rainmeter elevated so that you don't have to run them separately and enter your password twice, but it won't solve your problem... it will only make it slightly less annoying.
Kaboloy wrote: May 22nd, 2022, 3:56 pm The fan speed at CPU Meter (only in %) is still not displayed - maybe is the reason that my motherboard sensor only transmit values in rpm?
Is it possible to change this?
Having a CPU fan speed sensor that reports speed (RPM) and not having one that reports usage (%) is normal. The CPU Meter will calculate the percentage for you. Make sure you enter a value for the maximum CPU fan speed.
fan.png
If you don't see something like this, post a screenshot or let me know what your settings are.
You do not have the required permissions to view the files attached to this post.
Gadgets Wiki GitHub More Gadgets...