Jump to content

HWSensors3

FakeSMC HWMonitor Sensors Temperature

  • Please log in to reply
353 replies to this topic

#341
vector sigma

vector sigma

    InsanelyMac Protégé

  • Members
  • Pip
  • 39 posts
  • Gender:Male

About battery capacity look Windows tells in mWh, while MacOS in mAh. Multilier is Voltage.

So Windows value 34610mWh / 8.643V = 4004mAh

Compare!

 

PS. Using VoodooBatterySMC assumes you need no double it by ACPIBatteryManager.

So "Battery Amperage,  mA" should be "Battery Amperage,  mAh"? 

And this refear to the current capacity then?
 



#342
vector sigma

vector sigma

    InsanelyMac Protégé

  • Members
  • Pip
  • 39 posts
  • Gender:Male

 

Exactly

class AppleSmartBattery : public IOPMPowerSource {

 

 

i reworked the app, now show voltage and amperage using rehabman's kext by just reading kIOPMPSVoltageKey and kIOPMPSCurrentCapacityKey.

Did not test your kext yet but it should work if mentioned keys are present and populated by voodoobattery.

Source and precompiled app attached.

 

P.S. I introduced I little bug and by clicking voltage it may be always displayed in the top bar. Don't panic I'll fix it.... now I'v to go. please let me know

Attached Files



#343
Allan

Allan

    V.I.P. Member

  • Supervisors
  • 11,461 posts
  • Gender:Male

PS. Using VoodooBatterySMC assumes you need no double it by ACPIBatteryManager.

So, If I'll use your kext, I need to delete the RehabMan's kext?


i reworked the app, now show voltage and amperage using rehabman's kext by just reading kIOPMPSVoltageKey and kIOPMPSCurrentCapacityKey.

If I use the HWMonitorSMC.app after extractin it, I've got this error message:

Attached File  Screen Shot 2017-10-14 at 22.47.58.png   43.75KB   4 downloads



#344
Slice

Slice

    InsanelyMac V.I.P.

  • Local Moderators
  • 6,314 posts
  • Gender:Male
  • Location:Moscow

So "Battery Amperage,  mA" should be "Battery Amperage,  mAh"? 

And this refear to the current capacity then?
 

No, mA means current in units "milliAmpers".

mAh means capacity in units mA * hours.

How many hours the laptop can work with battery can be calculated from capacity and current

Hours = mAh/mA 


So, If I'll use your kext, I need to delete the RehabMan's kext?


 

Yes



#345
Badruzeus

Badruzeus

    InsanelyMac Legend

  • Members
  • PipPipPipPipPipPipPip
  • 544 posts
  • Gender:Male
  • Location:Indonesia
  • Interests:Graphics Design.

...

If I use the HWMonitorSMC.app after extractin it, I've got this error message:

attachicon.gifScreen Shot 2017-10-14 at 22.47.58.png

Is Gatekeeper disabled and allowed apps downloaded from "Anywhere"..?

Spoiler


#346
vector sigma

vector sigma

    InsanelyMac Protégé

  • Members
  • Pip
  • 39 posts
  • Gender:Male

So, If I'll use your kext, I need to delete the RehabMan's kext?


If I use the HWMonitorSMC.app after extractin it, I've got this error message:

attachicon.gifScreen Shot 2017-10-14 at 22.47.58.png

don't know, it tells you is damaged, but redownloading it is fine here.


No, mA means current in units "milliAmpers".

mAh means capacity in units mA * hours.

How many hours the laptop can work with battery can be calculated from capacity and current

Hours = mAh/mA 

ok got it. So the one attached is now perfect, tested with VoodooBatterySMC.kext and ACPIBatteryManager.kext.


P.S. I introduced I little bug and by clicking voltage it may be always displayed in the top bar. Don't panic I'll fix it.... now I'v to go. please let me know

Have to correct myself, this bug was already there: fixed.


Also, is there any way to have the Batteries section in HWMonitorSMC not show up while running on a desktop? Again, rolling back to the older version fixed this for me.

Well, I think should be easy, but no time today. I'll looking into this later.

Attached Files



#347
vector sigma

vector sigma

    InsanelyMac Protégé

  • Members
  • Pip
  • 39 posts
  • Gender:Male

Wow. 11+11 (source + precompiled) downloads and no one cares to share if is good or not? :|



#348
Slice

Slice

    InsanelyMac V.I.P.

  • Local Moderators
  • 6,314 posts
  • Gender:Male
  • Location:Moscow

Wow. 11+11 (source + precompiled) downloads and no one cares to share if is good or not? :|

I see 2+2 downloads

Attached File  Downloads.JPG   44.23KB   2 downloads



#349
vector sigma

vector sigma

    InsanelyMac Protégé

  • Members
  • Pip
  • 39 posts
  • Gender:Male

I see 2+2 downloads

attachicon.gifDownloads.JPG

added those ones here:             #342, only five posts back. Wanted to help, but is useless  Lol



#350
Slice

Slice

    InsanelyMac V.I.P.

