TEMPer USB with a REST interface, all wrapped in Docker
This code Dockerizes https://github.com/padelt/temper-python and adds a lightweight REST API using Python Flask.
-
Pull the container
docker pull ghcr.io/chadhutchins182/temper-rest:main
-
Make note of the bus and device id for your sensor
$ lsusb Bus 001 Device 005: ID 413d:2107 Bus 001 Device 004: ID 0c45:7401 Microdia TEMPer Temperature Sensor Bus 001 Device 003: ID 0424:ec00 Microchip Technology, Inc. (formerly SMSC) SMSC9512/9514 Fast Ethernet Adapter Bus 001 Device 002: ID 0424:9514 Microchip Technology, Inc. (formerly SMSC) SMC9514 Hub Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
When providing the device to the container, it's:
/dev/bus/{bus-id}/{device-id}
-
Run the container
- Use docker run
docker run -p 5000:5000 --device=/dev/bus/usb/001/004:/dev/bus/usb/001/004 --name=temperrest ghcr.io/chadhutchins182/temper-rest:latest
- Or use docker-compose
- A sample docker-compose is provided in the repository
- Use docker run
- Fork
- Open Ticket for the feature or fix once you complete it
- Pull Request referencing the Open Ticket