While browsing the Internet, we came across a post on the HWiNFO forum asking whether Yoctopuce modules could be used in the HWiNFO software. This isn't the case by default, but as we like to be of service to our users, we've written a little Python script that adds this functionality.
HWiNFO is a hardware monitoring software. It enables users to collect detailed information on their computer's hardware components, such as the processor, graphics card, memory, hard disks, and so on. HWiNFO can also provide data on temperatures, voltages, fan speeds, and other computer component parameters.
By default, Yoctopuce modules do not appear in this software, as they do not declare themselves as native sensors recognized by Windows, but as HID peripherals. It's thanks to this choice that Yoctopuce modules can operate without driver installation. We explained the reason for this choice in a previous post.
However, HWiNFO offers the possibility of using other sensors thanks to a plugin mechanism they have called "Custom user sensors". In concrete terms, a custom user sensor is simply a key in the Windows registry containing the last measured value. So, by writing a small gateway that updates these keys with the value of Yoctopuce sensors, it is possible to add Yoctopuce sensors to HWiNFO.
The logical structure of an HWiNFO sensor is as follows: a device can contain several sensors. For example, a graphics card may contain several fans and temperature sensors. This logical structure corresponds well to the architecture of our modules. For example, a Yocto-Meteo-V2 has several sensors (temperature, pressure, and humidity).
This means that to publish a Yoctopuce sensor in HWiNFO, all you have to do is create a sub-key in the Windows registry in the following format:
HKEY_CURRENT_USER\Software\HWiNFO64\Sensors\Custom\yoctopuce_serial\sensortype
This key contains three values:
- Name, which corresponds to the functionId of the Yoctopuce modules
- Unit, which is the unit of the sensor
- Value, which is the sensor's last measured value
The YoctoHWiNFO gateway
We decided to write a small program in Python that creates and updates these register keys. This gateway is available on GitHub.
To work, this gateway needs the Yoctopuce programming library, which you can install using pip.
pip install yoctopuce
Once you have installed the Yoctopuce library, simply run the script to make the modules available in HWiNFO.
C:\data\HWiNFO\HWiNFO>python YoctoHWiNFO.py Use hub usb Sensor LIGHTMK3-17EFC2.lightSensor added.
That's it, Yoctopuce sensors are now available
By default, this gateway adds Yoctopuce modules connected to USB ports, but it is possible to add sensors connected to a remote YoctoHub using the --remote_hub option.
C:\data\HWiNFO\HWiNFO>python YoctoHWiNFO.py --remote_hub 192.168.1.64 Use hub 192.168.1.64 Sensor YVOCMK02-AA4CB.voc added. Sensor RX420MA1-26FAD.genericSensor2 added. Sensor RX420MA1-26FAD.genericSensor1 added. Sensor METEOMK1-2AE60.temperature added. Sensor METEOMK1-2AE60.pressure added. Sensor METEOMK1-2AE60.humidity added. Sensor LIGHTMK3-32067.lightSensor added.
The -v option is used to increase the verbosity of the script. Level 1 displays all the operations performed, except for value updates. Level 2 logs all the value changes. The --use_HKEY_LOCAL_MACHINE option allows you to use the HKEY_LOCAL_MACHINE key instead of HKEY_CURRENT_USER.
The gateway source code is available on GitHub: https://github.com/yoctopuce-examples/HWiNFO_YoctoSensor It is royalty-free. It is inspired by the Prog-EventBased-Programming example included in our Python programming library.
Conclusion
Thanks to our programming library and HWiNFO extensions, you can add Yoctopuce sensors to the HWiNFO application. You can then monitor values not directly available in Windows, such as ambient brightness or air quality.