Avoid dashboard crash on macOS when SMC data is unavailable. #8
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 withsudo
. For good measure, I also tried explicitly running e.g.directly from the command line to validate, and likewise, the SMC info is missing:
(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.
Thanks and feel free to view this as a strawman PR, just raising for visibility with a "duct tape" fix that worked for me.