How to configure Wifi from command-line


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” and Raspberry 3 Model B+ do 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

For SSH instructions, see: How to access your Raspberry Shake’s computer via ssh. If you are a Windows user, you would use PuTTY for this step.

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):

        ssid="SSID of your wifi"
        psk="password of your wifi"

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:


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.conf and contains the following lines

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


Edit this file

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

Modify the last line from OFF to ON.

Reboot your shake:

$ sudo reboot