Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to list unknown temperature sensors #17

Closed
MichalMMac opened this issue Jun 20, 2015 · 14 comments
Closed

Ability to list unknown temperature sensors #17

MichalMMac opened this issue Jun 20, 2015 · 14 comments

Comments

@MichalMMac
Copy link

Feature request

Would it be possible fot smckit to display all SMC registers similiary to smc -l?

@perfaram
Copy link
Contributor

AFAIK, not currently... I'm going to try 👍

@beltex
Copy link
Owner

beltex commented Jun 20, 2015

Hi @MichalMMac!

@perfaram is correct, SMCKitTool does not currently do this. It certainly could though, but I’m wondering, what would be the value in having such an option? Or rather, what would you like to use it for?

I saw your comment about wanting to do temperature monitoring. If thats the case, then dshb is the tool you want. SMCKitTool does the same via smckit -t, but of course its a static output (would have to run it in a loop to monitor temperature in a real time fashion).

@MichalMMac
Copy link
Author

Hello @beltex
My first impression was that smckit -td shows only limited set of temperature sensors.

When I compared that output with my notes on temp sensors 4-letter codes for three different Mac models it seems to me that smckit -td shows only temperature sensors for which we know what 4-letter represents.

dshb is very nice tool but I need output I can parse with a script.

@perfaram
Copy link
Contributor

Okay, so here I am. I started working on it nonetheless, mostly as an introduction to Swift for me.
However... how could I cast [UInt8] into a String ?

@beltex
Copy link
Owner

beltex commented Jun 22, 2015

My first impression was that smckit -td shows only limited set of temperature sensors.

@MichalMMac Your absolutely right, it does only show a fixed set of temperature sensors which we know what hardware they map to more or less.

dshb is very nice tool but I need output I can parse with a script.

Thanks! :)

I see. I had been thinking for a while about iterating through the four character codes (FourCC) for temperature sensors, but I was hesitant to do so since we would not know what they would be for exactly. However, I've gone back and looked at some of my notes on this, and I may just have a solution. I'm going to explore it further, and will get back to you as soon as I can.


how could I cast [UInt8] into a String ?

@perfaram Here's one way of doing it:

let data: [UInt8] = [72, 101, 108, 108, 111, 33]
var str = String()

for value in data {
    str.append(UnicodeScalar(value))
}

print(str)

@MichalMMac
Copy link
Author

will get back to you as soon as I can.

@beltex Thank you

My reasoning behind this is that I don't not know what exactly some temperature sensors are but I will check them anyway. If there is value like >100°C there might be some problem worth investigating. I would rather use a tool which is in active development since I don't know if my problem with smc -l is gonna be fixed.

@perfaram
Copy link
Contributor

See my repo. I added a function to get a key by its index, and another that counts the keys, enumerate them using the previous one, then store them in a dictionary, which associates key->(value, type)

@perfaram
Copy link
Contributor

#21

@beltex beltex changed the title SMCKitTool ability to list all SMC registers SMCKitTool: Ability to list unknown temperature sensors Jun 25, 2015
@beltex
Copy link
Owner

beltex commented Jun 25, 2015

My reasoning behind this is that I don't not know what exactly some temperature sensors are but I will check them anyway.

@MichalMMac Indeed. Thus, the focus for this is only on the temperature sensors, with a new option that would be something like -u, --unknown-sensors, with output format the same as the -t option, but these would be marked as Unknown (this is besides the extra lead I mentioned previously on possibly addressing unknown sensors).

If there is value like >100°C there might be some problem worth investigating.

Keep in mind though that #15 will become more prevalent with these extra sensors.

@beltex beltex self-assigned this Jun 25, 2015
@MichalMMac
Copy link
Author

@beltex Sounds good.

Also having all information on single line could be easier for parsing but can manage with current format.

