Skip to content

Instantly share code, notes, and snippets.

@jottr
Last active February 13, 2019 13:45
Show Gist options
  • Select an option

  • Save jottr/428a7f53e30c24f7790f0bf413e97609 to your computer and use it in GitHub Desktop.

Select an option

Save jottr/428a7f53e30c24f7790f0bf413e97609 to your computer and use it in GitHub Desktop.

Revisions

  1. jottr revised this gist Feb 13, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion howoto-setup-raspberrypi-zero-w.md
    Original file line number Diff line number Diff line change
    @@ -16,7 +16,7 @@ Use [etcher](https://www.balena.io/etcher/) to flash the image to SD.
    dtoverlay=dwc2
    ```

    - Safely eject the sd card: `$ diskutil eject /Volumes/boot`
    - Safely eject the sd card. On Mac: `$ diskutil eject /Volumes/boot`


    - Connect the _innermost_ USB port to the USB on your host.
  2. jottr revised this gist Feb 13, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion howoto-setup-raspberrypi-zero-w.md
    Original file line number Diff line number Diff line change
    @@ -10,7 +10,7 @@ Use [etcher](https://www.balena.io/etcher/) to flash the image to SD.
    - Mount the SD and `$ cd /Volumes/boot/`
    - `$ touch ssh` to enable ssh server on the PI
    - Edit `cmdline.txt`, add `modules-load=dwc2,g_ether` after `rootwait`
    - Edit `config.txt`:
    - Add the following to `config.txt`:
    ```
    # Enable OTG
    dtoverlay=dwc2
  3. jottr created this gist Feb 13, 2019.
    67 changes: 67 additions & 0 deletions howoto-setup-raspberrypi-zero-w.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,67 @@
    # How to set up the Raspberry Pi Zero W with SSH and Wifi


    Download [Raspbian](https://www.raspberrypi.org/downloads/raspbian/)

    Use [etcher](https://www.balena.io/etcher/) to flash the image to SD.

    ## Prepare the SD Card

    - Mount the SD and `$ cd /Volumes/boot/`
    - `$ touch ssh` to enable ssh server on the PI
    - Edit `cmdline.txt`, add `modules-load=dwc2,g_ether` after `rootwait`
    - Edit `config.txt`:
    ```
    # Enable OTG
    dtoverlay=dwc2
    ```

    - Safely eject the sd card: `$ diskutil eject /Volumes/boot`


    - Connect the _innermost_ USB port to the USB on your host.
    - Wait ~90 sec
    - Connect via `$ ssh [email protected]`. Password is `raspberry`


    ## Setup Wifi

    Note that the Zero W only supports 2.4 Ghz networks.

    ```
    # cat /etc/wpa_supplicant.conf
    ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
    update_config=1
    # AES
    network={
    ssid="<SSID>"
    psk="<PASSPHRASE>"
    proto=RSN
    key_mgmt=WPA-PSK
    pairwise=CCMP
    group=CCMP
    auth_alg=OPEN
    }
    ```


    Automatically connect via `wpa_supplicant` and obtain an IP:

    ```
    # cat /etc/network/interfaces
    auto lo
    iface lo inet loopback
    allow-hotplug wlan0
    iface wlan0 inet dhcp
    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
    iface default inet dhcp
    ```

    ### Further info on how to connect to wifi from the commandline can be found on the Arch Wiki:

    - https://wiki.archlinux.org/index.php/WPA_supplicant
    - https://wiki.archlinux.org/index.php/Wireless_network_configuration