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
- Get a Raspbian image from the Raspbian image site — just use the desktop + recommended image, your MicroSD card is at least 32GB right?
- Put the image on an SD card using Balena Etcher.
Boot Raspberry Pi
- Put the MicroSD card into the RPi and boot it up. You should get a desktop and a "Welcome..." window. Click "Next".
- Set your country, language, and time zone, then click "Next".
- Change your password.
- Set up your screen. "Next".
- Set up your WiFi. "Next".
- Update the software. "Next".
Configure Raspberry Pi Host Name and enable SSH
- When the Pi has finished rebooting, select "Preferences > Raspberry Pi Configuration" from the Raspberry menu.
- On the system tab, change the hostname.
- On the interface tab, you probably want to enable SSH.
- 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.
- 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()
- Go to
http://[hostname]:8000in 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.pyfile. If you click the link you should see the actual text of your Python script.