{"action":"created","issue":{"url":"https://api.github.com/repos/dblock/oshi/issues/119","repository_url":"https://api.github.com/repos/dblock/oshi","labels_url":"https://api.github.com/repos/dblock/oshi/issues/119/labels{/name}","comments_url":"https://api.github.com/repos/dblock/oshi/issues/119/comments","events_url":"https://api.github.com/repos/dblock/oshi/issues/119/events","html_url":"https://github.com/dblock/oshi/issues/119","id":135572275,"number":119,"title":"OS temprature","user":{"login":"Amjad121092","id":1808602,"avatar_url":"https://avatars.githubusercontent.com/u/1808602?v=3","gravatar_id":"","url":"https://api.github.com/users/Amjad121092","html_url":"https://github.com/Amjad121092","followers_url":"https://api.github.com/users/Amjad121092/followers","following_url":"https://api.github.com/users/Amjad121092/following{/other_user}","gists_url":"https://api.github.com/users/Amjad121092/gists{/gist_id}","starred_url":"https://api.github.com/users/Amjad121092/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Amjad121092/subscriptions","organizations_url":"https://api.github.com/users/Amjad121092/orgs","repos_url":"https://api.github.com/users/Amjad121092/repos","events_url":"https://api.github.com/users/Amjad121092/events{/privacy}","received_events_url":"https://api.github.com/users/Amjad121092/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/dblock/oshi/labels/new%20feature","name":"new feature","color":"009800"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2016-02-22T22:59:11Z","updated_at":"2016-02-26T23:00:59Z","closed_at":null,"body":"Hi,\r\n\r\nWould it be possible to add a method to get the PC temperature? I think this is crucial and it's missing. Other than that the project is amazing thank you very much!\r\n\r\nRegards"},"comment":{"url":"https://api.github.com/repos/dblock/oshi/issues/comments/189518447","html_url":"https://github.com/dblock/oshi/issues/119#issuecomment-189518447","issue_url":"https://api.github.com/repos/dblock/oshi/issues/119","id":189518447,"user":{"login":"dbwiddis","id":9291703,"avatar_url":"https://avatars.githubusercontent.com/u/9291703?v=3","gravatar_id":"","url":"https://api.github.com/users/dbwiddis","html_url":"https://github.com/dbwiddis","followers_url":"https://api.github.com/users/dbwiddis/followers","following_url":"https://api.github.com/users/dbwiddis/following{/other_user}","gists_url":"https://api.github.com/users/dbwiddis/gists{/gist_id}","starred_url":"https://api.github.com/users/dbwiddis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dbwiddis/subscriptions","organizations_url":"https://api.github.com/users/dbwiddis/orgs","repos_url":"https://api.github.com/users/dbwiddis/repos","events_url":"https://api.github.com/users/dbwiddis/events{/privacy}","received_events_url":"https://api.github.com/users/dbwiddis/received_events","type":"User","site_admin":false},"created_at":"2016-02-26T23:00:59Z","updated_at":"2016-02-26T23:00:59Z","body":"Here's a rundown of current research/challenges.\r\n\r\nLinux - This is looking the best so far.  If lm-sensors is installed by default (it is on Ubuntu) then the `sensors` command can be easily parsed.  By reverse engineering the lm-sensors code it appears that it gets the value from the path `/sys/class/hwmon/hwmon0/` and reading temp1_input.  There are other files in this directory structure that give information on fan speeds as well.  I haven't written any code here yet but it looks easy enough once the other OS's are taken care of.\r\n\r\nOS X - I have ported code into JNA from the [iStats](https://github.com/Chris911/iStats) project.  In addition to querying the System Master Controller for temperatures, fan speed information is also available.   Despite using exactly the same code, my requests return a `kIOReturnIPCError` the overwhelming majority (99%) of the time.  I don't know why my code doesn't behave identically to the c code I'm porting from, or why it sometimes works.  I can ignore the IPC error and process the returned value anyway (there are other data checks to ensure I got readable results so this is totally reasonable); this seems to improve my chances.  I can regularly get results at least once if I retry about 30 times.   There may or may not be interference with another application I'm using to monitor my smc temperature and fan speeds.   In any case, I'm not sure we want to publish code which doesn't always work.   It would be more reliable to ask users to install the iStats code themselves and then just call `istats cpu temp` from the command line.  However, part of the original design of oshi was to avoid having to install anything.  I guess I'll keep banging my head against the wall of c vs. JNA to see why it's not working identically.\r\n\r\nWindows - The information may be available in WMI and I've [located the appropriate code to query it](http://www.tomshardware.com/faq/id-1924879/learn-computer-command-prompt-wmic.html), however this is still just executing a command line.  Also, that site echoes what I've seen elsewhere, _\"(note, doesn't work will all hardware or VMs)\"_.  In particular, it doesn't work on the Windows VM I use for my own development/testing, nor my standalone windows laptop.  So even though I know what results to expect and how to parse them (when they exist) it's impossible for me to test, and falls into the same category of the OS X solution of only working some of the time.  Another option here is the [Open Hardware Monitor](http://openhardwaremonitor.org/) project.  This seems to work with a wider range of hardware and inserts its results into WMI where we could query it from OSHI.\r\n\r\nSo, in summary:\r\n- Linux = possible using `sysfs` interface. \r\n- OS X = works sometimes.  Could document that users can install iStats to improve success.  Can keep trying to figure out why it's not working always.\r\n- Windows = works on some hardware (but not mine so I can't test). Could document that users can install Open Hardware Monitor to expand hardware options.\r\n\r\nThoughts?  \r\n\r\n\r\n\r\n"}}