Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rubycho/webpi
RaspberryPi (2) Controllable API
https://github.com/rubycho/webpi
django drf gpio raspberry-pi webpi
Last synced: 16 days ago
JSON representation
RaspberryPi (2) Controllable API
- Host: GitHub
- URL: https://github.com/rubycho/webpi
- Owner: rubycho
- License: mit
- Created: 2020-01-31T11:44:40.000Z (almost 5 years ago)
- Default Branch: develop
- Last Pushed: 2021-09-22T18:29:41.000Z (over 3 years ago)
- Last Synced: 2024-10-31T00:24:45.009Z (2 months ago)
- Topics: django, drf, gpio, raspberry-pi, webpi
- Language: Python
- Homepage:
- Size: 67.4 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# webpi
Raspberry PI Controllable API. (Graduation Project)
## Check out!
- [Endpoints (swagger)](https://app.swaggerhub.com/apis-docs/rubycho/webpi/1.0.0/)
- [Installation (wiki)](https://github.com/rubycho/webpi/wiki/Installation)
- [Security Issues (wiki)](https://github.com/rubycho/webpi/wiki/Security-Issues)
- [Authorization (wiki)](https://github.com/rubycho/webpi/wiki/Authorization)
- [Error Responses (wiki)](https://github.com/rubycho/webpi/wiki/Error-Responses)
- [GPIO Limitations (wiki)](https://github.com/rubycho/webpi/wiki/GPIO-Limitations)
- [SPA Client (webpi-app)](https://github.com/rubycho/webpi-app)## This API Provides
- File Management
- file(s) information on directory (like `ls -al`)
- download and upload file
- create directory
- delete file or directory
- GPIO Management
- gpio pin(s) status (**only general + hw_pwm pins**)
- set mode of pin
- set output value of pin
- set pwm dutycycle and frequency of pin
- PI Infomation
- PI spec
- PI status (i.e. time, memory used, # of procs)
- process information (Top 10 CPU/MEM using processes)
- Simple Terminal
- create subprocess (`bash`)
- make input to subprocess
- get output from subprocess
- kill subprocess## Test Environment
- Raspberry PI 2
- Raspbian Buster (2019-06)
- SDCard >= 32GB## Dependencies
- `django` and `drf` for API server
- `pigpio` for controlling gpio
- `psutil` for retrieving process information## Run for dev purpose (Ubuntu)
```bash
# setup
virtualenv venv -p python3
source venv/bin/activate
pip install -r requirements.txt# run
export PIGPIO_ADDR={YOUR_PI_ADDR}
python manage.py runserver
```## Test
- uses django.test(`unittest`)
```bash
$ export PIGPIO_ADDR={YOUR_PI_ADDR}
$ coverage run manage.py test
```