Skip to content

Simple API inside Docker to remotely power on/off your Raspberry USBs

License

Notifications You must be signed in to change notification settings

lewixlabs/UsbPiAPI

Repository files navigation

UsbPiAPI

Simple API inside Docker 🐳 to remotely power on/off your Raspberry USBs (tested on Raspberry Pi 4b 8GB)

Engine which turns usb off/on is the uhubctl project

To build Docker image (remember to change env variables in Dockerfile)

docker build --rm --pull -f Dockerfile -t usb-api:latest .

To run the container

docker run --privileged -p443:443 --restart=always --name usbpiapi -v /etc/letsencrypt:/etc/letsencrypt -d usb-api

How to use this API

  • make a post call to your_url/lights

  • send these parameters in body:

    • psw (your password to obtain access to API)

    • powerOn (false -> lights off / true -> lights on)

About

Simple API inside Docker to remotely power on/off your Raspberry USBs

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published