Skip to content

abaker/gpio_httpd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gpio_httpd is a simple web server to control Raspberry Pi GPIO pins. Example use case is activating a relay

$ pip install -r requirements.txt
$ python gpio_httpd.py

Running curl -X POST http://localhost/17/low?ms=250 will set pin 17 to GPIO.LOW for 250 milliseconds

Running curl http://localhost/input/17 will return the result of GPIO.input(17)

Docker

docker run --device "/dev/gpiomem" -p "80:80" bakerba/gpio_httpd

Docker Compose

version: '3.3'

services:
  gpio_httpd:
    image: bakerba/gpio_httpd
    container_name: gpio_httpd
    devices:
      - "/dev/gpiomem"
    ports:
      - "80:80"

Usage

$ python gpio_httpd.py --help

usage: gpio_httpd.py [-h] [--debug] [--port PORT]

optional arguments:
  -h, --help           show this help message and exit
  --debug              enable debug logging
  --port PORT          port

About

HTTP API for Raspberry Pi GPIO pins

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published