This project provides a simple webfrontend for myGPIOd. It uses the libmygpio library to connect to the myGPIOd socket.
- Install dependencies: cmake, libmygpio
- Get myGPIOd tarball from GitHub
- Extract myGPIOweb tarball and change path to this directory
- Run cmake:
cmake -B build -DCMAKE_INSTALL_PREFIX:PATH=/usr -DCMAKE_BUILD_TYPE=Release .
- Build:
make -C build
- Install (as root):
make -C build install
mygpioweb [option]...
Option | Description |
---|---|
-s , --socket |
myGPIOd socket (default: /run/mygpiod/socket ) |
-l , --listen |
HTTP listening address (default: http://0.0.0.0:8000 ) |
-o , --syslog |
enable syslog logging (facility: daemon) |
-h , --help |
displays this help |
-v , --version |
displays this help |
myGPIOweb provides a websocket to retrieve gpio events without polling and a REST API to control GPIOs.
Sends idle events from myGPIOd to connected clients.
- Path:
/ws
- Format:
{"gpio": <gpio number>, "event": <event>, "ts_ms": <timestamp in ms>}
Path | Method | Command |
---|---|---|
/api/gpio |
GET | gpiolist |
/api/gpio/{gpio number} |
GET | gpioget |
/api/gpio/{gpio number} |
OPTIONS | gpioinfo |
/api/gpio/{gpio number}/{blink, set, toggle} |
POST | gpioblink, gpioset, gpiotoggle |