How to configure Wifi from command-line

Warning

We do not recommend using the built-in Raspberry Shake 3 Model B’s wifi, but it is available. Be aware that using the built-in Wifi (as opposed to Ethernet or Wifi from a USB adapter) will introduce high amplitude RF noise into the Raspberry Shake, often seriously compromising the seismic signal by introducing high amplitude low-frequency spikes. This appears to be a result of the proximity of the Wifi antenna to the Raspberry Shake board itself. External/ USB wifi solutions are not as problematic because the wifi antenna is further from the Raspberry Shake board. The Raspberry Pi Zero “W” does not appear to suffer from this same problem and can be safely used in native wifi mode.

To configure the wifi from the command-line, start by opening a terminal and opening a connection to your Shake Pi:

$ ssh myshake@raspberryshake.local

First confirm that the WiFi interface is enabled

$ cat /etc/network/interfaces

And verify that the following lines exist

allow-hotplug wlan0
iface wlan0 inet dhcp
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

If they aren’t there, edit the file, add the lines above, and save

$ sudo nano /etc/network/interfaces

Then edit the wpa_supplicant.conf

$ sudo nano /etc/wpa_supplicant/wpa_supplicant.conf

Paste the following lines at the end of the file and add your WiFi Connection Details (ssid and psk):

network={
        ssid="SSID of your wifi"
        psk="password of your wifi"
        proto=RSN
        key_mgmt=WPA-PSK
        pairwise=CCMP
        auth_alg=OPEN
        }

Now reboot your shake:

$ sudo reboot

How to encrypt wifi password from command-line

Execute this commmand:

$ wpa_passphrase <your_wifi_ssid_here> <your_wifi_password_here>

For example,

$ wpa_passphrase mywifi mypasswd

This will generate the following:

network={
        ssid="mywifi"
        #psk="mypasswd"
        psk=175c63e5acd5b9bb66cfe2f89857db9060f2edf3989c89c19e5a54e5044cd2a4
}

Copy this output to /etc/wpa_supplicant/wpa_supplicant.conf and remove the #psk line to make it fully encrypted

How to enable both WiFi and Ethernet Interfaces

When your Shake Pi boots, if it detects that an Ethernet interface is active, WiFi will be turned off by default. If, however, you wish to enable both WiFi and Ethernet interfaces, a configuration file allows you to override this rule.

This file is named /opt/settings/user/enable-wifi.txt and contains the following lines

# WiFi enablement configuration file
# should contain a single line not beginning with #
# specifying either ON or OFF

OFF

Edit this file

$ sudo nano /opt/settings/user/enable-wifi.txt

Modify the last line from OFF to ON.

Reboot your shake:

$ sudo reboot