Setup Swift 3.0 on a Raspberry Pi 2/3 with a headless Raspbian. Step-by-step
The index of the whole series: Raspbian headless with no cables, Swift 3.0 installed, and GPIO pins driving an LED, all over ssh from one machine.
Lately I’ve started hacking on a project that requires controlling some electric muscles/motors remotely. I decided to use only Swift 3.0 (dev previews) on a Raspberry Pi 2 or 3.
I have one problem though. I just want to ssh into the RPi, code there, launch the binary, without having to have a separate monitor, keyboard and mouse. Mainly, because I like to have just one machine to work on.
Here’s how to achieve that in few pretty-simple-but-still-not-that-simple steps:
- Setup your Raspberry Pi 2/3 with Raspbian headless (without cables)
- Installing Swift 3.0 snapshot/preview
- Using Swift to control the Raspberry Pi GPIO pins and turn an LED on
I have split this tutorial in few articles, so it’s easier to get what you need. First stop: Setup your Raspberry Pi 2/3 with Raspbian headless.
Read next
Setup your Raspberry Pi 2/3 with Raspbian headless (without cables)
Getting Raspbian onto a Raspberry Pi 2 or 3 and configured over ssh alone — no monitor, no keyboard, no mouse — ready for Swift 3.0 afterwards.
Installing Swift 3.0 preview on a Raspberry Pi 2/3 with Raspbian
Installing a Swift 3.0 preview build on a Raspberry Pi 2 or 3 running Raspbian, from apt sources to a first script that talks to the GPIO pins.
Using Swift to control the Raspberry Pi GPIO pins and turn an LED on
Reading the GPIO pin numbering, wiring an LED to GPIO4 on a breadboard and switching it on from Swift running on the Raspberry Pi itself.