Jump to content

2,089 posts in this topic

Recommended Posts

Advertisement
1 hour ago, Slice said:

Xcode also recommends

https://yadi.sk/i/USFuTKtJ3UHvhH

But this is old Xcode7.3 which can't compile the project

In fact I'll never do that. Suppose that @IBAction (IB = Interface Builder.. i.e. connected in Xcode GUI using xibs) is connectet to multiple objects (sender) you can do that:

@IBAction func actionFromMultipleObjects(sender: AnyObject) {

    if sender is NSButton {

      // AnyObject is a button, so I can use NSButton library to interact with him

    } else if sender is NSTextField {

      // AnyObject is a text field, so I can aquire its text or change it

    } else if sender is NSSlider {

      // AnyObject is a slider, so I can aquire its position and calculate something

    }

  }

 

AnyObject means that inherent to NSObject.h which averything is based on regarding Cocoa (#import <Foundation/Foundation.h> + #import <AppKit/AppKit.h>) to produces interfaces.

Anyway you can see differences because as you know swift is a new language and Xcode7.3 probably can compile at max Swift 2.x while the latest is Swift 4.x. This year Swift 5 will comes out which will be the final release and it will be embedded in the new macOS 10.14 (may be that Apple will decide to update some of the older OSes as well because Swift 5 will have a stable ABI). We are using the latest available today but as any other old version the swift library is totally included in the app bundle, why can this work. With Swift 5 newer apps will be smaller because we will no longer need to include the entire library.. Anyway Swift 5's compiler will be compatible with Swift 4 and We'll be able to produces apps compatible with all old OSes starting from 10.9. So differences with Swift 4 and 5 will be the stable ABI due to small changes their will do (under testing) about the "String" library which is the most used. After that I'm sure Apple will recompile the entire OS to use everything was done using objective c with the new language.

For us, I think, that the project will at least require very very small changes (or nothing)... anyway in two months Xcode 10 will comes for testing and we'll know what.

 

Edited by vector sigma

Share this post


Link to post
Share on other sites
On 8/4/2018 at 1:06 PM, vector sigma said:

Hi Fabio, your instead is bad but I think that the program should have exited before showing untrue data because it says "no resources". Can you kindly show me the output of:


diskutil list

and also


diskutil info disk1

thanks

Last login: Sun Apr 15 09:42:01 on console

iMac-di-Fabio:~ fabio$ diskutil list

/dev/disk0 (internal, physical):

   #:                       TYPE NAME                    SIZE       IDENTIFIER

   0:      GUID_partition_scheme                        *250.1 GB   disk0

   1:                        EFI EFI                     209.7 MB   disk0s1

   2:                  Apple_HFS macOS Sierra            249.2 GB   disk0s2

   3:                 Apple_Boot Recovery HD             650.0 MB   disk0s3

 

/dev/disk1 (internal, physical):

   #:                       TYPE NAME                    SIZE       IDENTIFIER

   0:      GUID_partition_scheme                        *120.0 GB   disk1

   1:                        EFI EFI                     209.7 MB   disk1s1

   2:                 Apple_APFS Container disk2         119.8 GB   disk1s2

 

/dev/disk2 (synthesized):

   #:                       TYPE NAME                    SIZE       IDENTIFIER

   0:      APFS Container Scheme -                      +119.8 GB   disk2

                                 Physical Store disk1s2

   1:                APFS Volume macOS High Sierra       97.6 GB    disk2s1

   2:                APFS Volume Preboot                 21.9 MB    disk2s2

   3:                APFS Volume Recovery                517.8 MB   disk2s3

   4:                APFS Volume VM                      20.5 KB    disk2s4

 

iMac-di-Fabio:~ fabio$ /Users/fabio/Downloads/smarter disk0

Medium Type:       HDD

Protocol:          SATA

Location:          Internal

Temperature:       55834574872C°

S.M.A.R.T. check disk0:  IOCreatePlugInInterfaceForService() failed with error "IOKit Common: no resource"

S.M.A.R.T. status: not capable

 

S.M.A.R.T. data (512 bytes):

UInt8 smartdata[] = {

0x0A, 0x00, 0x01, 0x0F, 0x00, 0x6D, 0x63, 0x9D, 

0x6E, 0x4F, 0x01, 0x00, 0x00, 0x00, 0x03, 0x03, 

0x00, 0x62, 0x61, 0x00, 0x00, 0x00, 0x00, 0x00, 

0x00, 0x00, 0x04, 0x32, 0x00, 0x5D, 0x5D, 0x26, 

0x1D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x33, 

0x00, 0x64, 0x64, 0x00, 0x00, 0x00, 0x00, 0x00, 

0x00, 0x00, 0x07, 0x0F, 0x00, 0x54, 0x3C, 0x42, 

0x9D, 0x32, 0x0E, 0x00, 0x00, 0x00, 0x09, 0x32, 

0x00, 0x5F, 0x5F, 0x28, 0x12, 0x00, 0x00, 0x00, 

0x00, 0x00, 0x0A, 0x13, 0x00, 0x64, 0x63, 0x00, 

0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x32, 

0x00, 0x60, 0x60, 0x78, 0x11, 0x00, 0x00, 0x00, 

0x00, 0x00, 0xBB, 0x32, 0x00, 0x01, 0x01, 0x68, 

0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xBD, 0x3A, 

0x00, 0x60, 0x60, 0x04, 0x00, 0x00, 0x00, 0x00, 

0x00, 0x00, 0xBE, 0x22, 0x00, 0x4C, 0x35, 0x18, 

0x00, 0x13, 0x18, 0x00, 0x00, 0x00, 0xC2, 0x22, 

0x00, 0x18, 0x2F, 0x18, 0x00, 0x00, 0x00, 0x0D, 

0x00, 0x00, 0xC3, 0x1A, 0x00, 0x72, 0x3F, 0x81, 

0xC7, 0x89, 0x03, 0x00, 0x00, 0x00, 0xC5, 0x12, 

0x00, 0x64, 0x64, 0x06, 0x00, 0x00, 0x00, 0x00, 

0x00, 0x00, 0xC6, 0x10, 0x00, 0x64, 0x64, 0x06, 

0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC7, 0x3E, 

0x00, 0xC8, 0xC8, 0x00, 0x00, 0x00, 0x00, 0x00, 

0x00, 0x00, 0xC8, 0x00, 0x00, 0x64, 0xFD, 0x00, 

0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xCA, 0x32, 

0x00, 0x64, 0xFD, 0x00, 0x00, 0x00, 0x00, 0x00, 

0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 

0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 

0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 

0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 

0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 

0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 

0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 

0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 

0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 

0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 

0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 

0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 

0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 

0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 

0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 

0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 

0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 

0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 

0x00, 0x00, 0x82, 0x00, 0xAE, 0x01, 0x00, 0x5B, 

0x03, 0x00, 0x01, 0x00, 0x01, 0x5C, 0x02, 0x00, 

0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 

0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x03, 

0x03, 0x03, 0x02, 0x03, 0x03, 0x03, 0x03, 0x00, 

0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 

0x5A, 0xE1, 0x52, 0x0F, 0x00, 0x00, 0x00, 0x00, 

0x00, 0x00, 0xD6, 0x93, 0xC0, 0xF9, 0xFC, 0x01, 

0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 

0x00, 0x00, 0x00, 0x00, 0x5A, 0xE1, 0x52, 0x0F, 

0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 

0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0F, 0x00, 

0x00, 0x00, 0x40, 0x77, 0xDC, 0x81, 0x03, 0x00, 

0x00, 0x00, 0x02, 0x9C, 0x01, 0x00, 0x00, 0x00, 

0x00, 0x00, 0x27, 0x12, 0x00, 0x00, 0x00, 0x00, 

0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 

0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 

0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 

0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x25

}

 

iMac-di-Fabio:~ fabio$ diskutil info disk0

   Device Identifier:        disk0

   Device Node:              /dev/disk0

   Whole:                    Yes

   Part of Whole:            disk0

   Device / Media Name:      MAXTOR STM3250310AS

 

   Volume Name:              Not applicable (no file system)

   Mounted:                  Not applicable (no file system)

   File System:              None

 

   Content (IOContent):      GUID_partition_scheme

   OS Can Be Installed:      No

   Media Type:               Generic

   Protocol:                 SATA

   SMART Status:             Verified

 

   Disk Size:                250.1 GB (250059350016 Bytes) (exactly 488397168 512-Byte-Units)

   Device Block Size:        512 Bytes

 

   Read-Only Media:          No

   Read-Only Volume:         Not applicable (no file system)

 

   Device Location:          Internal

   Removable Media:          Fixed

 

   Solid State:              No

   Virtual:                  No

   Hardware AES Support:     No

 

iMac-di-Fabio:~ fabio$ 

Edited by Alpha22

Share this post


Link to post
Share on other sites

Guys this package: HWSensors-3_r118.pkg.zip contains an improved version of HWMonitorSMC2.app:

- new SMART core made in swift (world first?) that can read s.m.a.r.t. attributes from ATA and finally from NVMe disks B)

