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

Avoid dashboard crash on macOS when SMC data is unavailable. #8

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sherbondy
Copy link

@sherbondy sherbondy commented Feb 22, 2020

Hi folks,

I tried playing around with mining on a Mac mini, and the barebones command line script mine.js worked flawlessly, but the dashboard script would consistently crash for me because SMC data is unavailable on my machine for whatever reason, even when running the script with sudo. For good measure, I also tried explicitly running e.g.

sudo powermetrics -i 200 -n1 --samplers smc

directly from the command line to validate, and likewise, the SMC info is missing:

unable to get smc values
Machine model: Macmini8,1
SMC version: Unknown
EFI version: 1037.340.0
OS version: 19E234g
Boot arguments: chunklist-security-epoch=0 -chunklist-no-rev2-dev
Boot time: Sat Feb 22 10:29:56 2020

(Running a beta of 10.15.4 FWIW, but seemingly this issue has plagued other Mac mini owners on earlier OS releases too, see last comment on this StackExchange post).

As a janky workaround (so I can at least get some of the joy out of the dashboard, despite not having access to temp/fan info), I wrapped the SMC data extraction bit in a simple undefined conditional check. Now the script works on my Mac, and I can run the dashboard!

Bummer that the SMC info seems to be inconsistently available across various Apple hardware and OS releases :(, hope this helps other folks.

So delighted that this works at all on macOS though! Seems relatively uncommon in the mining world, enthusiasts be damned.

Screenshot 2020-02-22 at 11 24 59

Thanks and feel free to view this as a strawman PR, just raising for visibility with a "duct tape" fix that worked for me.

@smcki012
Copy link

smcki012 commented Feb 22, 2020

Thank you for the submission. We’re going to dig in and see where we might be able to tweak something for a future release. But, rigging this up for legacy devices/beta releases that can’t access the SMC seems just slightly out of scope. Will close this/update if we do something.

@sherbondy
Copy link
Author

Yep sounds good! Hopefully this helps other folks who run into the same issue in the interim.

It’s wild how unreliable/inconsistent basic things like this are from one macOS release and device to another. :shakesfist: 🍎

FWIW this is on the latest Mac mini hardware.

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

Successfully merging this pull request may close these issues.

2 participants