  • Local Moderators
  • 6,314 posts
  • Gender:Male
  • Location:Moscow

added those ones here:             #342, only five posts back. Wanted to help, but is useless  Lol

You will be very useful.

Explain me please these issues

Attached File  Снимок экрана 2017-10-17 в 22.53.31.png   374.15KB   3 downloads

Is my corrected sources differ from your? Attached File  hwmonitor.zip   535.13KB   6 downloads

I have Xcode 9.0.1, in OS 10.12.6.



#351
vector sigma

vector sigma

    InsanelyMac Protégé

  • Members
  • Pip
  • 39 posts
  • Gender:Male

You will be very useful.

Explain me please these issues

attachicon.gifСнимок экрана 2017-10-17 в 22.53.31.png

Is my corrected sources differ from your? attachicon.gifhwmonitor.zip

I have Xcode 9.0.1, in OS 10.12.6.

in IOBatteryStatus.h you should add these function's declaration:

+(NSDictionary *)getIOPMPowerSource;
+(int) getBatteryVoltageFrom:(NSDictionary *)IOPMPowerSource;
+(int) getBatteryAmperageFrom:(NSDictionary *)IOPMPowerSource; 

and in IOBatteryStatus.m the corresponding functions:

+ (NSDictionary *) getIOPMPowerSource
{
    CFMutableDictionaryRef matching , properties = NULL;
    io_registry_entry_t entry = 0;
    matching = IOServiceMatching( "IOPMPowerSource" );
    entry = IOServiceGetMatchingService( kIOMasterPortDefault , matching );
    IORegistryEntryCreateCFProperties( entry , &properties , NULL , 0 );
    
    NSDictionary * dict = CFBridgingRelease(properties);
    IOObjectRelease( entry );
    return dict;
}

// Voltage measured in mV
+ (int) getBatteryVoltageFrom:(NSDictionary *)IOPMPowerSource
{
    if (IOPMPowerSource && [IOPMPowerSource objectForKey:@kIOPMPSVoltageKey]) {
        return [[IOPMPowerSource objectForKey:@kIOPMPSVoltageKey] intValue];
    }
    
    return 0;
}

// Capacity measured in mA
+ (int) getBatteryAmperageFrom:(NSDictionary *)IOPMPowerSource
{
    if (IOPMPowerSource && [IOPMPowerSource objectForKey:@kIOPMPSAmperageKey]) {
        int mA = [[IOPMPowerSource objectForKey:@kIOPMPSAmperageKey] intValue];
        return (mA > 0) ? mA : (0 - mA);
    }
    
    return 0;
}

both before @end.

More, on top of the .h or the .m file (better the .m) you must add:

#import <IOKit/pwr_mgt/IOPM.h>

Only needed to get the keys kIOPMPSAmperageKey and kIOPMPSVoltageKey (or all the others in the IOPMPowerSource dictionary). Their strings can change in time, who knows, but not the macros.

 

 

Your original project does not use default Xcode settings so little differences in the "Build Settings" to avoid common clang's warnings.. so to restore them. it should work anyway.

Latest project I posted was just the one in:

../hwsensors-hwsensors3-code/trunk/hwmonitor 

+ my modification. Basically this code will work with voodoo, rehabman's kext... or just in a real mac, since all kexts publish the same thing in IOPMPowerSource.

See that this time I used kIOPMPSAmperageKey (mA) as suggested by you.



#352
Slice

Slice

    InsanelyMac V.I.P.

  • Local Moderators
  • 6,314 posts
  • Gender:Male
  • Location:Moscow

Good! Your changes accepted.

See Battery section is empty. 

Attached File  Снимок экрана 2017-10-18 в 8.17.49.png   100.39KB   1 downloads

can we make it invisible if no batteries found?

 

And do you want to be a developer of the project? I can give you commit access to sf.net just tell me your nickname there.



#353
Balamut

Balamut

    InsanelyMac Sage

  • Donators
  • 273 posts
  • Gender:Male
  • Location:Classified

Slice, if you want I've got Titan Xp Pascal version, I can test and report whatever you need.



#354
vector sigma

vector sigma

    InsanelyMac Protégé

  • Members
  • Pip
  • 39 posts
  • Gender:Male

Good! Your changes accepted.

Thanks.


See Battery section is empty. 

can we make it invisible if no batteries found?

 

Two three ways:

  1. by mac model (smbios system-type). For the empty battery ("-") will display again if the driver cannot read values, or ACPI isnt good. Need investigation for possible values other than 2.
  2. take a look for IOPMPowerSource if is nil (NULL) 
  3. make a preferences menù with checkboxes.

which do you prefer?

 

And do you want to be a developer of the project? I can give you commit access to sf.net just tell me your nickname there.

I cannot be omni present due to my life (job, my Son ..etc), but some time I can play with those things, If you have no rush doing so, I'll be happy.  Usually I use github, so I have to create an account (i'll ask my Son for a new nickname...maybe another Transformer's character Lol).







Also tagged with one or more of these keywords: FakeSMC, HWMonitor, Sensors, Temperature


1 user(s) are reading this topic

1 members, 0 guests, 0 anonymous users


© 2017 InsanelyMac  |   News  |   Forum  |   Downloads  |   OSx86 Wiki  |   Designed by Ed Gain  |   Logo by irfan  |   Privacy Policy