- on right click over any rows (not all but most of it) show detailed info about:

  1. CPU (brand string, system usage)
  2. RAM
  3. S.M.A.R.T. attributes with detailed informations about your disks (BSD name, vendor name, serial etc.),
  4. Battery (laptops) with capacity, max capacity, cycle count, temperature etc. (anyway not with VoodooBattery but works with Rehabman's kext or in a real mac)
  5. SYSTEM with info about processes, threads and more.
  6. POWER (if supported), with info about cpu limit, thermal level etc. 

Please show a screen shot about S.M.A.R.T on SATA and NVMe because I worked hard on this. Big thanks goes to @fabiosun for tens and tens of tests made who helped me a lot debugging smart on mechanical and nvme drives (which I did not own).

Thanks goes also to SystemKit.framenwork, now embedded into the project and smartmontools for the reverse engineering that make possible acquire smart datas for NVMe drives on macOS!

 

TODO:

- do a better layout of the datas showned when you right click fixed

- find gpu information somehow

 

@Slice, soon (tonight) I'll commit those changes, just waiting some tests here

EDIT

commited

Edited by vector sigma
committed to r118

Share this post


Link to post
Share on other sites
11 minutes ago, Cyberdevs said:

@vector sigma

Nice work :) Thanks a lot man. Everything seems to be working fine. I just have to say I'm using my previous sensors. Haven't tested my rig with the sensors included in the package. I'll test them later and report back.

