Basic Pi Setup - mpechner/Security-Camera GitHub Wiki

This page is a summary of many other pages. Honestly I did not screen shot raspi-config. Raspi-config is important for setting up wifi region, language, and keyboard. Once that is done. I use nmap to find the IP address for the evening. Then use ssh to connect. Don't need to stink'n GUI's :-D

michaels-MBP-2:dev mpechner$ sudo nmap 192.168.1.0/24
Password:
Starting Nmap 7.70 ( https://nmap.org ) at 2018-08-03 22:09 PDT
Last login: Fri Aug  3 21:45:16 on ttys000

Nmap scan report for raspberrypi.localdomain (192.168.1.215)
Host is up (0.0042s latency).
Not shown: 999 closed ports
PORT   STATE SERVICE
22/tcp open  ssh
MAC Address: B8:27:EB:1B:DF:F5 (Raspberry Pi Foundation)

Nmap scan report for michaels-MBP-2.localdomain (192.168.1.212)

Host is up (0.000076s latency).
Not shown: 500 filtered ports, 499 closed ports
PORT     STATE SERVICE
3689/tcp open  rendezvous

Nmap done: 256 IP addresses (10 hosts up) scanned in 13.91 seconds

Load the Image - OSX Specific

List the drives

diskutil list
/dev/disk0 (internal):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                         1.0 TB     disk0
   1:                        EFI EFI                     314.6 MB   disk0s1
   2:                 Apple_APFS Container disk1         1.0 TB     disk0s2

You will see your SD card. Make note of its device, ex. /dev/disk6. It is probably mounted and you will see the icon on the desktop. Now to unmount it. sudo diskutil unmountDisk /dev/disk6 you will see the icon disappear.

Assuming you have downloaded the image, the command to load the SD card is: sudo dd bs=1m if=2018-04-18-raspbian-stretch.img of=/dev/rdisk6 Notice the device is rdisk, not disk. Raw character device, not the block device. This can take a while, minutes.

make your backups.

More than likely, the SD will eventually die, you will pull the power too soon and corrupt the SD. It is a simple reversal. sudo dd bs=1m of=myproject_YYYYMMDD_HHMM.img if=/dev/rdisk6

I cannot stress this enough. After you make a backup, restore to a different microSD and test it. I have made bad images. Maybe pulled the card from the Pi too soon, the shutdown had not really completed. Have trashed what ended up being the one working image. Putting the project away for a few days, pissed off at my own stupidity. Because I keep notes on he commands I run, I can recreate the work.

initial configuration

At least at the start you need a monitor, keyboard and mouse. Then read this https://www.raspberrypi.org/documentation/configuration/ To get language, keyboard and wifi region set up.

I do not know if it was the version, or it was late and I was tired, but the pi seemed to not configure the network on the ethernet cable until I did this.

The First commands

Here is where we update the image and remove the swap. The issue with SD cards is that they are consumables. They do wear out.

  • passwd
    • change the password from raspberry. Basic security.
  • Update the OS
    • According to feedback from Adafruit, employee, rpi-upgrade and dist-upgrade is no longer the proper method to update the images.
    • sudo apt-get update
    • sudo apt-get upgrade
  • Turn off swap to save wear and tear on SD
    • sudo swapoff -a
    • sudo update-rc.d -f dphys-swapfile remove
    • sudo rm /var/swap

MISC notes

You see in the project I have a basic vimrc - put into your home directory as /home/pi/.vimrc Unless you like nano, add the following line to /home/pi/.bashrc file export EDITOR=vi

About Done With Setup

BACK IT UP! You know have a basic image for use with other projects.