Monday 26 September 2016

Raspberry Pi Audit via SSH

The Raspberry Pi only came into existence in 2012, but there are now quite a few models and variants.

I seem to be having problems keeping track of which Pi boards I've installed in which projects.

So I have created a reference list of Pi boards by serial number and version.

This may seem like I'm creating a list just for the sake of it. But on a number of occasions this year I've been looking for a specific board type (maybe an model A) and have not been sure if they are all in use, or whether I should be pulling the garage apart to track one down.

Recently I wanted to test something on a B or B+ rather than "waste" a B2 or B3, if the extra power was unnecessary for the task in hand. I also thought I had 14 Pi boards, but only seem to be able to locate 13 at the moment.

Many of my Pi boards are in projects which are a bit of a pain to dismantle (e.g. nestboxes, internet radios, servers). So the answer is to remote into each one and gather some data.

While many of my projects run VNC server, this does not apply to my audio-visual systems, such as BlissFlixx and KitchenPi. Therefore I need to use the fundamental approach offered by Secure Shell (SSH).

The Cat and SSH

I can determine the Pi IP address from my router by looking at the attached clients page. From my Linux laptop I can then access a Pi via terminal using SSH by using this format:-

ssh {remote user name}@{IP}

...for example by typing into the terminal:-

 ssh pi@

After entering the remote Pi password, you should see the remote Pi terminal prompt, for example:-

pi@blissflixxpi:~ $

Now I can view cpuinfo using the cat command:-

pi@blissflixxpi:~ $ cat /proc/cpuinfo
processor    : 0
model name    : ARMv6-compatible processor rev 7 (v6l)
BogoMIPS    : 2.00
Features    : half thumb fastmult vfp edsp java tls
CPU implementer    : 0x41
CPU architecture: 7
CPU variant    : 0x0
CPU part    : 0xb76
CPU revision    : 7

Hardware    : BCM2708
Revision    : 000f
Serial        : 00000000e49f8c1c

All I'm really interested in are the last 2 lines:-

Revision    : 000f

...means it is a Model B.

The Pi Models/revision numbers of interest to me are these:-

model                revision numbers
A                        0007, 0008, 0009
A+ 256M           0012
A+ 256/512M    0015
B 256M             "Beta", 0002, 0003, 0004, 0005, 0006
B 512M             000d, 000e, 000f
B+                     0010, 0013
2 B                     a01040, a01041, a21041, a21042
3 B                     a02082, a22082

...but there is a full list on the eLinux website which contains more detail.

I also record the serial number on my little list.

Pi serial number and MAC

The MAC is [supposed to be] a globally unique network adapter identity number.

It is made up of 2 parts: the first few bytes are the manufacturers id, and the last few are the interface id.

One thing I don't quite understand is that the last 3 bytes of the Pi ethernet MAC are the same as the last 3 of the serial number. But the serial number is longer than 3 bytes, so how do they maintain uniqueness?

1 comment:

  1. Thats a good idea, considering that some of mine are up trees....