Screen Shot 2018-04-15 at 9.48.37 PM.png

Very good! No matter the kexts you installed unless too old.

Edited by vector sigma

Share this post


Link to post
Share on other sites
10 hours ago, vector sigma said:

Guys this package: HWSensors-3_r118.pkg.zip contains an improved version of HWMonitorSMC2.app:

 

Battery (laptops) with capacity, max capacity, cycle count, temperature etc. (anyway not with VoodooBattery but works with Rehabman's kext or in a real mac)

 

@Slice, soon (tonight) I'll commit those changes, just waiting some tests here

 

Thanks!

The package is reloaded to sf.net

About VoodooBattery what is missing? AFAIK Rehabman's kext calculate temperature as current divided by constant as no real sensor exists.

Share this post


Link to post
Share on other sites

1. There should be

Quote

#import "../SMART/NVMe.h"

?

 

2. No such module SystemKit?

 

3. What is the GPU-17635765476125348?

2018-04-16_07-30-07.png

 

4. Right click on HDD gives me empty window

2018-04-16_07-35-31.png

 

Share this post


Link to post
Share on other sites
16 hours ago, Slice said:

1. There should be

?

 

2. No such module SystemKit?

 

 

I didn't experience any of those issues but:

1. is referenced in the Xcode project and I didn't expect this is the issue.

2. Well, the issue is that the compiled framenwork is not present because not yet built

possible remedy, go in "Build Settings" and under "Framework Search Paths" add these if missing in two lines:

$(inherited)
${TARGET_BUILD_DIR}/SystemKit.framework

the first is a common solution, the second tells Xcode to link the framenwork in the target build dir where should be present since Xcode build it before everything. Tell me if work because until tonight I cannot try.

If that is not enough we should consider to build the framenwork separately and then add it already compiled.

Anyway the project should compile.. isn't?

16 hours ago, Slice said:

3. What is the GPU-17635765476125348?

At the moment I've no idea but I can image is a bad format argument.

16 hours ago, Slice said:

4. Right click on HDD gives me empty window

2018-04-16_07-35-31.png

 

Yesterday we experience an issue that was causing the app to crash. I'll revise the relevant part of code. In the meantime this is a command line I made to test smart with fabiosun  and contains the code already present in the app. please post the result here so that I can take a look on it (just double click on it)

Edited by vector sigma
typo

Share this post


Link to post
Share on other sites
45 minutes ago, vector sigma said:

Try this commandline please: hwsensorsmart

(cliccaci sopra e posta il risultato)

iMac-di-Fabio:~ fabio$ /Users/fabio/Downloads/hwsensorsmart 

----------------------------------------------------

disk0

ATASMARTData(vendorSpecific1: (10, 0, 1, 15, 0, 109, 99, 157, 110, 79, 1, 0, 0, 0, 3, 3, 0, 99, 97, 0, 0, 0, 0, 0, 0, 0, 4, 50, 0, 93, 93, 142, 29, 0, 0, 0, 0, 0, 5, 51, 0, 100, 100, 0, 0, 0, 0, 0, 0, 0, 7, 15, 0, 84, 60, 181, 17, 51, 14, 0, 0, 0, 9, 50, 0, 95, 95, 52, 18, 0, 0, 0, 0, 0, 10, 19, 0, 100, 99, 0, 0, 0, 0, 0, 0, 0, 12, 50, 0, 96, 96, 121, 17, 0, 0, 0, 0, 0, 187, 50, 0, 1, 1, 104, 1, 0, 0, 0, 0, 0, 189, 58, 0, 96, 96, 4, 0, 0, 0, 0, 0, 0, 190, 34, 0, 67, 53, 33, 0, 19, 33, 0, 0, 0, 194, 34, 0, 33, 47, 33, 0, 0, 0, 13, 0, 0, 195, 26, 0, 88, 63, 37, 97, 114, 4, 0, 0, 0, 197, 18, 0, 100, 100, 6, 0, 0, 0, 0, 0, 0, 198, 16, 0, 100, 100, 6, 0, 0, 0, 0, 0, 0, 199, 62, 0, 200, 200, 0, 0, 0, 0, 0, 0, 0, 200, 0, 0, 100, 253, 0, 0, 0, 0, 0, 0, 0, 202, 50, 0, 100, 253, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), offLineDataCollectionStatus: 130, selfTestExecutionStatus: 0, secondsToCompleteOffLineActivity: (174, 1), vendorSpecific2: 0, offLineDataCollectionCapability: 91, SMARTCapability: (3, 0), errorLoggingCapability: 1, vendorSpecific3: 0, shortTestPollingInterval: 1, extendedTestPollingInterval: 92, reserved: (2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), vendorSpecific4: (0, 0, 0, 0, 4, 1, 1, 1, 2, 3, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 90, 225, 82, 15, 0, 0, 0, 0, 0, 0, 155, 7, 138, 80, 254, 1, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 90, 225, 82, 15, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 1, 0, 0, 0, 15, 0, 0, 0, 175, 69, 225, 129, 3, 0, 0, 0, 183, 224, 67, 0, 0, 0, 0, 0, 39, 18, 0, 0, 0, 0, 152, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), checksum: 59)

SMARTValidateReadData

SMARTReadDataThresholds

----------------------------------------------------

disk1

ATASMARTData(vendorSpecific1: (1, 0, 5, 51, 0, 100, 100, 0, 0, 0, 0, 0, 0, 0, 9, 50, 0, 99, 99, 16, 17, 0, 0, 0, 0, 0, 12, 50, 0, 96, 96, 152, 13, 0, 0, 0, 0, 0, 177, 19, 0, 98, 98, 19, 0, 0, 0, 0, 0, 0, 179, 19, 0, 100, 100, 0, 0, 0, 0, 0, 0, 0, 181, 50, 0, 100, 100, 0, 0, 0, 0, 0, 0, 0, 182, 50, 0, 100, 100, 0, 0, 0, 0, 0, 0, 0, 183, 19, 0, 100, 100, 0, 0, 0, 0, 0, 0, 0, 187, 50, 0, 100, 100, 0, 0, 0, 0, 0, 0, 0, 190, 50, 0, 72, 58, 28, 0, 0, 0, 0, 0, 0, 195, 26, 0, 200, 200, 0, 0, 0, 0, 0, 0, 0, 199, 62, 0, 99, 99, 131, 3, 0, 0, 0, 0, 0, 235, 18, 0, 99, 99, 181, 8, 0, 0, 0, 0, 0, 241, 50, 0, 99, 99, 234, 223, 213, 57, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), offLineDataCollectionStatus: 0, selfTestExecutionStatus: 0, secondsToCompleteOffLineActivity: (104, 16), vendorSpecific2: 0, offLineDataCollectionCapability: 83, SMARTCapability: (3, 0), errorLoggingCapability: 1, vendorSpecific3: 0, shortTestPollingInterval: 2, extendedTestPollingInterval: 70, reserved: (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), vendorSpecific4: (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), checksum: 199)

SMARTValidateReadData

SMARTReadDataThresholds

------------------------------------------------

BSD Name: disk0

Product Name: MAXTOR STM3250310AS                     

Product Revision Level: 3.AAC   

Serial Number: 6RY3EDGC

Medium Type: HDD

Capacity: 250,06 GB (250059350016 bytes)

Physical Interconnect: SATA

Physical Interconnect Location: Internal

Temperature: 33C°

S.M.A.R.T. status: Ok

 

------------------------------------------------

BSD Name: disk1

Product Name: Samsung SSD 840 EVO 120GB               

Product Revision Level: EXT0AB0Q

Serial Number: S1D5NEAD713475A

Medium Type: SSD

Capacity: 120,03 GB (120034123776 bytes)

Physical Interconnect: SATA

Physical Interconnect Location: Internal

Temperature: 28C°

Life: 98%

S.M.A.R.T. status: Ok

Share this post


Link to post
Share on other sites
6 hours ago, fabiosun said:

special version..remember :P:)

