Difference between revisions of "Raspberry Pi"

From Christoph's Personal Wiki
Jump to: navigation, search
(External links)
(Miscellaneous)
Line 44: Line 44:
  
 
So, in my case, I have a '''Raspberry Pi 3 Model B''' manufactured by Embest in 2016 (Q1).
 
So, in my case, I have a '''Raspberry Pi 3 Model B''' manufactured by Embest in 2016 (Q1).
 +
 +
===32-bit or 64-bit===
 +
 +
$ arch || uname -a
 +
armv7l  # <- 32-bit => ARMv7 Processor rev 4 (v7l)
 +
armv8  # <- 64-bit => ARMv8 Processor
 +
 +
$ tr '\0' '\n' </proc/device-tree/model;arch
 +
Raspberry Pi 3 Model B Rev 1.2
 +
armv7l
 +
 +
$ getconf LONG_BIT
 +
32  # <- 32-bit
 +
64  # <- 64-bit
 +
 +
$ dpkg --print-architecture
 +
armhf
  
 
==Useful commands==
 
==Useful commands==

Revision as of 01:34, 8 July 2019

This article will be all about my Raspberry Pi projects.

Miscellaneous

  • Find Raspberry Pi IP address on your local WiFi network:
$ sudo nmap -sP 10.0.0.0/24 | awk '/^Nmap/{ip=$NF}/B8:27:EB/{print ip}'

#~OR~

IFACE=eth0
# trigger IPv6 neighbour discovery with link-local scope multicast:
ping6 -c2 -I $IFACE ff02::1 > /dev/null
# print the results, filtered by MAC address vendor prefix of Raspberry Pi Foundation:
ip -6 neigh | grep b8:27:eb

#~OR~

$ arp-scan --interface=eth0 --localnet | grep b8:27:eb
  • Store the following in your ~/.ssh/config file:
Host rpi
    HostName 10.x.x.x
    User pi
    ProxyCommand none
    TCPKeepAlive yes
    ServerAliveInterval 5
    PubkeyAuthentication no
    PreferredAuthentications keyboard-interactive,password

Then,

$ ssh rpi

Or, better yet, use SSH keys.

  • Find out where your Raspberry Pi was made and other details about the hardware:
$ cat /proc/cpuinfo | grep -E '^Hardware|^Revision|^Serial'
Hardware	: BCM2835
Revision	: a22082
Serial		: 0000000038e10351

Then, go here or here and, using the above hardware/revision codes, find out where you RPi was made.

So, in my case, I have a Raspberry Pi 3 Model B manufactured by Embest in 2016 (Q1).

32-bit or 64-bit

$ arch || uname -a
armv7l  # <- 32-bit => ARMv7 Processor rev 4 (v7l)
armv8   # <- 64-bit => ARMv8 Processor
$ tr '\0' '\n' </proc/device-tree/model;arch
Raspberry Pi 3 Model B Rev 1.2
armv7l
$ getconf LONG_BIT
32  # <- 32-bit
64  # <- 64-bit
$ dpkg --print-architecture
armhf

Useful commands

  • Check which network the wireless adaptor is using:
$ iwconfig
  • Print a list of the currently available wireless networks:
$ iwlist wlan0 scan
  • Show details about the device's memory:
$ cat /proc/meminfo
  • Show the size and number of partitions on the SD card or hard drive:
$ cat /proc/partitions
  • Show which version of the Raspberry Pi you are using:
$ cat /proc/version
  • Show all of the installed packages that are related to XXX:
$ dpkg --get-selections | grep XXX
  • Show all of the installed packages:
$ dpkg --get-selections
  • Show the IP address of the Raspberry Pi:
$ hostname -I
  • List USB hardware connected to the Raspberry Pi:
$ lsusb
  • Show the temperature of the CPU:
$ vcgencmd measure_temp
  • Show the memory split between the CPU and GPU:
$ vcgencmd get_mem arm && vcgencmd get_mem gpu

External links