Ben Stienstra

Linux, Unix, network, radio and more...

User Tools

Site Tools


raspberry_pi_headless_install_ssh_wifi

Raspberry Pi - headless, WiFi and SSH

This how-to expects a Linux based install host. I've used Fedora. ~~TOC~~

Install and configure

  • Unzip:
    $ unzip 2017-04-10-raspbian-jessie-lite.zip
  • Insert the SD-card and find device name:
    $ dmesg
    
    [  477.499343] mmc0: new ultra high speed SDR104 SDHC card at address 0007
    [  477.500664] mmcblk0: mmc0:0007 SD32G 29.0 GiB
    [  477.503750]  mmcblk0: p1
  • Unmount if automounted:
    $ umount /dev/mmcblk0p{1,2}
  • Write image to SD card:
    $ sudo dd bs=4M if=2017-04-10-raspbian-jessie-lite.img of=/dev/mmcblk0 status=progress
    sync
  • Mount SD card (reinsert card, or mount manually), find partitions:
    $ sudo fdisk -l /dev/mmcblk0
    
    Disk /dev/mmcblk0: 29 GiB, 31117541376 bytes, 60776448 sectors
    Units: sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disklabel type: dos
    Disk identifier: 0x84fa8189
    
    Device         Boot Start     End Sectors  Size Id Type
    /dev/mmcblk0p1       8192   92159   83968   41M  c W95 FAT32 (LBA)
    /dev/mmcblk0p2      92160 2534887 2442728  1,2G 83 Linux
  • Add the file 'ssh' to root of SD card to enable SSH:
    $ touch /run/media/<username>/boot/ssh
  • Generate WiFi config:
    $ cd /run/media/<username>/<UUID>
    $ wpa_passphrase YOUR_SSID YOUR_PASSWORD
  • Add generated config, (remove the plaintext passphrase):
    $ sudo vi etc/wpa_supplicant/wpa_supplicant.conf
    
    country=<Your country, e.g. US, NL, GB>
    network={
            ssid="<your SSID>"
            psk=<your PSK key>
    }
  • Unount SD-card:
    $ cd
    $ umount /dev/mmcblk0p{1,2}
  • Insert card into RPI, power on.
  • Check DHCP leases for IP-address.
  • Log in to new RPI, the initial password is raspberry:
    ssh pi@<DHCP IP-address>
  • Add other accounts, remove pi user or change the password.
  • Add additional users, remove unwanted users.
  • Configure the Raspberry Pi; change hostname, boot options, locale, timezone, disable ports, etc.
    raspi-config
  • Reboot
  • Update and reboot:
    sudo apt-get update
    sudo apt-get dist-upgrade
    reboot

Update firmware

  • Install rpi-update:
    $ sudo apt-get install rpi-update
  • Update firmware:
    $ sudo rpi-update

WiFi status

  • Show current status:
    iwconfig
    wpa_cli status
  • Wavemon:
raspberry_pi_headless_install_ssh_wifi.txt · Last modified: 2017/06/28 21:02 by admin