Oshi: Raspberry Pi platform support

Created on 18 May 2019  路  11Comments  路  Source: oshi/oshi

I'm wondering if the "Raspberry Pi" (ARM) plateform could be added.

I apology if that doesn't make sens to you.

compatibility fixed

All 11 comments

It does and it works but needs someone with a Pi to help port/debug the things that don鈥檛 work.

That make sens.
Sadly i don't have one but as i see more Raspberry Pi (Broadcom) users around reporting issues with media servers that made me wonder if such plateform could be implemented.

Thank you for your feedback +1

running SystemInfoTest on Rasp Pi0 (armv6)

pi@jr-5453cc:~ $ java -cp .:* SystemInfoTest
Initializing System...
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
GNU/Linux Raspbian GNU/Linux 9 (stretch) build 4.19.42+
Checking computer system...
manufacturer: unknown
model: unknown
serialnumber: unknown
firmware:
  manufacturer: unknown
  name: unknown
  description: unknown
  version: unknown
  release date: unknown
baseboard:
  manufacturer: unknown
  model: unknown
  version: unknown
  serialnumber: unknown
Checking Processor...
ARMv6-compatible processor rev 7 (v6l)
 1 physical CPU package(s)
 1 physical CPU core(s)
 1 logical CPU(s)
Identifier:  Family ? Model ? Stepping ?
ProcessorID: 0000000000000000
Checking Memory...
Memory: 120.1 MiB/242.6 MiB
Swap used: 8 MiB/100.0 MiB
Checking CPU...
Uptime: 2 days, 03:57:32
Context Switches/Interrupts: 19040489 / 10586602
CPU, IOWait, and IRQ ticks @ 0 sec:[1834350, 0, 1027010, 182966750, 324800, 0, 62470, 0]
CPU, IOWait, and IRQ ticks @ 1 sec:[1834360, 0, 1027020, 182967730, 324800, 0, 62470, 0]
User: 1.0% Nice: 0.0% System: 1.0% Idle: 98.0% IOwait: 0.0% IRQ: 0.0% SoftIRQ: 0.0% Steal: 0.0%
CPU load: 2.0% (counting ticks)
CPU load: 1.6% (OS MXBean)
CPU load averages: 0.31 0.38 0.25
CPU load per processor: 51.1%
Max Frequency: 1 GHz
Current Frequencies: 1 GHz
Checking Processes...
Processes: 89, Threads: 120
   PID  %CPU %MEM       VSZ       RSS Name
 26224  80.7 10.0 206.2 MiB  24.3 MiB java
 26210   3.1  2.8  16.2 MiB   6.8 MiB sshd
   585   0.5 11.1 247.1 MiB  27.0 MiB java
 26051   0.4  2.8  16.2 MiB   6.8 MiB sshd
 25625   0.3  1.9   6.4 MiB   4.6 MiB bash
Checking Sensors...
Sensors:
 CPU Temperature: 53.0掳C
 Fan Speeds: []
 CPU Voltage: 0.0V
Checking Power sources...
Power: Unknown
Checking Disks...
Disks:
 /dev/mmcblk0: (model: Unknown - S/N: Unknown) size: 7.9 GB, reads: 95642 (1.1 GiB), writes: 0 (389.2 MiB), xfer: 0 ms
 |-- /dev/mmcblk0p1: mmcblk0p1 (vfat) Maj:Min=179:1, size: 45.0 MB @ /boot
 |-- /dev/mmcblk0p2: mmcblk0p2 (ext4) Maj:Min=179:2, size: 7.9 GB
Checking File System...
File System:
 File Descriptors: 1158/23856
 / (Local Disk) [ext4] 3.7 GiB of 7.2 GiB free (50.8%), 381114 of 451232 files free (84.5%) is /dev/root  and is mounted at /
 tmpfs (Ram Disk) [tmpfs] 12 MiB of 12 MiB free (100.0%), 31054 of 31056 files free (100.0%) is tmpfs  and is mounted at /home/pi/snapshots_tmp
 /dev/loop0 (Local Disk) [ext4] 8.3 GiB of 9.7 GiB free (85.9%), 2456791 of 2457600 files free (100.0%) is /dev/loop0  and is mounted at /home/pi/snapshots
 /dev/mmcblk0p1 (Local Disk) [vfat] 20.1 MiB of 42.2 MiB free (47.5%), 0 of 0 files free (NaN%) is /dev/mmcblk0p1  and is mounted at /boot
 /home/pi/.jr_cam (Mount Point) [ecryptfs] 3.7 GiB of 7.2 GiB free (50.8%), 381114 of 451232 files free (84.5%) is /home/pi/.jr_cam  and is mounted at /home/pi/.jr_cam
Checking Network interfaces...
Network interfaces:
 Name: wlan0 (wlan0)
   MAC Address: b8:27:eb:54:53:cc
   MTU: 1500, Speed: 0 bps
   IPv4: [192.168.1.29]
   IPv6: []
   Traffic: received 214997 packets/212.7 MiB (0 err); transmitted 73464 packets/29.1 MiB (0 err)
Checking Network parameterss...
Network parameters:
 Host name: jr-5453cc
 Domain name: jr-5453cc
 DNS servers: [192.168.1.1]
 IPv4 Gateway: 192.168.1.1
 IPv6 Gateway:
Checking Displays...
Displays:
Checking USB Devices...
USB Devices:
 DWC OTG Controller (Linux 4.19.42+ dwc_otg_hcd) [s/n: 20980000.usb]
Checking Sound Cards...
Sound Cards:
SoundCard@4aed64 [kernelVersion=Advanced Linux Sound Architecture Driver Version k4.19.42+., name=bcm2835_alsa - bcm2835 ALSA, codec=]

i know we can get the gpu temp....
vcgencmd measure_temp

output
root@raspberrypi:/home/pi# vcgencmd measure_temp temp=59.1'C

@Abu-Abdullah thanks for the full output of the systeminfo test! It helps narrow down what needs to be done.

Looks like a big gap in the entire "ComputerSystem" class output. It appears Raspbian doesn't use the same sysfs paths that all the other Linux distributions use, particularly /sys/devices/virtual/dmi/id/ for the manufacturer, model, serial, firmware and baseboard info. If someone can point to where the same information lives on Raspbian, we can fix this.

The CPUID info is also missing, although that may be a common Linux "root permission" thing since the info comes from dmidecode or cpuid. If anyone knows a better non-root source for all Linux, this would be helpful.

349 is relevant.

cat /proc/cpuinfo and lscpu seem to work on all Linux distros without root permission.
https://www.maketecheasier.com/finding-raspberry-pi-system-information/

cpuid seem not implemented in Raspbian:
https://github.com/vernemq/vernemq/issues/175

That is said, i'm not a Linux or Raspberry nerd.

Edit:
https://www.raspberrypi.org/forums/viewtopic.php?t=97897
https://stackoverflow.com/questions/31125814/how-to-identify-arm-board-programmatically/43279112#43279112

I think I can get the ComputerSystem elements, but not sure about the firmware or baseboard values...

manufacturer: hardcode ARM if proc cpuinfo "CPU Implementer" = 0x41
model: cat /sys/firmware/devicetree/base/model
serialnumber: from lshw - serial
firmware:
manufacturer: vcgencmd version copyright line
name: unknown
description: unknown
version: vcgencmd version "Version"
release date: vcgencmd version first line
baseboard:
manufacturer: second digit of /proc/cpuinfo "Revision"
model: /proc/cpuinfo "Hardware"
version: /proc/cpuinfo "Revision"
serialnumber: /proc/cpuinfo "Serial"

Family may not be relevant for ARM. The proc/cpu field CPU implementer (0x41) maps to ARM, is architecture (7) the family? Looks like variant = stepping and part = model.

vgencmd has lots of info on sensors as well

Yes, that confirm what i've read about cpuid, so that mean that nVidia CPUs should also be affected:

cat /proc/cpuinfo
processor : 0
model name : ARMv8 Processor rev 0 (v8l)
BogoMIPS : 62.50
Features : fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp
CPU implementer : 0x4e
CPU architecture: 8
CPU variant : 0x0
CPU part : 0x004
CPU revision : 0
MTS version : 42272872

CPU architecture seem to be the ARM version in this case AFAICU.
http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0500f/BABFEABI.html
http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0395b/CIHCAGHH.html
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm64/kernel/cpufeature.c?h=v5.0-rc3

lscpu give a human readable output for all these implementer , variant and part values:
https://github.com/karelzak/util-linux/pull/564/files
https://unix.stackexchange.com/questions/255558/understanding-the-output-of-proc-cpuinfo

I hope that it could be of some help. I'll search more on that a little later.

So I tracked down the 32-bit equivalent of the CPUID, for ARM processors:
image
This, plus all zeros for flags/features, can help us populate a proxy "ProcessorID".

Implementer (bits 31-24) - equivalent to the 12-character "Manufacturer ID string" from CPUID with EAX=0
Variant (bits 23-20) - part of stepping, the first number in r*p*
Architecture (bits 19-16) - analogous to family
Partnum (bits 15-4) - minor revision of core, analogous to model
Revision (bits 3-0) - part of stepping, the second number in r*p*

Yes, Raspbian is only 32-bit for now, the 64-bit Linux distros (Fedora, Arch, SUSE) images are for the Pi 3 and above.

In case that it could be helpful i leave 2 links about PI specifications:
https://openwrt.org/toh/raspberry_pi_foundation/raspberry_pi
https://elinux.org/RPi_HardwareHistory

Was this page helpful?
0 / 5 - 0 ratings