/SwiftyPi

Repo that contains the App, Server and Embedded code for my try! Swift Tokyo presentation

Primary LanguageSwift

SwiftyPi

Repo that contains the App, Server and Embedded code for my try! Swift Tokyo presentation

Setting up the RaspberryPi

If you want to set up the Raspberri Pi without using any Monitor, we can do it on a Headless Mode:

Mac and Pi connection

Before we insert our SD Card, we need to give our Pi access to the Internet. To do so, here are the following steps:

  • Connect your Mac and your Pi with an Ethernet Cable.
  • Go to System Preferences -> Sharing -> Select the ethernet connection and turn on Internet Sharing.

Accessing your Pi

  • List all the active networks using ifconfig
  • Check the IP on the bridge connection.
  • Map out the network using nmap -n -sP 192.168.NumberOfBridge.255/24
  • Copy the second IP from the list and do ssh ubuntu@second-ip-from-nmap
  • Introduce user ubuntu and password ubuntu and once logged in change the password.

Setting up Swift

Creating a Project

  • Create a folder with mkdir TestProject
  • Go into the folder and then do swift package init —type executable
  • Or if you prefer you can build an XCode project with swift package generate-xcodeproj
  • Build and run using swift run

Adding your Swift files

  • Use netatalk to be able to access the Pi’s folder system.
  • Use on the Mac open afp://ip-address-of-pi