Sure, next version will show also the rotation rate for mechanical hard drives (like Rotation Rate = 7200rpm")

rpm.png.ae1582eaecf98660904140166cbafbe2.png

On 16/4/2018 at 5:46 AM, Slice said:

About VoodooBattery what is missing?

Max cycles and current cycles count. Didn't remembar if also the vendor show up.

Edited by vector sigma
apict added

Share this post


Link to post
Share on other sites

@Alpha22, thanks, your looks fine now.

On 17/4/2018 at 5:15 PM, Slice said:

I think you forgot to check an optional value != nil before unwrap it.

Can be and also due to a wrong logic. Please test this: [removed] I'm working on. running it in Xcode you should see where is crashing.

P.S. some code commented and moved, needs a clean up.

Edited by vector sigma

Share this post


Link to post
Share on other sites

Hi @vector sigma,

I made the follow change compared to rev 121

  public func temperature(_ unit: TemperatureUnit = .celsius) -> Double {
    var temperature: Double?
    if let prop = IORegistryEntryCreateCFProperty(service,
                                               Key.Temperature.rawValue as CFString!,
                                               kCFAllocatorDefault, 0) {
    
      temperature = prop.takeUnretainedValue() as! Double / 100.0
    } else {
      temperature = 0
    }
    
    switch unit {
    case .celsius:
      // Do nothing - in Celsius by default
      // Must have complete switch though with executed command
      break
    case .fahrenheit:
      temperature = Battery.toFahrenheit(temperature!)
    case .kelvin:
      temperature = Battery.toKelvin(temperature!)
    }
    
    return ceil(temperature!)
  }

That way if prop=nil then temperature=0

It is not good way but the way there is no crash at as! unwrap. The better will be to keep temperature to be optional Double.

Share this post


Link to post
Share on other sites
3 hours ago, Slice said:

It is not good way but the way there is no crash at as! unwrap

Good. The following is working as well?

public func temperature(_ unit: TemperatureUnit = .celsius) -> Double {
    var temperature: Double = 0
    if let prop = IORegistryEntryCreateCFProperty(service,
                                                  Key.Temperature.rawValue as CFString!,
                                                  kCFAllocatorDefault, 0) {
      
      temperature = prop.takeUnretainedValue() as! Double / 100.0
    }
    
    switch unit {
    case .celsius:
      // Do nothing - in Celsius by default
      // Must have complete switch though with executed command
      break
    case .fahrenheit:
      temperature = Battery.toFahrenheit(temperature)
    case .kelvin:
      temperature = Battery.toKelvin(temperature)
    }
    
    return ceil(temperature)
  }

No optional value, just initialize the temperature variable.

This framenwork was a swift 3.2 converted to 4 by me, also I've made similar corrections. Later I'll send to the mantainer a pull request with our changes.

EDIT

from the same dev I found this: https://github.com/beltex/SMCKit, later I'll take a look if there's something suitable for us..

EDIT II

Slice please tell me if you have Xcode 9.3 ... some changes I want to do for newer version of Swift... a step to be ready for the incoming Swift 5

Edited by vector sigma

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

Announcements

  • Similar Content

    • By miliuco
      Install macOS 10.15 Catalina on Gigabyte P55-USB3 with Radeon RX 580 graphics card using a USB device created with the createinstallmedia command and Clover as bootloader. Instructions to install macOS 10.14 Mojave on this computer are almost identical, replacing Catalina app with Mojave, so this article is suitable for both versions of macOS. The Gigabyte P55-USB3 motherboard (and some others from the same brand with the P55 / H55 chipset) have made it easy to build a hackintosh and install macOS since 10 years ago. Although it is an old motherboard, the behavior with Mojave or Catalina is very good after changing the classic hard drive (HDD) for a solid state drive (SSD).

      Components of the hackintosh
      Gigabyte GA-P55-USB3 motherboard: P55 chipset, 1156 socket, ALC892 audio, Gigabit RTL8111D network, DDR3 RAM Intel Core i5-750 processor for socket 1156: 4 cores, 8MB cache, clock rate 2.66 GHz Fenvi FV-T919 wireless + Bluetooth card: PCI-Express, wifi is ac type, detected by macOS as Airport and Apple Bluetooth Radeon RX 580 8 GB graphics card: works OOB but with a few details to be considered, it has its own article.  
      Previous requirements
      Install macOS Catalina app in /Applications folder USB flash drive with at least 16GB prepared from Disk Utility with MBR partition scheme and formatted as Mac Os Plus (on older Gigabyte boards like mine, USB sticks partitioned with GUID scheme instead of MBR usually hang the system when booting) Recent version of Clover (I have used r5117) Recent versions of Lilu (at least 1.4.4) and WhateverGreen (at least 1.3.9) to fine-tune the behavior of the graphics card Recent version of RealtekRTL8111 (I have used 2.2.2) FaceSMC version 6.26-322 (newer versions disable automatic mounting of USB devices on my system).  
      Create install USB
      Run this command from Terminal (assuming the target device is called USB):
      Bash: sudo /Applications/Install\ macOS\ Catalina.app/Contents/Resources/createinstallmedia --volume /Volumes/USB /Applications/Install\ macOS\ Catalina.app
      Clover must be installed on the USB memory, I choose the following options:
      Bootloader > Install boot0af on the MBR CloverEFi > CloverEFI 64-bit SATA BIOS Drivers, 64 bit > Recommended drivers > FSInject + SMCHelper + XhciDxe BIOS Drivers, 64 bit > File System drivers > ApfsDriverLoader Install RC scripts on selected volume Optional RC scripts > Disable sleep proxy client.  
      You have to copy 4 kexts to the EFI/CLOVER/kexts/Other folder of the USB device: FaceSMC 6.26-322, Lilu 1.4.4, WhateverGreen 1.3.9 and RealtekRTL8111 2.2.2. Regarding the config.plist file, the most significant is:
      Boot > kext-dev-mode = 1 in Boot arguments GUI > Theme embedded, EmbeddedThemeType Dark, Screen Resolution 1920x1080, Preboot in Hide Volume Graphics > blank, nothing is checked except if foxbox solution is used to have more than 2 connectors enabled RT Variables > 0x28 in BooterConfig and 0x67 in CsrActiveConfig SMBios > iMac14,2 Sytem Parameters> Yes in Inject Kexts and check Inject System ID.  
      Install macOS Catalina

      Boot from the USB device and choose Install macOS from Install macOS Catalina. The installation program runs until the PC restarts. Here choose Install macOS from HDD (the name of the volume you are installing macOS on). With RX 580 graphics card, the screen goes black in this second phase of the installation, it is a phase in which the user has nothing to do until the PC is restarted so you can let it work until the Clover menu again. You have to choose Boot macOS from HDDto boot the installed system from the hard disk, the screen is recovered and you can configure the account and the initial options. From this moment the screen works fine.

      In summary:
      Boot from USB > Clover menu > Install macOS from Install macOS Catalina > screen works fine Boot from USB > Clover menu > Install macOS from HDD > black screen Boot from USB > Clover menu > Boot macOS from HDD > screen works fine.  
      Install Clover and kexts on the hard drive

      Clover needs to be installed on the disk where we just installed macOS. Options are the same as when installing it on the USB memory. You also have to copy the 4 kexts (FaceSMC 6.26-322, Lilu 1.4.4, WhateverGreen 1.3.9 and RealtekRTL8111 2.2.2) into the EFI/CLOVER/kexts/Other folder on the EFI partition of the disk. And review the config.plist file remembering the comments for the USB.

      If everything goes well, the computer starts from the hard disk with a running copy of macOS Catalina.
       
       

    • By Slice
      The thread splitted from HWSensors3.
       
      Tools to testing Radeon state.
      Load RadeonPCI.kext  
      RadeonPCI.kext.zip
       
      How to load
      sudo chown -R root:wheel ~/Downloads/RadeonPCI.kext sudo chmod -R 755 ~/Downloads/RadeonPCI.kext sudo kextutil -v ~/Downloads/RadeonPCI.kext and use RadeonDump utility
      RadeonDump1.zip
       
      Commands to see temperature
      Polaris
      ./RadeonDump1 -n 6b0,c0300014
      SeaIsaland
      ./RadeonDump1 -n 200,c0300014
       
      Old families
      ./RadeonDump1 -r 714,7f4
       
      Other possible methods to find a register for temperature
      ./RadeonDump1 -n 6b0,c0300e0c
      ./RadeonDump1 -n 6b0,1c5
      ./RadeonDump -n 6b0,d8200ca4
      ./RadeonDump -r 59800,59810
      ./RadeonDump -r 678,680

       
       
       
      01.12.2017
      Latest solution RadeonMonitor.kext here
      works for RX 460,480,580
      not works for HD7790, R9 290X?
       
      06.12.2017
      Here works also with HD7790, R9 290X
       
      14.12.2017
      Support VEGA here
       
      13.12.2017
      Version for test modern cards
      RadeonPCI5.kext.zip
       
      06.04.2020
      Version for Catalina
      RadeonPCI5-v2.kext.zip
    • By kevin_1351
      tl;dr: VirtualSMC causes me a flood of log messages and correlated cpu spikes. FakeSMC doesn't.
       
      Hi, I have almost finalized my Huawei Matebook X Pro Opencore setup and everything is working very well besides wifi/bt ofc (which is about to change).
       
      However, I noticed how the cpu usage sometimes went up a little and when looking at the Console I could see a never-ending flood of:
      default 14:05:05.983292+0100 loginwindow clamshellStateChanged | Clamshell state changed: closed=0, shouldSleepWhenClosed=2 default 14:05:05.982975+0100 kernel PMRD: clamshell closed 0, disabled 0, desktopMode 0, ac 0 sleepDisabled 0 default 14:05:05.982996+0100 kernel PMRD: clamshell closed 0, disabled 0, desktopMode 0, ac 0 sleepDisabled 0 default 14:05:06.985932+0100 kernel PMRD: clamshell closed 0, disabled 0, desktopMode 0, ac 0 sleepDisabled 0 default 14:05:06.985949+0100 kernel PMRD: clamshell closed 0, disabled 0, desktopMode 0, ac 0 sleepDisabled 0 default 14:05:06.986134+0100 loginwindow clamshellStateChanged | Clamshell state changed: closed=0, shouldSleepWhenClosed=2 default 14:05:39.426574+0100 kernel PMRD: clamshell closed 0, disabled 0, desktopMode 0, ac 0 sleepDisabled 0 default 14:05:39.426729+0100 loginwindow clamshellStateChanged | Clamshell state changed: closed=0, shouldSleepWhenClosed=2 default 14:05:39.426585+0100 kernel PMRD: clamshell closed 0, disabled 0, desktopMode 0, ac 0 sleepDisabled 0 default 14:05:41.431085+0100 kernel PMRD: clamshell closed 0, disabled 0, desktopMode 0, ac 0 sleepDisabled 0 default 14:05:41.431097+0100 kernel PMRD: clamshell closed 0, disabled 0, desktopMode 0, ac 0 sleepDisabled 0 default 14:05:41.431246+0100 loginwindow clamshellStateChanged | Clamshell state changed: closed=0, shouldSleepWhenClosed=2 default 14:05:42.433068+0100 kernel PMRD: clamshell closed 0, disabled 0, desktopMode 0, ac 0 sleepDisabled 0 default 14:05:42.433227+0100 loginwindow clamshellStateChanged | Clamshell state changed: closed=0, shouldSleepWhenClosed=2 default 14:05:42.433078+0100 kernel PMRD: clamshell closed 0, disabled 0, desktopMode 0, ac 0 sleepDisabled 0 default 14:05:43.434453+0100 kernel PMRD: clamshell closed 0, disabled 0, desktopMode 0, ac 0 sleepDisabled 0 default 14:05:43.434465+0100 kernel PMRD: clamshell closed 0, disabled 0, desktopMode 0, ac 0 sleepDisabled 0 default 14:05:43.434622+0100 loginwindow clamshellStateChanged | Clamshell state changed: closed=0, shouldSleepWhenClosed=2 default 14:05:44.436155+0100 kernel PMRD: clamshell closed 0, disabled 0, desktopMode 0, ac 0 sleepDisabled 0 default 14:05:44.436166+0100 kernel PMRD: clamshell closed 0, disabled 0, desktopMode 0, ac 0 sleepDisabled 0  
      As you can see, multiple of these per second. Another guy with the same computer is also having this issue and posted a dsdt change to fix it. This fix didn't solve anything though
      He tried to limit the Notify call by implementing a state change requirement before calling Notify.
       
      Here is the original acpi:
      Scope (_SB) { Device (LID) { Name (_HID, EisaId ("PNP0C0D") /* Lid Device */) // _HID: Hardware ID Method (_LID, 0, NotSerialized) // _LID: Lid Status { Local0 = One Local0 = ^^PCI0.LPCB.EC0.RPIN (0x05, 0x06) If ((Local0 == 0x55)) { Local0 = Zero } Else { Local0 = One } ^^PCI0.GFX0.CLID = Local0 Return (Local0) } } Device (PWRB) { Name (_HID, EisaId ("PNP0C0C") /* Power Button Device */) // _HID: Hardware ID Method (_STA, 0, NotSerialized) // _STA: Status { Return (0x0B) } } } Scope (_SB.PCI0.LPCB.EC0) { Method (_Q81, 0, NotSerialized) // _Qxx: EC Query, xx=0x00-0xFF { Local0 = ^^^^LID._LID () If ((Local0 == Zero)) { ADBG ("LID-OFF") SGOV (0x02030009, Zero) SGOV (0x02060000, Zero) } Else { ADBG ("LID-ON") SGOV (0x02030009, One) SGOV (0x02060000, One) Notify (ALSD, 0x80) // Status Change } Notify (LID, 0x80) // Status Change } } Which he changed to: 
      Scope (_SB) { Device (LID) { Name (_OLD, One) // assuming everything else.. the lid should start open? Name (_HID, EisaId ("PNP0C0D") /* Lid Device */) // _HID: Hardware ID Method (_LID, 0, NotSerialized) // _LID: Lid Status { Local0 = One Local0 = ^^PCI0.LPCB.EC0.RPIN (0x05, 0x06) If ((Local0 == 0x55)) { Local0 = Zero } Else { Local0 = One } Return (Local0) } } Device (PNLF) { Name (_HID, EisaId ("APP0002")) // _HID: Hardware ID Name (_CID, "backlight") // _CID: Compatible ID Name (_UID, 0x0A) // _UID: Unique ID Name (_STA, 0x0B) // _STA: Status } Device (PWRB) { Name (_HID, EisaId ("PNP0C0C") /* Power Button Device */) // _HID: Hardware ID Method (_STA, 0, NotSerialized) // _STA: Status { Return (0x0B) } } } Scope (_SB.PCI0.LPCB.EC0) { Method (_Q81, 0, NotSerialized) // _Qxx: EC Query, xx=0x00-0xFF { Local0 = ^^^^LID._LID () If ((Local0 == Zero)) { ADBG ("LID-OFF") SGOV (0x02030009, Zero) SGOV (0x02060000, Zero) } Else { ADBG ("LID-ON") SGOV (0x02030009, One) SGOV (0x02060000, One) Notify (ALSD, 0x80) // Status Change } If ((^^^^LID._OLD != Local0)) { Notify (LID, 0x80) // Status Change ^^^^LID._OLD = Local0 } } } Besides me not seeing any reason to declare _OLD in LID. The idea itself shouldn't be too bad right? Well, as I said, his fix didn't work.
       
      In fact, to prove that Method _Q81 doesn't have anything to do with the issue at all, I created a Clover/Opencore patch to change _Q81 to XQ81. This resulted in my lid not working at all of course, but the log flooding still persisted!
      So _Q81 doesn't have anything to do with the issue afaik.
       
      Now, further Google searches led me to a chinese post where he tied the issue to VirtualSMC. And indeed, by migrating to FakeSMC the issue is no more.
       
      Unfortunately, I'm very fond of VirtualSMC for various reasons. So I would very much like to keep it. If not I'd have to implement the old way of doing Battery monitoring etcetc. Which isn't very elegant and update proof as it requires DSDT patching.
       
      So, I do believe that the issue may very well be in the DSDT code, perhaps in the ambient light part. I'm not very skilled at this and just started studying the ACPI spec 3 days ago.
       
      Could someone please help me out? Thanks a lot in advance
       
       
      origin.zip
      OC.zip
    • By Slice
      Guys,
      Don't mix 6.18 and 3.41.
       
      There are three different projects for monitoring temperatures, voltages, fans speed and other hardware parameters:
      Initially it was FakeSMC with plugins for producing SMC keys for hardware parameters for different hardware. But sometimes ago Kozlek separated own version of FakeSMC and producing new set of plugins while I stay with good working version 3. So..
      1. FakeSMC v3 with Hardware Sensors3  which I still supported.
      2. FakeSMC v6 (rev1800) by Kozlek and supported by Rehabman. AFAIK both are abandoned and the project is not supported. Or may be maintained by coauthors.
      3. New VirtualSMC by vit9696 with own set of sensors kexts. It depends on Lilu.kext. The project is in active development.
      All three project have incompatible interfaces sensors<->SMC so they are incompatible with each other.
       
      There are applications for monitoring hardware parameters and they commonly depends on these projects.
      1. iStat, iStatMenu, iStatPro compatible with real Macs because they use SMC keys just like those presents in real Macs.
      2. HWMonitorSMC by Navi (initial codes from Kozlek)  used in my HWSensors3.
      3. HWMonitor by Kozlek with graphics like in IntelPowerGadget used in his HWSensors version.
      4. HWMonitorSMC2 by Vector_Sigma tends to be universal supporting all project. It also may use sensors information produces by Apple graphics and by IntelPowerGadget.
       
      Let us discuss here differences and common ideas for this projects.
       
×