Change method of SBC model detection #841
Merged
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.
This pulls the board model name from
/proc/device-tree/model
instead of/proc/cpuinfo
. I made this change because I'm running a modified version of TerrariumPI on a Banana Pi M2 Zero that has an Armbian base, and its/proc/cpuinfo
output didn't contain any useful information for pulling the model of the SBC. With this change, the resulting string is:Banana Pi BPI-M2-Zero
I also checked and confirmed that on a Raspberry Pi 3B+ running Raspberry Pi OS, this would produce the string:
Raspberry Pi 3 Model B Plus Rev 1.3
NB: For my personal project, I changed line 285 to:
settings["device"] = self.device
to reuse the code, but this would probably need a little refactoring to preserve the error-checking logic of the try/except block.