rubycho / webpi

RaspberryPi (2) Controllable API

Repository from Github https://github.comrubycho/webpiRepository from Github https://github.comrubycho/webpi

webpi

Raspberry PI Controllable API. (Graduation Project)

Check out!

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)

# 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)
$ export PIGPIO_ADDR={YOUR_PI_ADDR}
$ coverage run manage.py test

About

RaspberryPi (2) Controllable API

License:MIT License


Languages

Language:Python 93.4%Language:Shell 6.6%