https://github.com/squat/servor
a tiny HTTP API for controlling servos via GPIO
https://github.com/squat/servor
microservice raspberry-pi servo
Last synced: 12 months ago
JSON representation
a tiny HTTP API for controlling servos via GPIO
- Host: GitHub
- URL: https://github.com/squat/servor
- Owner: squat
- License: mit
- Created: 2019-09-09T09:54:45.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-04-24T01:27:45.000Z (almost 6 years ago)
- Last Synced: 2025-02-08T16:44:34.100Z (about 1 year ago)
- Topics: microservice, raspberry-pi, servo
- Language: Go
- Size: 422 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Servor
Servor is a tiny HTTP API that can control a servo connected to a GPIO pin.
[](https://travis-ci.org/squat/servor)
[](https://goreportcard.com/report/github.com/squat/servor)
## Getting Started
First, install servor's one dependency: [pi-blaster](https://github.com/sarfata/pi-blaster).
The easiest way to use servor is with the prebuilt container, e.g.:
```shell
docker run -p 8080:8080 squat/servor --pin=18
```
This container can be deployed to a Kubernetes cluster running on nodes with GPIO, e.g. a Raspberry PI running k3s:
```shell
kubectl apply -f https://raw.githubusercontent.com/squat/servor/master/manifests/pi-blaster.yaml
kubectl apply -f https://raw.githubusercontent.com/squat/servor/master/manifests/servor.yaml
kubectl port-forward svc/servor 8080
```
Once running, open the servor UI in a browser and use the arrow keys or buttons to control the connected servo:
```shell
$BROWSER http://localhost:8080
```
## API
Servor exposes two API endpoints:
### POST `/api/left`
This endpoint moves the servo one step to the left.
### POST `/api/right`
This endpoint moves the servo one step to the right.