Skip to content

Instantly share code, notes, and snippets.

@carlozamagni
Last active February 5, 2019 13:42
Show Gist options
  • Save carlozamagni/13181849c3a303f4a8ee1a6035f6c29e to your computer and use it in GitHub Desktop.
Save carlozamagni/13181849c3a303f4a8ee1a6035f6c29e to your computer and use it in GitHub Desktop.
Raspberry Pi - Notes

Setup headless Raspberry Pi

Pre configure WiFi connection

Enable SSH

Enable SSH and SSH over USB

Pre-configure WiFi

In order to instruct Raspbian to connect to a specific hotspot after the setup add a file named wpa_supplicant.conf to the root of the SD card with the following content:

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=<TWO_LETTER_ISO_COUNTRY_CODE>

network={
    ssid="<WIFI_NETWORK_NAME>"
    psk="<WIFI_PASSWORD>"
    key_mgmt=WPA-PSK
}

Enable SSH

Just add a file named "ssh" at the root of the SD card

$ touch ssh

Enable SSH and SSH over USB

(on Raspberry Pi model zero and model A)

On a freshly burned Raspbian image:

  1. Append the following line to config.txt:
dtoverlay=dwc2
  1. Append the following parameter to cmdline.txt by adding a space after the last parameter and adding:
modules-load=dwc2,g_ether
  1. Add a file named "ssh" at the root of the SD card:
$ touch ssh

Power on the device connecting the pc to the micro USB port labeled "USB", wait for the Raspberry to start up, then SSH into it:

$ ssh [email protected]

Setup development environments

NodeJs

Adjust version number according to the convention: setup_*node version*.x

$ curl -sL https://deb.nodesource.com/setup_11.x | sudo -E bash -

$ sudo apt install -y nodejs

Go

Adjust version number accordingly

$ wget https://storage.googleapis.com/golang/go1.11.5.linux-armv6l.tar.gz

$ sudo tar -C /usr/local -xzf go1.11.5.linux-armv6l.tar.gz

$ sudo echo "export PATH=$PATH:/usr/local/go/bin" >> /etc/profile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment