Raspberry Pi Setup

last updated: 2019-10-05

This covers setting up a Raspberry Pi 3A+ to connect to WiFi, compile Crystal language, and participate in Windows network

Install Raspbian

  1. Get a Raspbian image from the Raspbian image site — just use the desktop + recommended image, your MicroSD card is at least 32GB right?
  2. Put the image on an SD card using Balena Etcher.

Boot Raspberry Pi

  1. Put the MicroSD card into the RPi and boot it up. You should get a desktop and a "Welcome..." window. Click "Next".
  2. Set your country, language, and time zone, then click "Next".
  3. Change your password.
  4. Set up your screen. "Next".
  5. Set up your WiFi. "Next".
  6. Update the software. "Next".
  7. Restart.

Configure Raspberry Pi Host Name and enable SSH

  1. When the Pi has finished rebooting, select "Preferences > Raspberry Pi Configuration" from the Raspberry menu.
  2. On the system tab, change the hostname.
  3. On the interface tab, you probably want to enable SSH.
  4. Click "OK" to save your configuration changes and then reboot the Pi (again).

Install Windows Networking

Wow. After changing the hostname, I'm able to SSH into the machine from a DOS prompt using my configured hostname. If you don't have SSH, it is part of the Git for Windows package. I'm not able to SSH in from my WSL Ubuntu terminal at this point, though, the hostname is unknown (although using IP address works). If step 15 below works for you, you may not really need any additional networking.

  1. Put the following Python script somewhere useful (like /home/pi/python/server.py) and run it.
    import SimpleHTTPServer
    import SocketServer
    
    PORT = 8000
    
    Handler = SimpleHTTPServer.SimpleHTTPRequestHandler
    
    httpd = SocketServer.TCPServer(("", PORT), Handler)
    
    print "serving at port", PORT
    httpd.serve_forever()
  2. Go to http://[hostname]:8000 in your favorite web browser. If you're as lucky as I've been this time around, you'll get a directory listing for / containing a link to your server.py file. If you click the link you should see the actual text of your Python script.