beltex added a commit that referenced this issue Aug 17, 2015
Seems to run a bit slow though. This is likely due to the manner in which
we have to get the keys (via SMC index). Would be nice to cache them some how,
but that might be overkill.

http://github.com/beltex/SMCKit/issues/17
@beltex
Copy link
Owner

beltex commented Aug 19, 2015

Hi @MichalMMac!

Sorry about the supremely late response, my sincerest apologies! The -u option has now been added. Let me know what you think!

Also having all information on single line could be easier for parsing but can manage with current format.

Agreed! Thats done too.

@beltex beltex changed the title SMCKitTool: Ability to list unknown temperature sensors Ability to list unknown temperature sensors Aug 19, 2015
@MichalMMac
Copy link
Author

@beltex Thank you. I am going to test it but I need to install Xcode 7 in VM first.

You don't have to be sorry about anything. I am not your customer and you develop this as free opensource project. I am very grateful you responded to my feature requrest :-)

@MichalMMac
Copy link
Author

Work great! Thank you 👍

Beast.local>> /Volumes/HangarBay/Hangar/Desktop/smckit -udt
-- Temperature --
AMBIENT_AIR_0     (TA0P)  23.0°C 
CPU_0_HEATSINK    (TC0H)  44.0°C 
CPU_0_PROXIMITY   (TC0P)  51.0°C 
GPU_0_DIODE       (TG0D)  73.0°C 
GPU_0_HEATSINK    (TG0H)  65.0°C 
LCD_PROXIMITY     (TL0P)  52.0°C 
MISC_PROXIMITY    (Tm0P)  53.0°C 
ODD_PROXIMITY     (TO0P)  50.0°C 
-- Unknown Temperature Sensors --
Unknown   (TA0V)  23.0°C 
Unknown   (TA0p)  28.0°C 
Unknown   (TC0c)  51.0°C 
Unknown   (TC0h)  44.0°C 
Unknown   (TC0p)  51.0°C 
Unknown   (TC1c)  47.0°C 
Unknown   (TC2c)  51.0°C 
Unknown   (TC3c)  50.0°C 
Unknown   (TCGc)  51.0°C 
Unknown   (TCSc)  49.0°C 
Unknown   (TCXc)  51.0°C 
Unknown   (TG0d)  73.0°C 
Unknown   (TG0h)  65.0°C 
Unknown   (TG0p)  68.0°C 
Unknown   (TH0O)  6.0°C 
Unknown   (TH1O)  6.0°C 
Unknown   (TL0V)  50.0°C 
Unknown   (TL0p)  65.0°C 
Unknown   (TL1P)  57.0°C 
Unknown   (TL1V)  47.0°C 
Unknown   (TL1p)  57.0°C 
Unknown   (TL1v)  47.0°C 
Unknown   (TL2V)  54.0°C 
Unknown   (TLAV)  54.0°C 
Unknown   (TLBV)  53.0°C 
Unknown   (TLCV)  50.0°C 
Unknown   (TO0p)  51.0°C 
Unknown   (TPCD)  61.0°C 
Unknown   (TS0P)  49.0°C 
Unknown   (TS0V)  46.0°C 
Unknown   (TS0p)  49.0°C 
Unknown   (TS2P)  49.0°C 
Unknown   (TS2V)  47.0°C 
Unknown   (TS2p)  49.0°C 
Unknown   (Tm0p)  53.0°C 
Unknown   (Tp1P)  66.0°C 
Unknown   (Tp1p)  66.0°C 
Unknown   (Tp2H)  75.0°C 
Unknown   (Tp2h)  75.0°C 
Unknown   (Tp3H)  64.0°C 
Unknown   (Tp3h)  64.0°C

@beltex
Copy link
Owner

beltex commented Aug 23, 2015

You don't have to be sorry about anything. I am not your customer and you develop this as free opensource project. I am very grateful you responded to my feature requrest :-)

:)

Work great! Thank you 👍

Awesome! np!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants