Skip to content

Commit

Permalink
Merge pull request #73 from Pi4J/update-detect-board-section
Browse files Browse the repository at this point in the history
Update the How the Board Model is Detected section
  • Loading branch information
dariuszzbyrad authored Dec 2, 2024
2 parents 0a1c599 + f8004b5 commit 9ef6a15
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion content/documentation/board-info.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,17 @@ The board info is used in some of the plugins to set the correct priority, based

## How the Board Model is Detected

The model is detected based on the board version number that is written inside the board and can be read with:
### Previous Method (< 2.7.1 version)
In earlier versions, the board model was determined by reading the board version number from the `/proc/cpuinfo` file using shell commands:

```shell
$ cat /proc/cpuinfo | grep 'Revision' | awk '{print $3}'
```

### Updated Method (>= 2.7.1 version)
Starting with version 2.7.1, the board version number is determined programmatically in Java using the [CpuInfoReader](https://github.com/Pi4J/pi4j-v2/blob/develop/pi4j-core/src/main/java/com/pi4j/boardinfo/datareader/CpuInfoReader.java) class. This method reads and processes the `/proc/cpuinfo` file to extract the CPU revision.


For instance, for a Raspberry Pi Compute 4, multiple version numbers are possible:

```java
Expand Down

0 comments on commit 9ef6a15

Please sign in to comment.