We've got a new Marty User's site for Activities, Tutorials and Educational content       Check it out →  
Posted   —   № 7
17,386 Views

Page 2 of 3

Network setup

Note on WiFi:

If you have a Pi older than a Pi 3 Model B, i.e, without built in Wi-Fi, then you will have to skip the SSH part for now. You can follow the steps after but you will have to plug your Pi in to a monitor as well as use a USB keyboard.

This is because the Model B has built in Wi-Fi, and paired with a USB dongle, will enable the Pi to broadcast it’s own hotspot, as well as connect to another network. After you’ve completed your network configuration, you can SSH into it,as it will be connected to the same network as your computer.

SSH

In order to configure Marty for first time use, a way to input commands must be established. The simplest way would be to connect a USB keyboard and a HDMI monitor to the Pi and physically type commands in. However, this is impractical for anything other than temporary work, especially if Marty is moving around.

A better solution would be to take advantage of being able to remotely access the shell (command line) from another computer over your network. This can be achieved through the Secure Shell (SSH) protocol.

Most Linux distros and OSX versions come with SSH pre-installed, though unfortunately a third-party client like PuTTY will be required for Windows. The next steps assume your’re using Linux, and the steps will be very will be similar for OSX too. For Windows they may vary dependent on your SSH client.


On your computer, connect to the wifi hotspot generated by Marty. Open a terminal and ssh into your Marty:

ssh pi@marty.local

This will then prompt you with a password, which is marty.

You may be prompted to confirm the authenticity of the host, in this case just confirm it with a yes.

For those who are unfamiliar with ssh, you have formed a connection from your computer to the Raspberry Pi within Marty and in effect, are in total control. You can confirm this by looking at the user prompt within the terminal, it should read pi@marty. Any commands entered into this terminal, will be equivalent to entering them a terminal on the Pi itself.

Network configuration

Now, we need to give the Pi your network information. Enter the following:

sudo nano /etc/wpa_supplicant/wpa_supplicant.conf

This will bring up the nano text editor in your terminal and here you will add your network info in the format below:

network={
  ssid="your-network"
  psk="your-network-password"
  key_mgmt=protocol
}

Where your-network and your-network-password are the name of your network and your network’s password. The quotation marks are required. Finally, protocol is the security protocol of your network, commonly this is WPA-PSK. Ensure that this network is the same as the one your computer is on.

When finished, save, quit and restart your Marty.

On reboot, Marty should automatically connect to your network.

To double check, use an IP scanning tool such as AngryIP and see if your Marty is present on the network.