Skip to content

Instantly share code, notes, and snippets.

@glennschler
Last active March 25, 2022 02:39
Show Gist options
  • Select an option

  • Save glennschler/7345428 to your computer and use it in GitHub Desktop.

Select an option

Save glennschler/7345428 to your computer and use it in GitHub Desktop.
Raspberry Pi Notes
#
# /etc/network/interfaces
#
auto lo
iface lo inet loopback
allow-hotplug eth0
iface eth0 inet dhcp
allow-hotplug wlan0
iface wlan0 inet manual
wpa_roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp

Notes

Install of Wheezy-Raspbian v2013-09-25

Configure Raspberry Pi from Mac OS X

  • Download Raspbian Raw image

  • From the OS X command line. Following these eLinux SD Card Setup. To summarize:

    • diskutil list
      • identify the disk (not partition) of your SD card. e.g. disk4 (not disk4s1)
    • diskutil unmountDisk /dev/<disk# from diskutil>
      • e.g. diskutil unmountDisk /dev/disk3
    • sudo dd bs=1m if=<your image file>.img of=/dev/<disk# from diskutil>
      • e.g. sudo dd bs=1m if=2013-09-25-wheezy-raspbian.img of=/dev/disk4
      • (This will take some time)
  • Start-up the Raspberry Pi

    • Insert the SD Card
    • Setup I/O access, using either of two possible options:
      1. External display
        • Connect a keyboard to the RPi USB port
        • Plug NTSC/PAL TV into RPi composite port or HDMI monitor to the HDMI Port.
        • Turn on when connected with RPi Micro USB port cable. Powered via a computer USB port, or a USB wall charger.
      2. Terminal Emulator with USB to TTL Serial Cable console cable connected to the RPi GPIO
  • Follow these Adafruit instructions for post boot setup using Raspi_Config. To summarize:

    • Expand the SD card partition to it's full size. (e.g. 16GB)
    • Using the Whole Screen
    • Changing Timezone
    • [optional] Booting into Desktop when using external monitor
    • [optional] Change password
    • Choose menu item "Advanced Options"
      • Change Hostname e.g. hostname_pi
      • Enable the SSH server
      • Update Raspi_Config
  • Start with any linux (raspbian) updates

sudo apt-get update
sudo apt-get upgrade
  • If Wifi, try WiFi management using WpaSupplicant?

    sudo apt-get install wpasupplicant
    
    • Generate a WPA PSK from an ASCII passphrase. Put output into wpasupplicant CONF file
    wpa_passphrase "__SSID__"
    
    • Create the etc/network/interfaces file (shown below).
    • Create the /etc/wpa_supplicant/wpa_supplicant.conf file (shown below).
  • Avahi implements the Apple Zeroconf specification, (like bonjour) after this it is easy to ping hostname_pi.local from OS X or other Zeroconf configured machine

sudo apt-get install avahi-daemon
  • Connect using SSH over wifi.

    • Disconnect console cable which is connected to the RPi GPIO.
    • Disconnect external monitor and keyboard.
    • Power with the Micro USB cable.
    ssh pi@hostname_pi.local
    
  • [Optional] Follow the Adafruit instructions to setup and control with desktop UI using VNC.

#
# /etc/wpa_supplicant/wpa_supplicant.conf
# config will connect to either WPA1 or WPA2
#
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
ssid="__SSID__"
psk="__PSK__"
# Protocol type can be: RSN (for WP2) and WPA (for WPA1)
proto=WPA RSN
group=CCMP TKIP
# Pairwise can be CCMP or TKIP (for WPA2 or WPA1)
pairwise=CCMP TKIP
# Key management type can be: WPA-PSK or WPA-EAP (Pre-Shared or
# Enterprise)
key_mgmt=WPA-PSK
#Authorization option should be OPEN for both WPA1/WPA2 (in less
#commonly used are SHARED and LEAP)
auth_alg=OPEN
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment