3

OpenJDK has the Device I/O (DIO) library, which can be used to read hardware sensors. One supported bus in the DIO library is I2C.

I have heard that desktop motherboard sensors are behind SMBus, basically a more restricted version of the I2C bus. Can I use DIO to read sensor data from my motherboard - for example, the CPU temperature?

If so, how?

Tuupertunut
  • 741
  • 7
  • 9
  • *I have heard* .. sources? and did you try getting started with JDK9 by any chance? – Naman Mar 02 '17 at 15:59
  • SMBus is a subset of I2C bus. Source: [Wikipedia](https://en.wikipedia.org/wiki/System_Management_Bus) `The SMBus was defined by Intel and Duracell in 1994. It carries clock, data, and instructions and is based on Philips' I²C serial bus protocol. Its voltage levels and timings are more strictly defined than those of I²C, but devices belonging to the two systems are often successfully mixed on the same bus.` – Tuupertunut Mar 02 '17 at 21:09
  • It appears, that DIO isn't part of JDK 9, but an OpenJDK project. I edited the question to reflect that. And no; I haven't tested it. – Tuupertunut Mar 02 '17 at 21:14

1 Answers1

1

the DIO library is exclusive to the Open JDK. It enables supported devices, currently ARMv6 and ARMv7 to read I2c. At the current state you have to build is yourself and compiling for the Raspberry Pi is the only supported Plattform.

In general reading motherboard sensor values is not an easy task, it depends on the vendor providing correct information. Unfortunately vendors are not using any kind of standardized protocol and the information's are all over the place and supporting different platforms is a task of its own.