Skip to content

Servo control IoT server using Raspberry Pi and client using iPhone developed only Swift.

License

Notifications You must be signed in to change notification settings

YutoMizutani/SwiftyServoControl

Repository files navigation

SwiftyServoControl

Swift platform MIT License

Servo control IoT server using Raspberry Pi and client using iPhone developed only Swift.

URLSession (iPhone X) -> Vapor (Raspberry Pi Zero W) -> SwiftyGPIO (Raspberry Pi Zero W) -> Servo motor (MG996R)

See movie here

For Developers

Written all options in ./Makefile.

Open

Open workspace (only macOS)

$ make open

Install Swift for Raspberry Pi

For Raspberry Pi Zero

Install Swift 4 (Swift 5 is not released yet)

See Official Swift-Arm Community Releases - swift-arm

$ make install-swift-raspberry-pi-zero

For Raspberry Pi (without Zero; e.g. 3B+)

Install Swift 5

$ make install-swift-raspberry-pi-without-zero

Install Vapor dependencies

For Debian

Install libssl-dev

$ make deps-debian

For macOS

Install libressl ios-sim

$ make deps-macos

Install Vapor CLI tools

For Debian

Not supported (Only macOS and Ubuntu)

See Vapor Docs #Install

For macOS

$ make deps-macos

Build

Server

$ make build-server

Client (iOS)

$ make build-client

Run

Server

$ make run-server
Set your own hostname and port number,
$ make run-server HOSTNAME=localhost PORT=8080

HOSTNAME: (detault: localhost)

PORT: (detault: 8080)

Client (iOS)

Open workspace and Run on Xcode (Not work ios-sim on Xcode 10.2)

See List empty of devices simulator with Xcode 10 #234 - ios-control/ios-sim

Set your own hostname and port number,

Xcode > Edit Scheme... > Run - Arguments > Environment Variables

HOSTNAME: (detault: localhost)

PORT: (detault: 8080)

Test

Server

$ make test-server

Client (iOS)

$ make test-client

About

Servo control IoT server using Raspberry Pi and client using iPhone developed only Swift.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published